DISCIPLINE 03 · DATA
Database Architecture
Schema design, indexing strategy and migration paths. The right store for the access pattern.
DURATION
3–8 weeks
GATES
4 phases
ENGAGEMENT
Fixed scope
STACK
PostgreSQL · MongoDB · Prisma
What you get
Six artefacts, all of them yours on delivery. No phase closes without its output.
- 01Schema with every table, index and constraint documented
- 02Migration path from the current store, rehearsed on a copy
- 03Query plan review for the ten heaviest queries
- 04Access-pattern document mapping each read and write
- 05Backup, restore and retention procedure, tested
- 06Handover session recorded, with the reasoning behind each index
Tooling
RELATIONAL
PostgreSQL 16, partitioning where tables warrant it
DOCUMENT
MongoDB 7 where the access pattern is document-shaped
ORM
Prisma, with raw SQL where the planner needs it
MIGRATIONS
Versioned, reversible, run in CI before deploy
ANALYSIS
EXPLAIN ANALYZE, pg_stat_statements, Atlas for schema diffs
Timeline
01
Discovery
1 WEEKAccess-pattern audit, slow query log, growth profile
02
Architecture
1–2 WEEKSSchema, index strategy, migration plan
03
Delivery
2–5 WEEKSMigrations shipped behind flags, verified on a copy
04
Operate
ONGOINGPlan regression checks, capacity review, vacuum tuning
WHEN NOT TO USE THIS
The queries are fine and the service layer is the bottleneck. That is BACKEND.
You need a store chosen for a greenfield app with no data yet. A one-day review covers it.
The problem is reporting, not the operational schema. Analytics is a different engagement.