Redis ให้ high availability ผ่าน replication (สำเนาข้อมูลแบบ replica), Redis Sentinel (การติดตามและ failover อัตโนมัติ) และ Redis Cluster (sharding + replication) การเข้าใจสิ่งเหล่านี้สำคัญต่อการรัน Redis ได้อย่างน่าเชื่อถือใน production
Replication — primary และ 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
