Redis Sentinel & High Availability

7 questions found

What is Redis Sentinel, and what role does it play in providing high availability for a non clustered Redis setup?

Beginner
Redis Sentinel is a separate monitoring system that continuously watches your primary and replica Redis instances, and if it detects the primary has failed, it automatically coordinates promoting one of the replicas to become the new primary, providing automatic failover without needing to run a full Redis Cluster.
-- Sentinel configuration file
sentinel monitor mymaster 192.168.1.10 6379 2
Real-world example A company running a simple primary and replica Redis setup adds Sentinel to automatically detect and recover from a primary failure, without needing the added complexity of setting up a full Redis Cluster.

Common follow-ups: How many Sentinel instances are recommended for a production deployment?;What is the difference between using Sentinel and using Redis Cluster for high availability?

Redis Replication;Clustering

Why does Redis Sentinel recommend running at least three Sentinel instances rather than just one?

Beginner
Running multiple Sentinel instances allows them to reach a quorum, meaning a majority agreement, before deciding a primary has actually failed and triggering a failover, which prevents a single Sentinel instance's own network issue or crash from incorrectly triggering an unnecessary failover based on a false alarm.
-- Three or more Sentinels provide reliable quorum based decisions
sentinel monitor mymaster 192.168.1.10 6379 2
Real-world example A team running three Sentinel instances across different servers avoids an unnecessary failover when just one Sentinel briefly lost network connectivity, since the remaining two correctly determined the primary was actually still healthy.

Common follow-ups: What is the quorum value in a Sentinel configuration, and how do you choose an appropriate one?;What happens if fewer Sentinels than the quorum value are currently reachable?

Redis Replication;Redis Architecture & Installation

How does an application discover the current primary Redis instance when using Sentinel, especially after a failover has occurred?

Intermediate
Rather than connecting directly to a specific server address, a Sentinel aware client library asks one of the Sentinel instances for the current address of the primary, and after a failover happens, subsequent queries to Sentinel automatically return the new primary's address, letting the application always connect to the correct, currently active primary.
-- Client asks Sentinel for the current primary address
SENTINEL get-master-addr-by-name mymaster
Real-world example An application configured with a Sentinel aware client library automatically reconnects to the newly promoted primary after a failover, since it always asks Sentinel for the current address rather than hardcoding a specific server.

Common follow-ups: What happens to an application's existing connections during the brief period while a failover is happening?;Do all Redis client libraries support Sentinel awareness?

Connection Pooling & Client Libraries;Redis Replication

What is the quorum setting in a Sentinel configuration, and how does it affect the decision to trigger a failover?

Intermediate
The quorum setting specifies the minimum number of Sentinel instances that must agree the primary is actually unreachable before a failover process begins, providing protection against a single Sentinel's false positive triggering an unnecessary and potentially disruptive failover based on its own isolated network issue.
sentinel monitor mymaster 192.168.1.10 6379 2
-- The final number 2 is the quorum value
Real-world example A team running five Sentinel instances configures a quorum of three, ensuring a majority must agree before any failover is triggered, providing strong protection against a false alarm caused by any single Sentinel's temporary issue.

Common follow-ups: How do you choose an appropriate quorum value for a given number of Sentinel instances?;What happens if the quorum is set too low relative to the total number of Sentinels?

Redis Replication;Redis Architecture & Installation

How would you deploy Redis Sentinel across multiple data centers or availability zones to maximize resilience against a localized failure?

Advanced
You would spread your Sentinel instances and your primary and replica Redis servers across different physical locations or availability zones, ensuring that a failure affecting one specific location does not simultaneously take down enough Sentinel instances or Redis servers to prevent the remaining quorum from correctly detecting a failure and coordinating an appropriate failover.
-- Spread Sentinels across three separate availability zones
-- so a single zone failure does not prevent quorum
Real-world example A company deploys their three Sentinel instances and their Redis primary and replica across three separate availability zones, ensuring that even if an entire zone experiences an outage, the remaining infrastructure can still correctly detect and handle any resulting failure.

Common follow-ups: How many availability zones are generally recommended for this kind of resilient deployment?;What network latency considerations apply when spreading Sentinel across multiple zones?

Redis Replication;Redis Backup & Disaster Recovery

What is the difference between using Redis Sentinel and using Redis Cluster for achieving high availability, and how would you decide between them?

Advanced
Sentinel is generally simpler to set up and manage, providing automatic failover for a primary and replica setup without sharding your data across multiple nodes, while Redis Cluster additionally provides horizontal scaling through sharding, making Cluster the better choice when your dataset needs to be distributed across multiple nodes for capacity reasons, while Sentinel remains a solid, simpler choice when a single node's capacity is sufficient and you mainly need automatic failover.
-- Sentinel: high availability without sharding
-- Cluster: high availability combined with sharding
Real-world example A team whose entire dataset comfortably fits on a single Redis instance chooses Sentinel for its simplicity and automatic failover, while a much larger company whose data exceeds a single instance's capacity chooses Redis Cluster instead for both scaling and availability together.

Common follow-ups: Can Sentinel and Cluster be combined together in the same deployment?;What migration path exists if a Sentinel based deployment eventually needs to become a Cluster?

Clustering;Redis Replication

How do you check the current status of a Sentinel deployment to confirm it is properly monitoring your Redis primary and replicas?

Intermediate
You connect to any Sentinel instance using redis-cli and run the SENTINEL MASTERS command to see the currently monitored primary's status, or SENTINEL SLAVES to see the status of monitored replicas, confirming Sentinel has correctly discovered and is actively monitoring your entire Redis deployment as expected.
redis-cli -p 26379 sentinel masters
redis-cli -p 26379 sentinel slaves mymaster
Real-world example A database administrator verifies a newly deployed Sentinel setup by checking that it has correctly discovered both the primary and all expected replicas, confirming the monitoring configuration is working as intended before relying on it in production.

Common follow-ups: What port does Sentinel typically run on by default?;How do you check whether Sentinel currently believes the primary is healthy or in a failure state?

Redis Monitoring & Observability;Redis CLI & Basic Commands