It’s the difference between a lightning-fast cache… and a single point of failure.
Most teams get one thing wrong: they treat Redis like a static config file, not a distributed system component.
But availability in Redis isn’t just a checkbox feature; it’s an architectural decision. And like any architectural choice, it comes with trade-offs you can’t ignore.
You Should Know:
1. Single Redis Instance
✅ Pros:
- Easy to deploy (
redis-server --port 6379
) - Low latency (
redis-cli ping
) - Ideal for dev environments (
docker run -d --name redis-dev redis
)
❌ Cons:
- No failover (
systemctl status redis
→ If down, manual restart required) - No read scaling (
INFO replication
shows no replicas) - Total outage risk (
kill -9 $(pgrep redis-server)
→ Simulate crash)
Command to Check Status:
redis-cli INFO server
2. Redis HA (Primary + Replicas)
✅ Pros:
- Read scaling (
redis-cli --replicaof <PRIMARY_IP> 6379
) - Redundancy (
redis-cli INFO replication
) - Manual failover (
redis-cli REPLICAOF no one
→ Promote replica)
❌ Cons:
- Async replication (
WAIT 1 1000
→ Force sync) - Split-brain risk (
CONFIG SET min-replicas-to-write 1
)
Setup Replica:
redis-server --port 6380 --replicaof 127.0.0.1 6379
3. Redis Sentinel
✅ Pros:
- Automatic failover (
sentinel monitor mymaster 127.0.0.1 6379 2
) - Client auto-discovery (
SENTINEL get-master-addr-by-name mymaster
)
❌ Cons:
- Quorum required (
sentinel down-after-milliseconds mymaster 5000
) - Complex setup (
sentinel.conf
needs 3+ nodes)
Start Sentinel:
redis-sentinel /etc/redis/sentinel.conf
4. Redis Cluster
✅ Pros:
- Sharding (
redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001
) - Automatic resharding (
redis-cli --cluster reshard 127.0.0.1:7000
)
❌ Cons:
- Limited command support (
CLUSTER NODES
→ Check slots) - Client must be cluster-aware (
-c
flag inredis-cli
)
Create Cluster:
redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 \ 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 \ --cluster-replicas 1
What Undercode Say
- Single Node: Only for dev (
DEBUG SEGFAULT
→ Crash test). - HA: Use `MIN_REPLICAS` to avoid data loss.
- Sentinel: Always odd-numbered nodes (
3,5,7
). - Cluster: Prefer `redis-cli –cluster fix` for recovery.
Critical Commands:
Check cluster health redis-cli --cluster check 127.0.0.1:7000 Force failover redis-cli -p 26379 SENTINEL failover mymaster Backup RDB SAVE Blocks, use BGSAVE for background
Prediction
- 2025: Redis will integrate Raft consensus, reducing Sentinel dependency.
- 2026: Serverless Redis (auto-scaling) will dominate cloud deployments.
Expected Output:
1. Single Redis Instance → Dev only 2. Redis HA → Basic redundancy 3. Redis Sentinel → Automated control plane 4. Redis Cluster → Enterprise-scale resilience
Further Reading:
References:
Reported By: Raul Junco – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅