Siddhant DevalAuthor
Senior Full-Stack Engineer·Aug 30, 2026·20 min read
Database War Stories: Failure Modes & Recovery Patterns
Production database failures are predictable — each paradigm has a canonical failure mode that appears reliably at scale. This capstone article catalogs the most common incidents across PostgreSQL, MongoDB, DynamoDB, Redis, Elasticsearch, CockroachDB, and Cassandra, with per-paradigm recovery playbooks and GDPR compliance failure modes.
Technical Series
Modern Database Paradigms
Part 8 of 8
Database War Stories: Failure Modes & Recovery Patterns
Selecting the right database is a foundational architectural decision; data gravity ultimately dictates the scalability and resilience of an application — choose the paradigm first, the product second. The series has covered what to choose and when. This capstone article covers what happens when you get it wrong — or when you get it right but miss an operational detail. Every failure mode catalogued here has been observed in production systems. None of them are edge cases. They are the canonical failure patterns that appear reliably as databases scale, and understanding them before they happen is the difference between a 2-hour incident and a 2-week recovery.
1. PostgreSQL — Connection Exhaustion & VACUUM Bloat
Connection Pool Exhaustion

Expand
bash
Crucial Requirement
PgBouncer in
TRANSACTION mode (not SESSION mode) is required for connection multiplexing to work. In SESSION mode, one application connection holds one Postgres connection for its entire lifetime — no gain. In TRANSACTION mode, a Postgres connection is checked out only for the duration of a transaction — this is the multiplexing that makes 5,000 app connections share 20 Postgres connections safely.VACUUM Bloat
sql
2. MongoDB — Unbounded Arrays & Write Concern
The 16MB Document Limit in Production
javascript
Write Concern Misconfiguration
javascript
3. DynamoDB — Hot Partitions & Scan Cost Explosion
Hot Partition
typescript

Expand
Scan Cost Explosion
typescript
4. Redis — Thundering Herd & AOF Rewrite OOM
Thundering Herd on Cold Start
typescript
AOF Rewrite OOM
bash
5. Elasticsearch — Mapping Explosion & Split Brain
Mapping Explosion
bash
6. CockroachDB — Clock Skew & Retry Storm
Clock Skew-Induced Cluster Pause
bash
7. Cassandra — Tombstone Accumulation
bash
8. GDPR Compliance Failure Modes
Right-to-Erasure in Append-Only Stores
Crucial Requirement
GDPR right-to-erasure is not a single
DELETE statement — it is a multi-store, multi-step, audited process. Design your data map (which stores hold which PII fields) before your first user registration, not after your first erasure request. Tooling like Piiano Vault, AWS Macie, or a custom PII registry simplifies the audit trail.9. Per-Paradigm Recovery Playbooks
| Paradigm | Top 2 Failure Modes | Immediate Mitigation | Never Do This |
|---|---|---|---|
| PostgreSQL | Connection exhaustion; VACUUM bloat | PgBouncer transaction mode; tune autovacuum | VACUUM FULL on a live high-traffic table |
| MongoDB | 16MB document limit; write concern w:0 | Migrate unbounded arrays; set w:majority | Store audit logs in the user document |
| DynamoDB | Hot partition; Scan in production | Write-shard suffix; always Query with PK | Use FilterExpression without KeyConditionExpression |
| Redis | AOF rewrite OOM; Thundering Herd | Reserve 50% RAM; mutex cache population | Restart Redis without persistence enabled |
| Elasticsearch | Mapping explosion; split-brain | dynamic: strict; enforce minimum_master_nodes | Use Elasticsearch as a primary database |
| CockroachDB | Clock skew; serialization retry storm | Enforce NTP; implement retry with backoff | Ignore 40001 SQLSTATE codes |
| Cassandra | Tombstone accumulation; wrong compaction | Use TTL instead of DELETE; switch to TWCS | Use STCS for time-series workloads |
Summary
| Concept | Rule |
|---|---|
| Connection exhaustion | PostgreSQL connection exhaustion is the #1 scaling failure — deploy PgBouncer in transaction mode before you need it. |
| DynamoDB hot partitions | DynamoDB hot partitions originate from non-uniform partition key access — model with write sharding from day one, not after the incident. |
| Cache stampede | Redis cache stampede requires probabilistic early expiry or a distributed lock on cache population — TTL configuration alone does not prevent it. |
| Elasticsearch mapping | Elasticsearch mapping explosion is a schema governance failure — enforce dynamic: strict and index templates in all production indexes. |
| GDPR erasure | GDPR right-to-erasure is architecturally incompatible with immutable append-only stores; design a tombstone or encryption-key-deletion strategy before the first write. |
Research & Synthesis Note
This article was developed with AI-assisted deep search, specification cross-referencing, and technical research synthesis.
#Database Reliability#Incident Response#PostgreSQL#DynamoDB#Redis#Cassandra#CockroachDB#GDPR
Technical Series
Modern Database Paradigms
Part 8 of 8