Database Engineering · Scaling the database
Distributed databases
A distributed database splits data into ranges and keeps several copies of each on different machines, agreeing on every write by majority. It survives failures on its own, but every write pays for that agreement.
- Time20 min
- LevelSenior
- Experiments1 live
- Check6 questions






Client sends the write to the range's leader.
Leader appends the write to its log at the next position.
Replication sends the entry to both followers.
Majority one follower confirms; with the leader that is 2 of 3: committed.
Reply the leader applies the change and answers; the slow follower catches up.
SQL layer parses queries and plans which ranges they need.
Ranges the data split by key, split and moved automatically.
Consensus replication each range's copies agree through Raft or Paxos.
Storage each node keeps its copies on local disk.