---
title: "Kafka topics, partitions and offsets explained"
description: "A producer writes six keyed records to a 3-partition Kafka topic. Watch each record land in one partition and take the next offset of that partition."
url: https://monedula.dev/kafka-simulator/scenarios/topic-partition-offset/
---

# Kafka topics, partitions and offsets explained

Scenario 00.1.1 · Topic, partition, offset. Anatomy · Beginner · about 2 min · Apache Kafka 4.3.

A topic is split into partitions; each partition is an ordered log; an offset is a position within a partition.

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

## What you start with

A topic isn't a single queue - Kafka splits it into independent partitions, each an ordered, append-only log. Here a producer writes six keyed records to a 3-partition topic; watch each record land in one partition and take the next offset (its position within that log).

## Step by step

1. **Topic ready · 3 empty partitions** (t+0.000s): A topic is not one queue - 'orders' is split into 3 partitions. Each partition is an independent, append-only log. All three start empty at offset 0. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=00.1.1&t=0)
2. **First records land · one per partition** (t+1.050s): Three records (keys A, C, F) each landed in a different partition, every one at offset 0. Where a record lands is decided by its key (see 00.1.3). [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=00.1.1&t=1)
3. **Each partition is an ordered log · offsets count up** (t+1.700s): Six records total, two per partition. An offset is a record's position within its partition: each partition now holds offsets 0 and 1. Offsets are assigned per partition, always starting at 0. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=00.1.1&t=2)

## The takeaway

A record is addressed by topic + partition + offset: ordering is guaranteed within a partition, and an offset simply counts the appends to that one log.

## Further reading

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