Skip to main content
InterviewHubPRO
Section Overview
Q20

Question 20 of 50

Part 2: Core Architecture & Implementation (Mid-Level)

40%
Redis & Caching (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)

How does Master-Replica Replication work in Redis?

senior LevelSystem Design

In Simple Words: Replication is asynchronous:

  1. Initial Sync (Full Resync): Master runs bgsave to create an RDB snapshot and sends it over the network to the Replica.
  2. The replica loads the RDB file into memory.
  3. Master buffers new writes in the Replication Backlog Buffer and streams them to the replica continuously.
  4. Partial Resync (PSYNC): If a replica briefly disconnects, it reconnects using its offset and fetches only missing delta bytes from the backlog buffer without a full RDB transfer.