System Design (50 Qs)•Part 3: Distributed Transactions, Consensus & Reliability (26 - 36)
Database Replication Lag, Split-Brain & Leader Election.
In Simple Words:
- Replication Lag: Time elapsed between a write committing to the Leader and replicating to Followers. Causes users to see stale data if they read from followers immediately after write.
- Split-Brain: When a network partition divides a cluster into two isolated subnets, and both subnets elect their own Leader and accept conflicting writes.
- Fix: Strict Majority Quorum ($N/2 + 1$). A partition can only elect a leader if it contains more than half the total cluster nodes.