---
title: "Kafka write path: one record from producer to consumer"
description: "Follow one record through Apache Kafka on a 3-broker cluster: producer batch, leader append, follower replication, high watermark commit and consumer read."
url: https://monedula.dev/kafka-simulator/scenarios/write-path/
---

# Kafka write path: one record from producer to consumer

Scenario 00.1.2 · One record, end to end. Anatomy · Beginner · about 1 min · Apache Kafka 4.3.

Follow a single record producer → leader log → replicated & committed → consumer.

Run it: https://monedula.dev/kafka-simulator/playground/?scenario=00.1.2

## What you start with

This traces one record through Kafka's full write path: a producer sends it, the partition leader appends it to its log, followers replicate it, the high watermark advances to mark it committed, and a consumer finally reads it.

## Step by step

1. **Cluster ready · idle** (t+0.000s): Three brokers, three racks, RF=3, min.ISR=2. Press ▶ to advance. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=00.1.2&t=0)
2. **Producer batches** (t+0.900s) [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=00.1.2&t=1)
3. **Leader append · uncommitted** (t+1.400s): Leader appended at offset 0. Followers haven't fetched yet, so HW stays at 0. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=00.1.2&t=2)
4. **Replicated · HW advances · ack** (t+2.000s) [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=00.1.2&t=3)
5. **Consumer reads the record** (t+2.800s): Consumer polls and reads offset 0 - its read position advances to 1. Auto-commit runs inside a later poll (real Kafka waits for auto.commit.interval.ms, 5 s by default), so the committed offset still trails by one (lag 1). [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=00.1.2&t=4)
6. **Consumer commits · caught up · lag 0** (t+3.200s): A later poll auto-commits offset 1 (the simulator commits on the very next poll), so committed now equals the read position. The record is fully end to end and the consumer sits at lag 0. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=00.1.2&t=5)

## The takeaway

Every write follows the same lifecycle - produce → leader append → replicate → commit → consume - and that backbone underlies every later scenario.

## Configs in this scenario

- [`min.insync.replicas`](https://kafka.apache.org/43/configuration/topic-configs/#topicconfigs_min.insync.replicas): The fewest in-sync replicas, leader included, that must have a write for an acks=all produce to succeed (default 1); with fewer in the ISR the leader rejects the write with NOT_ENOUGH_REPLICAS. [How min.insync.replicas works](https://monedula.dev/kafka-simulator/configs/min-insync-replicas/)
- [`auto.commit.interval.ms`](https://kafka.apache.org/43/configuration/consumer-configs/#consumerconfigs_auto.commit.interval.ms): How often a consumer with enable.auto.commit=true commits its offsets (default 5000, 5 seconds); records processed after the last commit are read again after a crash.

## Further reading

- [Apache Kafka documentation](https://kafka.apache.org/43/design/design/)
