Baseleg Docs

ADR-002: Database choice

Date: 2026-04-28 Status: Accepted

Context

Baseleg needs a simple relational store suitable for the Cloudflare platform, with a pragmatic query layer that does not force an early heavy architecture.

Decision

  • Use Cloudflare D1 as the primary relational database.
  • Use Drizzle as the query/migration toolkit.

Consequences

  • Infrastructure owns Drizzle/D1 wiring and repository implementations.
  • Schema changes must include migrations in db/migrations/.

Alternatives considered

  • Postgres (requires different hosting model)
  • Prisma (heavier tooling for the initial stage)
  • KV-only storage (insufficient relational guarantees)