Search DistillSys

Find a concept

Type at least two characters to search lessons, designs, papers, and interview prep.

Storageintermediate7 min read

Distributed Databases

Combine partitioning, replication, transactions, and routing into one data service.

2–5 minute refresher
Mental model

Route a key → find authority → replicate state → recover ownership

30second
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

  1. Partition the logical keyspace into ownership units.
  2. Place replicas across independent fault domains.
  3. Use consensus, leases, or quorums to establish write authority.
  4. Route reads according to the advertised consistency contract.
  5. Move ownership, repair replicas, and evolve metadata under live traffic.
Decision guide

Key trade-offs

ChoiceWhat you gainWhat it costs
Shared nothingIndependent scale and fault isolationData movement and distributed transactions
Shared storageFast compute replacementStorage dependency and network cost
Client routingOne less proxy hopComplex 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.
#databases#replication#sharding#metadata