Here’s your text cleaned up for consistent formatting and readability, while keeping all original content:

Zookeeper & Kafka

  • Zookeeper manages brokers (keeps a list of them)
  • Zookeeper helps perform leader election for partitions
  • Zookeeper sends notifications to Kafka in case of changes
    • e.g., new topic, broker dies, broker comes up, delete topics, etc.
  • Kafka 2.x cannot work without Zookeeper
  • Kafka 3.x can work without Zookeeper (KIP-500) — using Kafka Raft (KRaft) instead
  • Kafka 4.x will not have Zookeeper
  • Zookeeper operates with an odd number of servers (1, 3, 5, 7)
  • Zookeeper has a leader (handles writes); the rest are followers (handle reads)
  • With Kafka > v0.10, Zookeeper does not store consumer offsets

Zookeeper with Kafka Brokers

  • Yes, Zookeeper is still used until Kafka 4.0 is released and Kafka without Zookeeper is fully production-ready

Zookeeper with Kafka Clients

  • Over time, Kafka clients and CLI have been migrated to leverage brokers as the connection endpoint instead of Zookeeper
  • Since Kafka 0.10, consumers store offsets in Kafka (not Zookeeper) and must not connect to Zookeeper, as it is deprecated
  • Since Kafka 2.2, kafka-topics.sh references Kafka brokers instead of Zookeeper for topic management (creation, deletion, etc.), and the Zookeeper CLI argument is deprecated
  • All APIs and commands that previously used Zookeeper now use Kafka instead — making migration to Kafka without Zookeeper invisible to clients
  • Zookeeper is less secure than Kafka; Zookeeper ports should only allow traffic from Kafka brokers, not from Kafka clients
  • As a modern-day Kafka developer:

    Never use Zookeeper as a configuration in your Kafka clients or any programs connecting to Kafka