credit goes: Mayank Ahuja [in/curiouslearner/]
'Apache Kafka Without ZooKeeper - Using KRaft' (Give it a read.)๐
๐๐จ๐ฆ๐ ๐๐๐๐ค๐ ๐ซ๐จ๐ฎ๐ง๐ -
โพ Apache Kafka is a distributed streaming platform designed for high-throughput, fault-tolerant data pipelines.
โพ It enables real-time data processing, event-driven architectures and reliable messaging.
โพ Kafka's architecture originally relied on ZooKeeper, an external coordination service.
๐ ๐๐ก๐๐ญ ๐ฐ๐๐ฌ ๐๐จ๐จ๐ค๐๐๐ฉ๐๐ซ'๐ฌ ๐ซ๐จ๐ฅ๐?
โพ Cluster Metadata Management โ
- Stored information about brokers, topics, partitions and their configurations.
- Maintained cluster membership and facilitated broker discovery.
โพ Controller Functionality โ
- Elected a leader broker (Controller) responsible for managing cluster operations (e.g., partition reassignment, leader election).
- Relied heavily on ZooKeeper for metadata updates and coordination.
๐ ๐๐๐ญ'๐ฌ ๐๐ฅ๐ฌ๐จ ๐ญ๐๐ฅ๐ค ๐๐๐จ๐ฎ๐ญ ๐ฌ๐จ๐ฆ๐ ๐๐ก๐๐ฅ๐ฅ๐๐ง๐ ๐๐ฌ.
โพ External Dependency
- Required separate deployment and management of ZooKeeper.
- Increased operational complexity and potential points of failure.
โพ Scalability Limitations
- ZooKeeper could become a bottleneck for large-scale clusters due to metadata management overhead.
โพ Operational Overhead
- Maintaining a ZooKeeper ensemble added administrative burdens.
๐๐จ ๐๐ข๐ง๐๐ฅ๐ฅ๐ฒ,
Apache Kafka Raft (KRaft), a consensus protocol introduced in KIP-500 to eliminate Kafka's reliance on ZooKeeper.
** KIP-500 => Kafka Improvement Proposal 500
๐ ๐๐จ๐ฐ ๐ข๐ญ ๐ฐ๐จ๐ซ๐ค๐ฌ? (Kafka with KRaft)
โพ With KRaft, Kafka now manages its own metadata through a 'metadata quorum' of brokers.
โพ These brokers utilize the Raft consensus protocol to ensure data consistency and availability, removing the need for ZooKeeper.
โพ Cluster metadata is stored in a dedicated, internal Kafka topic called '__cluster_metadata'.
โพ This topic is replicated across the metadata quorum, ensuring that metadata changes are durable and available even if some brokers fail.
โพ The Kafka Controller, responsible for various cluster management tasks like partition reassignment and leader election, is elected as a leader among the metadata quorum brokers.
โพ Only the leader Controller can modify the metadata. This ensures that metadata changes are serialized and prevents conflicts.
โพ Whenever metadata changes, the leader Controller appends the changes to the internal '__cluster_metadata' topic.
โพ Other brokers in the quorum follow the leader's decisions and replicate metadata changes.
โพ If the current leader fails, a new leader is elected automatically.
๐๐ก๐ข๐๐ก ๐ฆ๐๐๐ง๐ฌ,
โ Simplified architecture.
โ Improved scalability.
โ Reduced operational overhead.
โ Enhanced stability and performance.
๐ Support for ZooKeeper was deprecated in Kafka 3.4, encouraging users to migrate to KRaft.
๐ ZooKeeper support is expected to be removed entirely in a future Kafka release.
โญ Follow https://www.linkedin.com/in/curiouslearner/
Top comments (0)