Home›Design›Design doc template
Designs · template

Database design doc template

What should a database design doc answer before anyone picks a product?

This is the outline every design doc on this site follows. Copy it into your own doc and fill it in for one application or feature. The order matters: the workload comes before the store, and the cost of a lost write comes before the replication setting.

# Database design: <application or feature>

Author: <name>    Date: <date>    Status: draft | in review | decided

## 1. What the application does
One paragraph, in business terms. Who uses it, and what they do.

## 2. The workload
| Dimension      | Today | In 12 months | How we know |
|----------------|-------|--------------|-------------|
| Writes per sec | peak: | peak:        |             |
| Reads per sec  | peak: | peak:        |             |
| Data size      |       |              |             |
| Growth         |       |              |             |
| Read pattern   | by key / by range / aggregates / text / similarity |
| Latency target | p99:  |              |             |

## 3. What a lost or wrong write costs
Money? A retry? Nothing? This decides the commit and replication settings.

## 4. What goes where
| Data | Store | Source of truth or copy? | Why |
|------|-------|--------------------------|-----|

## 5. Data model
Core tables or collections, keys and indexes. The three most frequent queries
and the index that serves each.

## 6. Rules the database enforces
Unique constraints, checks, foreign keys, exclusion constraints, row-level security.

## 7. Durability and recovery
Commit setting, replication (sync or async), backups, point-in-time recovery,
restore tested on: <date>. RPO: <seconds>. RTO: <minutes>.

## 8. How it grows
Stage 1 (now), stage 2 (trigger: ...), stage 3 (trigger: ...).

## 9. What breaks first
| Failure | What we will see | What we will do |
|---------|------------------|-----------------|

## 10. Alternatives considered
| Option | Why not |
|--------|---------|

## 11. Cost
Main lines of the bill, and what we will review monthly.

## 12. Open questions

How I use it: I fill in sections 2 and 3 with the team before anyone names a database. Many disagreements about the store are really disagreements about the workload, and those are easier to settle with numbers.

Worked examples: the fourteen design docs.

Part 3 of 4 · Design · 24 pagesAll pages

Which database does my application need? What kind of application data goes in which database, and why, as design docs, plus the anti-patterns and the decisions behind them.