PATTERN Cited by 1 source
A/B variant prototyping at database level¶
Pattern¶
When two competing schema designs are in contention, build both on parallel database branches forked from the same parent, run the application's critical read/write paths against each, measure what matters, and keep the better solution. Discard the losing branch. Document the decision and reasoning in the PR description as a permanent design record.
Mechanics¶
- Create two branches off the same parent (staging or production).
- Apply Design A's migration to branch A, Design B's migration to branch B.
- Run the application against each. Measure:
- Query latency on the common read path.
- Migration execution time at production data volume.
- Index footprint and storage overhead.
- Lock contention under simulated load.
- Pick the winner. Discard the loser. Document why in the PR.
Why it works now¶
Per-branch cost is near zero on copy-on-write substrates like Lakebase or Neon. Exploring two designs no longer requires picking one in advance, and no longer requires a provisioning process most teams won't undertake for an exploratory question. Both branches share all unmodified pages with the parent — storage cost is only the delta of each design's writes.
Canonical example¶
Jen considered two designs for the location/batch/serial feature: three new columns on the existing
inventorytable, or a separateinventory_attributeslookup table keyed byinventory_id. She built both on parallel branches off staging, measured query performance on the common read path against production-shaped data, and saw the lookup-table version performed worse because every inventory display required a join. She shipped the columns version, discarded the lookup-table branch, and left a note: "Considered lookup-table version; rejected because the common read path becomes a join. Revisit if more than five attributes accumulate."(Source: sources/2026-06-05-databricks-enabling-evolutionary-database-development-database-branchin)
Anti-patterns¶
- Prototyping without documenting the decision. The branches are gone in a second; the design decision should be permanent. Without the PR note, the next developer who extends the schema doesn't know what was considered.
- Running A/B experiments against synthetic toy data. The value of this pattern is measuring against production-shaped data. If both designs look equivalent on 100 rows, the comparison provides no signal.
Related¶
- concepts/evolutionary-database-design — Practice #9 in the 2026 extended playbook.
- patterns/per-developer-database-branch-paired-with-code-branch — the per-developer branch is the context in which A/B prototyping happens.
- patterns/expand-and-contract-schema-migration — the winning design is deployed using expand-and-contract.