← Lessons

quiz vs the machine

Gold1460

Databases

Redis Sentinel High Availability

Automatic failover for a primary replica setup.

5 min read · core · beat Gold to climb

Keeping a Primary Alive

Replication alone does not heal a failure: if the primary dies, someone must promote a replica and tell clients where to connect. Redis Sentinel automates this for non clustered, primary replica deployments.

What Sentinel Does

Sentinel is a separate process that:

  • Monitors the primary and its replicas with periodic pings.
  • Notifies operators when something goes wrong.
  • Performs automatic failover by promoting a replica when the primary is unreachable.
  • Acts as a discovery service so clients ask Sentinel for the current primary address.

Quorum and Agreement

To avoid a single Sentinel wrongly declaring a failure, you run several Sentinels. A primary is marked down only when a configured quorum of Sentinels agree it is unreachable. The Sentinels then elect a leader to run the failover, promote a chosen replica, and reconfigure the others to follow it.

Sentinel Versus Cluster

Sentinel gives high availability but not sharding: all data still fits on one primary. Redis Cluster gives both sharding and failover. Choose Sentinel when one node holds your data and you only need resilience, and Cluster when you also must scale capacity.

Key idea

Redis Sentinel monitors a primary replica pair and, once a quorum of Sentinels agrees the primary is down, promotes a replica and points clients at it.

Check yourself

Answer to earn rating on the learn ladder.

1. Why run multiple Sentinels with a quorum?

2. What does Sentinel provide that plain replication does not?