โ† Redis learning path
Redis ยท Module 9 of 10

Replication, Sentinel and Cluster

Redis scales and survives failures with replicas and clusters.

๐Ÿ“– Key ideas

  1. A replica keeps a copy of the primary and can serve reads.
  2. Sentinel watches the primary and promotes a replica if it fails.
  3. Redis Cluster splits keys across nodes using 16,384 hash slots.
  4. Keys in one multi-key command must be in the same slot; hash tags {user42} help.
  5. Replication is asynchronous, so a failover can lose the latest writes.
๐Ÿ’ก Real-life example: Like a head chef with assistants: the assistants copy every recipe, and if the head chef falls sick one steps up.
ReplicaA copy of the primary's data
SentinelWatches and handles automatic failover
Hash slotOne of 16,384 buckets in a cluster
FailoverPromoting a replica to primary