Kafka in production
Replication, min.insync.replicas and acks=all, choosing a partition count, compacted topics, and transactions with read_committed.
Step 4 · Structured Streaming · Gold · Kafka in production, lesson 1 of 2
On this page
Read first: Kafka producers: acks, retries and batching · Backpressure and rate limits (skip if you know them)
In plain words first
A bank does not keep your signed contract in one drawer. It keeps copies in three branches, and a new contract only counts as signed once at least two branches hold a copy. If one branch floods, the contract still exists. If two are closed, the bank stops signing new contracts until one reopens, rather than risk keeping only one copy.
KafkaKafka: A system that stores streams of events in topics, in order within each partition, so many readers can read them, and read them again, at their own pace. Learn more → does the same with three settings: how many copies of each partitionpartition: In Kafka, one ordered slice of a topic, read in order. In Spark, one chunk of a DataFrame's rows, processed as one task. Learn more → exist (replication factor), how many must have a write before it counts (min.insync.replicas), and whether the producerproducer: An application that writes events to a topic. Learn more → waits for that count (acksacks: The producer setting for which acknowledgement to wait for: none, the leader, or every in-sync replica (all, the default). Learn more →=all).
Unlock the full lesson
You have read the free part. The rest of this advanced lesson:
- The three settings that keep data safe
- Choosing the partition count
- Compacted topics
- Transactions and read_committed
- Common mistakes
- Key takeaways
- Interview prep with 3 follow-up questions
- Check yourself: 3 questions
Unlock it with the Complete pass (every advanced problem and lesson) or on its own.
Practise this
Interview problems on streaming, graded on hidden tests
Keep going
Up next · Kafka in production · lesson 2 of 2 · 6 min readKafka 4: KRaft, new rebalances and queues
ZooKeeper removed, the broker-driven consumer rebalance protocol, share groups, and what changed for Spark jobs.
Related lessons
Delivery guarantees end to endStructured Streaming · 7 min read
Restarts, query changes and reprocessing
Previous: Restarts, query changes and reprocessing
Primary sources: Kafka design: replication · Kafka design: log compaction · Kafka design: using transactions · Topic configs · Basic operations (adding partitions)