ADR-0003: Neon Postgres over Cloudflare D1
ADR-0003: Neon Postgres over Cloudflare D1
- Status: Accepted
- Date: 2026-07-30
- Supersedes: —
- Superseded by: —
Context
D1 is the Cloudflare-native database and the path of least resistance given ADR-0001. Both D1 and Neon are £0 at this scale.
Decision
Use Neon Postgres, reached through Cloudflare Hyperdrive.
Rationale
D1 is SQLite. The priority features — curated lists, discovery, search — want capabilities SQLite does not have:
- Postgres full-text search
pg_trgmfuzzy matching for typo-tolerant title search- JSONB for cached catalogue payloads
- Array columns for mechanics and tags
Discovery is a headline feature, not a nice-to-have, and it depends on these directly.
Consequences
- A second dashboard to watch, accepted in exchange for the query capability.
- Requires a connection-pooling strategy from Workers — see ADR-0004.
- Rules out an external search service: search is Postgres FTS +
pg_trgm, full stop.
Alternatives considered
Cloudflare D1. Zero-config, same-vendor, no pooling problem. Rejected on query capability.
D1 plus an external search service (Algolia, Typesense). Adds a third-party dependency, a sync surface, and a service outside the £0 constraint.