Kafka Flashcards
(35 cards)
How does a producer send a message in a log-based broker like Kafka?
It appends the message to the end of the log.
How does a Kafka consumer receive messages?
By reading the log sequentially from its current offset.
Can a Kafka log be partitioned across machines?
Yes; partitions are spread across brokers for scalability.
What is a topic in Kafka?
A named group of partitions that store messages of the same type.
What property does every message within a partition have?
A monotonically increasing offset.
Are messages within a partition totally ordered?
Yes; total order is guaranteed only inside a single partition.
Does reading a message delete it from the Kafka log?
No; reading is non-destructive.
When is Kafka a good fit?
When you need high throughput fast processing and per key ordering.
How do you keep related messages in order?
Route them to the same partition using a consistent partition key such as userId.
What does a consumer offset represent?
The position of the next message the consumer will read.
Why does the broker periodically store consumer offsets?
So consumers can resume after failures without rereading processed messages.
How does Kafka reclaim disk space on a log?
By splitting logs into segments and deleting or archiving old segments based on retention policy.
What happens if a consumer offset points to a deleted segment?
It permanently misses those messages.
How do you detect slow consumers?
Monitor consumer lag and alert when it grows large.
What tool captures database changes and publishes them to Kafka?
Debezium.
How does the Debezium PostgreSQL connector read changes?
It opens a logical replication slot and streams WAL insert update delete events into Kafka.
In Debezium what is the default topic strategy per table?
One topic per table.
What is a Kafka broker?
A server that stores partitions and serves read and write requests.
How is fault tolerance provided for partitions?
By replicating each partition across multiple brokers with one leader and followers.
What protocol has replaced ZooKeeper in modern Kafka?
KRaft the built in Raft metadata quorum.
What is a consumer group?
A set of consumers that share work each partition is consumed by at most one member of the group.
What happens when membership of a consumer group changes?
Kafka triggers a rebalance to redistribute partitions.
What delivery semantics can Kafka provide?
At least once at most once and exactly once.
How do idempotent producers help exactly once semantics?
They assign sequence numbers per partition so retries do not create duplicates.