Last Minute Notes
  • Github
  • Docs
  • Learn
    @sayanstwt
Lessons
0/37 done
  • SQL vs NoSQL
  • Indexes & Storage Engines
  • Replication
  • Sharding
  • Consistent Hashing
  • Object Storage & Uploads
  • Search & Inverted Indexes
Learn/System Design/Data & Storage

Replication

8 min Intermediate 8 steps

Leaders, followers, lag, and what a failover can lose.

Copies
1
Read capacity
1 node
If it dies
outage
ClientDatabasethe only copyreads + writesreadwritereadwrite
request response data
In this lessonStep 1 of 8
  1. The problem
  2. Leader-follower
  3. Sync vs async
  4. Failover
  5. Lag anomalies
  6. Multi-leader
  7. Leaderless
  8. Recap
Step 1 / 8problem

One copy of the data

Every read and write lands on one database. It is the read bottleneck, and if its disk dies the data is offline or gone.

Key idea

Replication copies data to multiple nodes for availability, read scaling and locality.

←→ step·R replay·Space pause

You'll learn

  • Why keep copies: availability, read scaling, locality
  • Trade sync, async and semi-sync replication
  • Explain how async failover loses acknowledged writes
  • Fix replication lag anomalies
  • Compare leader-follower, multi-leader and leaderless
Read the full notesHLD Building Blocks, 9