Database / Google Spanner Database Interview questions
Explain the internal working of Paxos in Spanner replication?
Every split in Spanner is replicated across a set of replicas (typically 3, 5, or more depending on the instance configuration) that form an independent Paxos group. One replica is elected leader for that group; the rest are followers that can serve reads but don't originate writes for that split.
A write only needs acknowledgment from a majority of replicas in the group, not all of them, so the group tolerates the loss of a minority of replicas without losing data or availability. If the leader fails, the surviving replicas run a Paxos leader election to pick a new leader, using a lease mechanism so at most one leader is active at a time. Because every split has its own independent Paxos group, Spanner runs thousands of these groups in parallel across a large database, which is what lets replication scale horizontally alongside the data itself.
More Related questions...