ADR-0012024-03-15Review: 2024-09-15
Accepteddatabaseanalyticsbackend
Adopt Postgres over DynamoDB for analytics
Problem
Analytics queries are becoming complex and DynamoDB makes aggregation difficult without expensive scan operations. The team spends significant time working around its limitations.
Options
- Continue with DynamoDB and build a query layer
- Introduce Postgres for analytics workloads
- Move to a managed data warehouse (Redshift, BigQuery)
Decision
Introduce Postgres as the analytics database while keeping DynamoDB for transactional workloads. The team has existing Postgres expertise and the data volume does not yet justify a full data warehouse.
Trade-offs
Operational overhead increases (one more database to manage). Querying flexibility improves significantly. Risk of schema drift between transactional and analytics stores must be managed with an ETL process.