สถาปัตยกรรมของ Kafka ประกอบด้วย cluster ของ broker (เซิร์ฟเวอร์) ที่จัดเก็บ topic แบบ partition และ replicate โดยมี producer เขียนและ consumer อ่าน ประสานงานด้วยการจัดการ metadata (ในอดีตคือ ZooKeeper ปัจจุบันคือ KRaft) การเข้าใจสถาปัตยกรรมช่วยให้เห็นว่า Kafka ทำงานเป็นระบบกระจายอย่างไร
องค์ประกอบ
BROKERS → Kafka SERVERS forming a CLUSTER:
→ store topic partitions (the data); serve producers and consumers
→ a cluster of multiple brokers → distributes data and load; scales horizontally
TOPICS / PARTITIONS → topics split into partitions, distributed across brokers
PRODUCERS → write events to topics (to partition leaders)
CONSUMERS (in groups) → read events from partitions
COORDINATION → metadata, cluster state, leader election:
→ historically ZOOKEEPER; now KRAFT (Kafka's own built-in consensus, removing ZooKeeper)
