Skip to the guide

Multi-leader and leaderless replication

AdvancedConcept3 pages

With one leader (Leader-follower replication), every write in the world goes through one machine in one place. Two other designs let several copies accept writes: multi-leader, with a leader in each region or on each device, and leaderless, where any replica takes a write. Interviewers want to hear when that's worth it, and what you do when two writes collide.

Branch offices and the address book

A company has offices in London, New York and Singapore, and each keeps a copy of the customer address book.

In the first arrangement, each office has a clerk who updates the local copy at once and posts the day's changes to the other offices every evening. Service is quick, and an office keeps working if the post stops. But if a customer gives London and New York two different new addresses on the same day, the evening post brings two changes to one entry, and someone has to decide which stands.

In the second, nobody is in charge. Whoever takes a change writes it into three books at once; whoever looks someone up checks several and trusts the most recent entry; a book found out of date gets corrected.