Try
↑ ↓ move↵ openesc close

Interview prep / Replication and lag

Junior · Replication and lag · System design interview question

Why do systems replicate a database, and what does replication not give you?

Sketch your own answer first, then compare it with the one below.

A strong answer

Replication keeps the same data on several machines. It gives availability, because if one machine dies another has the data, and read capacity, because reads can be spread over the copies. It can also place data close to users.

It does not give you more storage, since every replica holds everything. And with a single leader it does not give you more write throughput, since every write still goes through that one machine.

Each limit has a next step. Partitioning adds storage and write capacity. Multi-leader or leaderless designs let writes be accepted in several places.

Sources

Learn it by running it

The replication and lag lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms