Distributed Databases
Combine partitioning, replication, transactions, and routing into one data service.
2–5 minute refresher
Client→Service A→Service B→State
Route a key → find authority → replicate state → recover ownership
30second
refresher
refresher
A distributed database spreads data and work across nodes while presenting one data service. Its behavior emerges from partitioning, replication, consistency, transaction, storage-engine, and metadata choices.
What problem does it solve?
One database node has finite capacity and one failure domain. Distribution adds scale and resilience while making routing, ownership, and cross-partition operations part of the database.
How it works
- Partition the logical keyspace into ownership units.
- Place replicas across independent fault domains.
- Use consensus, leases, or quorums to establish write authority.
- Route reads according to the advertised consistency contract.
- Move ownership, repair replicas, and evolve metadata under live traffic.
Decision guide
Key trade-offs
| Choice | What you gain | What it costs |
|---|---|---|
| Shared nothing | Independent scale and fault isolation | Data movement and distributed transactions |
| Shared storage | Fast compute replacement | Storage dependency and network cost |
| Client routing | One less proxy hop | Complex metadata refresh |
What happens if?
Routing metadata is stale
The old owner must reject or redirect the request using an ownership epoch. Blindly accepting a write risks split authority; blindly failing every stale client creates avoidable unavailability.
Where it appears
- DynamoDB
- Cassandra
- Spanner
- CockroachDB
Senior interview modeWhat are the main control-plane responsibilities in a distributed database?Show answer
Membership, placement, ownership metadata, rebalancing, schema state, failure recovery, and the safe transition of authority between replicas or shards.