Tutorials System Design Mastery

Master-Slave vs Multi-Master Replication

On this page

Database Replication

Replication is about Availability and **Read Scalability**. By keeping copies of your data on multiple servers, you can survive the death of a database node and handle millions of read requests.

1. Master-Slave (Leader-Follower)

One "Master" node receives all writes. It then broadcasts the changes to multiple "Slave" nodes. All reads are performed against the slaves. Best for: Read-heavy apps (Social Media, Blogs).

2. Multi-Master (Leader-Leader)

Every node can receive both reads and writes. Nodes eventually sync with each other. Pros: No single point of failure for writes. Cons: "Conflict Resolution" is a nightmare. If two people update the same record on different masters at the same time, which one wins?

4. Interview Mastery

Q: "What is 'Replication Lag' and how do you handle it?"

Architect Answer: "Replication lag is the delay between a write finishing on the Master and appearing on the Slave. If a user updates their profile and then immediately refreshes, they might see the 'Old' data from the slave. We fix this using **Read-Your-Own-Writes** consistency: we force any reads that occur within X seconds of a write to go directly to the Master instead of the slaves."

Questions on this lesson 0

Sign in to ask a question or upvote helpful answers.

No questions yet — be the first to ask!

System Design Mastery
Course syllabus
1. Distributed Systems Fundamentals
2. Database Scalability
3. Caching & CDN Strategies
4. Event-Driven Architecture
5. High Availability & Load Balancing
6. Microservices & API Gateway
7. Monitoring & Disaster Recovery
8. FAANG System Design Interview
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details