Add ADR052 on storing analytics - #263
theseanything wants to merge 1 commit into
Conversation
We want to measure submissions over time and the number of live forms, keeping the data for at least two years. Existing tools (OTel and Classic CloudWatch metrics, GA4, Splunk, Logs Insights, the runner database) fall short on accuracy, cost, cardinality, retention or ownership. This record sets out the two credible options, S3 Tables queried with Athena or a separate Aurora cluster, for the team to choose between. It is marked Proposed until that choice is made.
| - Table schemas are defined in Terraform, but the provider does not support partitioning yet (not a big concern at our scale). | ||
| - Athena queries take seconds, too slow for the request path. Showing per-form statistics in forms-admin would need a faster way to query. | ||
|
|
||
| ### Option B: a separate Aurora PostgreSQL cluster for analytics |
There was a problem hiding this comment.
Think this is my preferred option atm - as whilst it's more expensive, it's a comparatively small infra cost. We are unlikely to run into performance issues at our scale and is more flexible.
There was a problem hiding this comment.
Do we have a sense of how other teams do it?
| - Unfamiliar services: S3 Tables, Firehose and Athena. | ||
| - Firehose delivery is at-least-once, so queries may need de-duplication or the transform needs an idempotency key. | ||
| - Table schemas are defined in Terraform, but the provider does not support partitioning yet (not a big concern at our scale). | ||
| - Athena queries take seconds, too slow for the request path. Showing per-form statistics in forms-admin would need a faster way to query. |
There was a problem hiding this comment.
There's a reasonable demand for funnel analytics from form creators, and we've been talking about adding metrics for save and return.
I think it's a reasonable assumption that certain metrics/analytics we make available to form creators we'll also want to use for internal performance analytics.
So I think a solution that works for both purposes seems best, otherwise we have to maintain emitting metrics from forms-runner in 2 different ways.
There was a problem hiding this comment.
I agree.
I think it's worth adding our requirements for these to the context. In the context of KPIs this last point wouldn't be a so much of a con.
We want to measure submissions over time and the number of live forms, keeping the data for at least two years.
Existing tools (OTel and Classic CloudWatch metrics, GA4, Splunk, Logs Insights, the runner database) fall short on accuracy, cost, cardinality, retention or ownership.
This record sets out the two credible options, S3 Tables queried with Athena or a separate Aurora cluster, for the team to choose between. It is marked Proposed until that choice is made.