Redis cung cấp high availability qua replication (các bản sao replica của dữ liệu), Redis Sentinel (giám sát failover tự động), và Redis Cluster (sharding + replication). Hiểu những điều này quan trọng để chạy Redis tin cậy ở production.
Replication — primary và replica
PRIMARY (master) → handles writes; asynchronously replicates data to replicas
REPLICAS (slaves) → copies of the primary's data; can serve READS (read scaling)
Write → Primary → async replication → Replicas (eventually consistent)
✓ Redundancy (replicas have copies) + read scaling (reads offloaded to replicas)
✗ Replication is ASYNC → a small lag; a failover could lose very recent writes
