Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 04 · From Scratch · Kafka · with code: Go · about 21 min to read

Play it as a journeyTutor comes with a plan

Kafka 04: Partitions

Partitions
Partitions · Open board

From Scratch: Kafka. Follows Kafka 03: Segments and the Offset Index, which made one log survive a crash and search fast, and hands off to Kafka 05: Consumer Groups.

Before you start. You need to know that Kafka keeps every message it’s given in one long, append-only file, a log, and that each message gets a number called an offset marking its place in that file, counting up from zero. The last lesson cut that file into numbered, throwaway-able chunks so it could survive a crash and be searched fast. This lesson is about the file itself running out of room to go any faster.

Lesson 27 of 117 in From Scratch

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • One machine, and everyone in one line
  • 2004: Google’s fix for a job too big for one machine
  • The toy’s fix: open more lines
  • The price: only your own line stays in order
  • How a line gets picked: turn the key into a number

Terms it explains: partition, leader, key, hash, partitioner, sticky, widen the key, custom partitioner, murmur2, serialized key bytes, `toPositive`, no key.

Related papers

Review From Scratch