Course contentsShow
← System Design
Lesson 72 of 1,9192. Scaling FoundationsFree lesson

Multi-Leader Replication Model

Learning when multiple nodes accept writes, introducing complexity around conflict resolution and consistency.

Multi-Leader Replication Model

What you'll learn: How allowing multiple nodes to accept writes simultaneously increases availability but introduces conflict resolution challenges.

The Core Idea

In single-leader replication, only one node accepts writes while others replicate data from it. But what if that leader fails or becomes unreachable? In a multi-leader (or multi-master) setup, multiple nodes can independently accept write operations. Each leader replicates its changes to the other leaders and their followers.

Think of it like having multiple bank branches that can each approve loans independently. They share information with each other, but occasionally two branches might approve conflicting loans for the same customer simultaneously—now someone needs to resolve that conflict.

When Multiple Writers Create Problems

When two leaders accept conflicting writes before synchronizing, you face write conflicts. For example:

  • Leader A updates a user's email to alice@example.com
  • Leader B updates the same user's email to alice@newdomain.com at nearly the same time
  • Which value wins when they sync?

Trade-offs of Multi-Leader Replication

Benefits:

  • Better availability—writes continue even if one leader fails
  • Lower write latency for geographically distributed users (write to nearest leader)
  • Offline operation support (each device/location acts as a leader)

Challenges:

  • Complex conflict resolution logic required
  • Weaker consistency guarantees
  • More difficult to reason about data state
  • Increased operational complexity

Multi-leader is often used in multi-datacenter deployments or collaborative editing applications where multiple users edit simultaneously.

Key Takeaway: Multi-leader replication trades simplicity and strong consistency for higher availability and performance, but requires careful conflict resolution strategies to handle concurrent writes.