Redis high availability: replicas, Sentinel and cluster mode compared
Redis high availability starts with asynchronous replication, so every failover can lose writes the old primary had acknowledged. Sentinel and cluster mode decide who promotes a replica and how clients find it. This guide compares them and says what each one still loses.
45 minutes with an engineer: we review your workload and sketch the design.
- ✓Docs read 19 Nov 2026
- ✓Applies to Valkey too
Redis high availability means a replica takes over when the primary fails. Replication is asynchronous, so acknowledged writes can be lost. Sentinel adds failover for one dataset and needs three instances. Cluster mode adds failover and sharding across 16384 hash slots. WAIT narrows the loss window but never closes it. Read from the Redis and AWS docs, 19 Nov 2026.
Customers
Partners
How does Redis replication provide high availability?
A Redis replica keeps an exact copy of a primary by receiving its stream of writes, and it can be promoted when the primary fails. Replication is asynchronous by default, so the primary does not wait for replicas, and that is the source of every failover's write-loss window.
- Asynchronous acknowledgement.
- Replicas report how much of the stream they have processed periodically, and the primary does not wait for each command (Redis replication docs, checked 19 Nov 2026). Replication is non-blocking on the primary while replicas sync.
- Partial and full resync.
- A replica that drops its link asks for just the missed part of the stream. If the primary's in-memory backlog does not hold it, a full resync follows: the primary snapshots the whole dataset, sends it and then resumes the stream.
- Promotion changes history.
- A promoted replica gets a new replication ID and remembers the old one, so other replicas can usually resync without a full copy. Since Redis 4.0 this holds after a failover.
- What replication is not.
- It is not a backup. A bad write or a FLUSHALL replicates to every replica within moments, so recovery from that needs an RDB or AOF copy.
Everything below sits on this layer. Sentinel and cluster mode add failure detection and promotion, not a different replication mechanism.
How many writes can a Redis failover lose?
Redis can lose writes it has already acknowledged, and there is no setting that makes the window zero. WAIT and min-replicas-to-write shrink it. Persistence settings decide what survives a restart, which is a different question from what survives a failover.
| Control | What it does | What it does not do |
|---|---|---|
| WAIT | A client asks that a write reach a number of replicas before continuing. The Redis docs say it does not make Redis a strongly consistent system, and acknowledged writes can still be lost in a failover, depending on persistence (replication docs, checked 19 Nov 2026). | Close the window. It removes most of the likelihood, leaving hard-to-trigger failure modes. |
| min-replicas-to-write, min-replicas-max-lag | A primary stops accepting writes if fewer than N replicas have a lag within M seconds. Replicas ping the primary every second. The example in the Sentinel docs uses 1 and 10, and the defaults in the source are 0 (off) and 10 (Valkey config.c, checked 19 Nov 2026). | Guarantee a given write. The docs call it a best-effort bound on the window. |
| appendfsync everysec (AOF) | The default AOF policy fsyncs once a second, so a crash can lose about one second of writes. always fsyncs on every write batch and is slow; no leaves it to the kernel (persistence docs, checked 19 Nov 2026). | Help after failover: it protects one node's restart, not the promoted replica's view. |
| RDB snapshots | Point-in-time snapshots, usually every five minutes or more, so a crash can lose the latest minutes. The fork can pause clients for some milliseconds, or up to a second on a very large dataset. | Give a tight recovery point. The Redis docs suggest AOF and RDB together for a safety level comparable to PostgreSQL. |
Valkey documents the same behaviour, including WAIT, WAITAOF, min-replicas-to-write and min-replicas-max-lag, and says acknowledged writes can still be lost during a failover (Valkey replication docs, checked 19 Nov 2026). The min-replicas defaults are read from the Valkey source; the Redis docs refer to the example redis.conf for them.
Persistence and failover do different jobs. Failover handles one node dying while the others live. Persistence handles a restart or the loss of every node. The Redis docs warn that a primary with persistence off and an automatic restart can come back empty, after which its replicas copy the empty dataset. With Sentinel the primary can restart quickly enough that no failure is detected, so the docs say to keep persistence on in the primary and the replicas, or to disable automatic restarts (replication docs, checked 19 Nov 2026).
How does Redis Sentinel work?
Sentinel is a set of separate processes that watch a primary and its replicas, agree it has failed, elect a leader, promote a replica and tell clients where the new primary is. The documentation requires at least three Sentinel instances on three separate machines.
| Item | What the documentation says | Why it matters |
|---|---|---|
| Instances | At least three Sentinels, on three different boxes. Two Sentinels with quorum 1 are called broken in the docs (Sentinel docs, checked 19 Nov 2026). | If the machine running two of three Sentinels dies, no majority remains to authorise a failover. |
| Quorum | The quorum is the number of Sentinels that must agree the primary is unreachable. It is used only to detect the failure. A failover itself needs a majority of all Sentinel processes to elect a leader. | A quorum of 2 with 5 Sentinels still needs 3 to authorise the failover. SENTINEL CKQUORUM tests this and suits a monitoring check. |
| down-after-milliseconds | How long an instance must be unreachable before a Sentinel marks it down. The sample sentinel.conf documents 30 seconds as the default (Redis sentinel.conf, Valkey sentinel.conf, checked 19 Nov 2026). | Lower values detect failure sooner and mistake slow replies for failure more often. |
| failover-timeout | The sample sentinel.conf documents 3 minutes as the default, per primary name. | It bounds how long a single failover attempt may run and the wait before the next one. |
| parallel-syncs | How many replicas resync to the new primary at once after a failover. The docs use 1 to keep most replicas reachable during the resync. | A higher number finishes sooner but makes more replicas unreachable at the same time. |
| Client discovery | Clients ask a Sentinel for the primary with SENTINEL get-master-addr-by-name, which returns the promoted replica's address during or after a failover. Sentinel listens on TCP port 26379. | Clients need a Sentinel-aware library. A plain client with a fixed address will not follow a failover. |
SDOWN is one Sentinel's view that an instance is down, and ODOWN is reached when at least the quorum of Sentinels agree. The docs add that Sentinel plus Redis does not guarantee acknowledged writes are retained.
The Sentinel docs describe a network partition in which an old primary keeps accepting writes from clients on its side. Those writes are lost when the partition heals and the old primary becomes a replica of the new one. min-replicas-to-write 1 with min-replicas-max-lag 10 makes the old primary stop accepting writes after about 10 seconds, which bounds the loss.
How does Redis Cluster handle failover and sharding?
Redis Cluster shards keys across 16384 hash slots on at least three primaries and fails over each shard itself, with no Sentinel and no proxy. A primary is replaced when a majority of primaries have seen it unreachable for cluster-node-timeout.
- Slots and nodes.
- 16384 slots, at least three primaries, and the cluster bus on the client port plus 10000 (scaling docs, checked 19 Nov 2026). The spec says it scales linearly to about 1000 nodes (cluster spec).
- Failure detection.
- A node flags another as possibly failing after it is unreachable for the node timeout. A primary is failed over once a majority of primaries report it. The default cluster-node-timeout in the source is 15000 ms; the tutorial's example uses 5000 (config.c, checked 19 Nov 2026).
- Election.
- A replica requests votes and waits up to two times the node timeout, never less than 2 seconds. If it fails, a new attempt comes after four times the node timeout, never less than 4 seconds (cluster spec).
- Loss window.
- The docs say Redis Cluster does not guarantee strong consistency and can lose acknowledged writes, both because replication is asynchronous and in a partition: writes on the minority side during more than the node timeout may be lost.
- When it stops.
- If a primary and its only replica both fail, the cluster cannot continue. With cluster-require-full-coverage yes, the default, an uncovered slot stops writes everywhere. cluster-allow-reads-when-down defaults to no.
- Client and key rules.
- Clients must follow MOVED redirections. Multi-key commands, transactions and scripts need keys in one slot, which hash tags such as {user:1000} provide. Only database 0 exists and SELECT is not allowed.
Redis Sentinel vs Redis Cluster: which should you run?
Run Sentinel when one primary can hold the dataset and you want failover without sharding. Run cluster mode when the dataset or the write rate needs several primaries. A single primary with replicas and manual promotion is the minimum, and it is only suitable if a person is always there to promote.
| Setup | Survives | Write loss window | Client needs | When to use |
|---|---|---|---|---|
| Primary and replicas, no automation | Loss of a replica. A primary failure needs a person to promote. | Asynchronous: writes after the last replica acknowledgement. | A fixed address you repoint by hand. | Development, or a cache that can be refilled and a team that is watching. |
| Primary, replicas and three Sentinels | Loss of the primary or a replica, and loss of one Sentinel box. | Asynchronous, plus writes made in a partition. Bound with min-replicas-to-write and WAIT. | A Sentinel-aware client library that asks for the primary address. | One dataset that fits on one primary, with failover and read replicas. |
| Cluster mode, three or more primaries with replicas | Loss of a shard's primary while its replica lives. A shard with no replica left stops the cluster under full coverage. | Asynchronous, plus the minority side of a partition beyond the node timeout. | A cluster-aware client that follows MOVED, hash tags for multi-key work, database 0 only in Redis. | Datasets or write rates past one primary, and several shards to lose independently. |
| ElastiCache Multi-AZ, cluster mode disabled | Loss of the primary or an Availability Zone, if a replica is in another zone. | Asynchronous: the replica with the least lag is promoted, and AWS says a small amount of data might be lost. | The primary endpoint, whose DNS name AWS repoints. | One shard on AWS where a managed failover is enough. |
| ElastiCache cluster mode enabled | Loss of a shard's primary, with Multi-AZ on by default. | As above, per shard. | A cluster-aware client. | Sharding on AWS. |
| ElastiCache | All cache nodes failing, from a Multi-AZ transactional log. | AWS says synchronous writes give zero data loss on failover and asynchronous writes may lose up to 10 seconds. | Same as the shape it is added to. | AWS Valkey where the log's cost and latency are acceptable. |
Sources: the Redis Sentinel, scaling and replication docs, and the AWS Multi-AZ documentation for the ElastiCache rows, checked 19 Nov 2026.
Valkey. Valkey's replication, Sentinel and cluster behaviour descends from Redis 7.2.4, so the sections above apply to it. The differences are additions: dual-channel replication from Valkey 8.0 (off by default, set on both sides), numbered databases in cluster mode and atomic slot migration from 9.0, and in 9.2 optional replication throttling and forkless full sync (Valkey replication docs, 9.2.0 release notes, checked 19 Nov 2026). The Valkey Helm chart's Sentinel mode requires Valkey 9.0 or later (chart announcement). The full version history is in the Valkey guide.
How does AWS Redis high availability work on ElastiCache?
ElastiCache gets high availability from Multi-AZ with automatic failover: when the primary fails, AWS promotes the replica with the least replication lag and updates the primary endpoint's DNS name. Cluster mode enabled turns Multi-AZ on by default and makes automatic failover mandatory.
- Requirements.
- Multi-AZ needs at least one replica in a different Availability Zone from the primary, and works only on clusters with more than one node in each shard (AWS Multi-AZ docs, checked 19 Nov 2026).
- Speed.
- AWS says writes typically resume within seconds. Read endpoints for individual replicas must be changed by the application if it uses them, and the primary endpoint needs no change.
- Modes.
- With cluster mode disabled you can enable or disable automatic failover separately, and AWS recommends Multi-AZ with at least one replica.
- Loss.
- AWS states replication is asynchronous, so a small amount of data might be lost on failover, and that it promotes the replica with the least lag to minimise it.
- Gotchas in the AWS text.
- A customer-initiated reboot of a primary does not trigger failover, and a rebooted primary comes back empty, after which its replicas clear their copy. On ElastiCache for Redis OSS, Multi-AZ and AOF are mutually exclusive. After a promotion the other replicas resync and are briefly inaccessible.
- Availability figure.
- AWS's features page says ElastiCache offers up to 99.99 percent availability with a Multi-AZ or serverless configuration, and links its SLA for the terms (ElastiCache features, checked 19 Nov 2026).
AWS-managed failover is a good answer for a cache on AWS. What it does not do is let you choose the persistence mix, change the loss window with the settings above, or run anywhere else, which is where a designed cluster comes in. ElastiCache pricing and alternatives compares the two.
Where OSStend fits in a Redis or
Valkey high availability design
OSStend writes the failover design for a cluster, whether Sentinel or cluster mode, signs it off with you before building anything, and runs it 24/7. The design states how much write loss the workload can accept and which settings enforce it.
That means choosing Redis or Valkey, the topology, the replica placement across zones or sites, the persistence mix and the client behaviour the application needs. See managed Redis or Valkey for how it runs, and service levels for the tiers. Questions to put to any provider are in choosing managed Redis or Valkey, and a provider list with a stated method is in best managed Redis and Valkey.
Contact us if
- ✓A session store, queue or other data you cannot rebuild, where the loss window has to be designed.
- ✓Failover has to work across your own zones, a data center or both.
- ✓You want the same failover design for Redis or Valkey, chosen per cluster.
Not a fit if
- ✕A disposable cache on AWS where ElastiCache Multi-AZ meets the target.
- ✕You want to run Sentinel yourself and only need the documents above.
From our on-call engineers: the failover checks in our runbook
These come from the Redis, Valkey and AWS documentation read on 19 Nov 2026 and are the failover checklist we write a Redis or Valkey runbook from. They are documentation, not a record of failovers we have handled, and we quote no customer figure.
- ✓Three Sentinels on three separate machines, with SENTINEL CKQUORUM wired into monitoring so a lost majority is a page.
- ✓min-replicas-to-write and min-replicas-max-lag set on purpose, with the loss window they leave written next to them.
- ✓Persistence on in the primary and in the replicas, or automatic restarts disabled, so an empty restart cannot wipe replicas.
- ✓In cluster mode, cluster-node-timeout, cluster-require-full-coverage and the replica count per shard written down, with what a lost shard does to the rest.
- ✓Clients tested against a real failover: a Sentinel-aware or cluster-aware library, with timeouts and retries that cope with MOVED and with a few seconds of refused writes.
- ✓On ElastiCache, a TestFailover run in a rehearsal, noting that AWS limits it to 15 shards in a rolling 24 hours.
Questions about Redis high availability
These are the questions teams ask when they choose a failover design for Redis or Valkey.
What is the difference between Redis Sentinel and Redis Cluster?
Sentinel gives failover for one dataset held on one primary, using separate Sentinel processes and a Sentinel-aware client. Cluster mode shards the keyspace across several primaries in 16384 hash slots and fails over each shard itself. Sentinel does not split the dataset, and cluster mode limits multi-key commands to one slot.
How many Sentinel instances do I need?
At least three, on three separate machines, as the Sentinel documentation puts it. The quorum detects the failure, but a failover also needs a majority of all Sentinel processes to elect a leader.
Can Redis lose data during a failover?
Yes. Replication is asynchronous, so the promoted replica may lack writes the old primary acknowledged. WAIT and min-replicas-to-write narrow the window, and the Redis docs say neither closes it.
What is the default cluster-node-timeout?
The source for both Redis and Valkey sets it to 15000 milliseconds, and the cluster tutorial's example uses 5000 (Redis config.c, Valkey config.c, checked 19 Nov 2026). The value sets how long a primary is unreachable before it is failed over.
Does Redis Cluster support SELECT and multiple databases?
No. Redis Cluster supports only database 0 and does not allow SELECT. Valkey added numbered databases in cluster mode in version 9.0.
How does AWS handle Redis high availability on ElastiCache?
With Multi-AZ and automatic failover: AWS promotes the replica with the least replication lag and repoints the primary endpoint's DNS name, and writes typically resume within seconds. Replication is still asynchronous, so a small amount of data might be lost.
Does this apply to Valkey?
Yes. Valkey is a fork of Redis 7.2.4 and uses the same asynchronous replication, Sentinel and cluster design. Where Valkey differs, such as numbered databases in cluster mode, the sections above say so.
Redis is a trademark of Redis Ltd, and Valkey is a trademark of LF Projects, LLC. Amazon ElastiCache is a trademark of Amazon.com, Inc. or its affiliates. OSStend is not affiliated with or endorsed by Redis Ltd, the Valkey project or Amazon, and the names are used only to say which software the page describes and what we run.
Related pages
GuideValkey in production: guide for Redis users (2026)Valkey guide for Redis users: releases 8.0 to 9.2, cluster mode, the Kubernetes operator, valkey-bundle, clients and config differences. Read 19 Nov 2026.
- AlternativeElastiCache pricing and alternatives in 2027Amazon ElastiCache pricing is only part of the picture: admin commands are restricted and it runs on AWS only. See fully configurable Redis or Valkey.
- Redis or ValkeyManaged Redis or Valkey, your choice of engineManaged Redis or Valkey: you choose the engine, with persistence, eviction and configuration set for your workload, run 24/7 in your cloud or data center.
- Service levelsService levels: two tiers, a written SLAOSStend service levels: fully managed and co-managed tiers, what each one covers, who is on call and how incidents are handled, with a written SLA for each.
- GuideRedis as a service: what to check before you chooseRedis as a service checklist: engine and licence, persistence, eviction, reserved memory, blocked commands, TLS, failover and export, with documented checks.
- GuideBest managed Redis and Valkey services in 2026The best managed Redis and Valkey services in 2026 compared from each provider's own docs: ElastiCache, MemoryDB, Azure, Google, Redis Cloud, Upstash and more.
Talk to an engineer about Redis failover
45 minutes with an engineer: bring your topology, how much write loss the data can take and where the nodes sit, and the engineer sketches the failover design.
- ✓A design sketch for your workload, not a plan menu
- ✓A zero-downtime cutover path for what you run today
- ✓A price for that design, after the review





