What's the Difference Between Redis Cluster and Sentinel? How to Choose?
Redis
High Availability
Cluster Solutions
Architecture Design
Core Differences Comparison
1. Architecture Design
Feature | Redis Cluster | Redis Sentinel |
---|---|---|
Data Distribution | Automatic Sharding (16384 slots) | Master-Slave Replication |
Node Roles | Peer Nodes (No Central Node) | Clear Master/Slave + Sentinels |
Client Support | Cluster Protocol Required | Compatible with All Clients |
Scaling Method | Horizontal Scaling (Add Shards) | Vertical Scaling |
2. Fault Tolerance
Failover Speed:
- Cluster: Sub-second automatic failover (via Gossip protocol)
- Sentinel: Multi-minute switchover (requires majority consensus)
Data Consistency:
- Cluster: Async replication (Possible minor data loss)
- Sentinel: Sync replication (With
WAIT
command)
Typical Failure Scenario:
- Master Node Failure
Cluster: Automatically elects new master with transparent client redirection
Sentinel: Requires manual verification after majority confirmation
3. Performance Comparison
Operation | Cluster Throughput | Sentinel Throughput |
---|---|---|
10-node Read Ops | 1.2M QPS | 800K QPS |
Cross-node Transactions | Not Supported | Supported |
Hotspot Data Access | Possible Skew | Even Distribution |
Key Selection Factors
1. Data Scale
- ≤100GB: Sentinel + Replication
- >100GB: Cluster Sharding
- >1TB: Cluster + Proxy Layering
2. Business Requirements
Ideal for Cluster:
- Horizontal scaling needed
- Read-intensive workloads (8:1 read/write ratio)
- Acceptable minor data loss (e.g., caching layers)
Ideal for Sentinel:
- Strong consistency requirements
- Frequent transaction operations
- Legacy client limitations
3. Operational Complexity
Cluster Challenges:
- Requires careful hash slot migration during scaling
- Cross-DC deployment needs custom tools
- Complex distributed monitoring requirements
Sentinel Advantages:
- Simple configuration changes
- Mature monitoring ecosystem
- Simplified troubleshooting process
4. Cost Comparison
Cost Type | Cluster | Sentinel |
---|---|---|
Hardware | +30% Nodes | Less Redundancy |
Human Resources | Dedicated DBA Needed | Regular O&M |
Migration | Data Redistribution | Simple Sync |
5. Ecosystem Compatibility
Common Issues:
- No cross-node transactions in Cluster
- Client upgrades required (e.g., Jedis 3.x+)
- Monitoring tool adaptation needed (e.g., Prometheus)
Redis Clustering Architecture Decision Flowchart
Production Configuration Examples
Redis Cluster Deployment
6-node Deployment (3 masters + 3 replicas):
DC1:
├─ MasterA (Slots 0-5460)
├─ ReplicaA1
DC2:
├─ MasterB (Slots 5461-10922)
├─ ReplicaB1
DC3:
├─ MasterC (Slots 10923-16383)
├─ ReplicaC1
Redis Sentinel HA Setup
5-node Deployment:
Master: redis-master
Replicas: redis-replica1, redis-replica2
Sentinels: sentinel1, sentinel2, sentinel3 (Dedicated servers)
Common Pitfalls
Case 1: Split Brain
Symptom: Cross-DC network failure causes data inconsistency
Solution:
Recommended configuration to prevent split-brain scenarios
cluster-node-timeout 15000
cluster-replica-validity-factor 10
cluster-require-full-coverage no
Case 2: Sentinel False Positive
Symptom: Network jitter triggers incorrect failover
Optimization:
Fine-tune failover sensitivity
sentinel down-after-milliseconds mymaster 5000
sentinel parallel-syncs mymaster 1
sentinel failover-timeout mymaster 180000
Final Recommendations
Redis Cluster is Best For:
- Data exceeds single-node memory capacity
- Linear read/write scaling needed
- Client adaptation is feasible
Redis Sentinel is Best For:
- Data <200GB
- Full Redis features required
- Existing infrastructure limitations
Hybrid Deployment Trend: Many enterprises combine both solutions - using Cluster for large-scale data handling and Sentinel for mission-critical services requiring high availability.
Related Resources: