Skip to main content

7. Keepin' Tracks — Postgres via Hyperdrive for primary data

Date: 2026-05-03

Status

Accepted

Context

The product requires large per-user datasets (e.g. thousands of finance transactions per user), relational queries, migrations, and strong consistency. Serverless SQLite on the edge (D1) is viable for some workloads but is a poorer fit for heavy transactional analytics and mature tooling at this scale target.

Decision

Use PostgreSQL as the system of record (e.g. Neon or equivalent managed Postgres), accessed from Workers through Cloudflare Hyperdrive for connection pooling and edge-adjacent performance.

Schema and modules remain inside the modular monolith API (tracks-api) until a future ADR justifies extraction.

Consequences

  • Positive: Familiar SQL, indexing for pagination, mature migration tools (e.g. Drizzle), path to read replicas if needed.
  • Positive: Aligns with high-volume Wealth flows and time-series Health metrics.
  • Tradeoff: Operational setup (Hyperdrive config, secrets, Neon billing); must not ship DB credentials to the client.