Kafka replicate partition ข้าม broker หลายตัวเพื่อ ความคงทนและความพร้อมใช้งาน — แต่ละ partition มี leader และ follower replica หาก broker ล้มเหลว follower จะเข้ามาทำหน้าที่แทน การเข้าใจ replication เป็นกุญแจสำคัญต่อ fault tolerance ของ Kafka
replication ทำงานอย่างไร
Each PARTITION is replicated across multiple brokers (REPLICATION FACTOR copies, e.g. 3):
→ LEADER replica → handles all reads and writes for the partition
→ FOLLOWER replicas → copy (replicate) the leader's data, staying in sync
→ producers/consumers interact with the LEADER; followers are backups
→ if the leader's broker FAILS → a follower is promoted to leader (failover) → no data loss,
continued availability
