Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
Add notes: Kafka: The definitive guide
Browse files Browse the repository at this point in the history
- Chapter 6: Kafka Internals
  • Loading branch information
lealceldeiro committed Dec 21, 2023
1 parent 649b3e8 commit 855b99a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions KafkaTheDefinitiveGuide/Chapter6/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# CHAPTER 6: Kafka Internals

Kafka uses ZooKeeper’s ephemeral node feature to elect a controller and to notify the controller when nodes join and
leave the cluster. The controller is responsible for electing leaders among the partitions and replicas whenever it
notices nodes join and leave the cluster. The controller uses the epoch number to prevent a “split brain” scenario
where two nodes believe each is the current controller.

From the list of replicas for a partition displayed by the _kafka-topics.sh_ tool, the first replica in the list is
always the preferred leader.

This is true no matter who is the current leader and even if the replicas were reassigned to different brokers using
the replica reassignment tool.

When replicas are manually reassigned, the first replica specified will be the preferred one.

Common types of client requests:

- Produce requests: Sent by producers and contain messages the clients write to Kafka brokers
- Fetch requests: Sent by consumers and follower replicas when they read messages from Kafka brokers
- Admin requests: Sent by admin clients when performing metadata operations such as creating and deleting topics

New brokers know how to handle old requests, but old brokers don't know how to handle new requests. Now, in release
`0.10.0`, `ApiVersionRequest` was added, which allows clients to ask the broker which versions of each request are
supported and to use the correct version accordingly. Clients that use this new capability correctly will be able
to talk to older brokers by using a version of the protocol that is supported by the broker they are connecting to.
2 changes: 2 additions & 0 deletions KafkaTheDefinitiveGuide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Main notes taken from the book [Kafka: The Definitive Guide: Real-Time Data and
[CHAPTER 4: Kafka Consumers: Reading Data from Kafka](./Chapter4)

[CHAPTER 5: Managing Apache Kafka Programmatically](./Chapter5)

[CHAPTER 6: Kafka Internals](./Chapter6)

0 comments on commit 855b99a

Please sign in to comment.