Database Load Testing: Realistic Patterns
Load tests that don’t match production traffic are theatre. Realistic test design matters more than the tool.
Why synthetic tests miss
Synthetic loops do uniform queries; production has skew, multiple shapes, transactions, lock contention.
Without realistic shape, tests pass; production fails.
Four-component realistic test
- 1. Mixed query shapes (read/write ratio).
- 2. Realistic data distribution (skew matches production).
- 3. Concurrent transactions (with retries).
- 4. Failure injection (network blips; one node down).
Production-like data shape
Anonymized production dump as test data.
Synthetic data: must reproduce skew patterns; not just volume.
Test cadence
Quarterly: full load test against next-major release.
Pre-deploy: smoke load test for major changes.
Antipatterns
- Uniform synthetic data. Misses hot-key issues.
- Read-only tests. Misses contention.
- Test in dev DB. Wrong scale; wrong data.
What to do this week
Three moves. (1) Apply this pattern to your most-loaded table. (2) Measure query latency / write throughput before/after. (3) Document the win and the constraint so the next refactor inherits the knowledge.