Command Palette

Search for a command to run...

Hectal
Phase 0Beginner1 of 18 in Apache Kafka

Kafka Foundations

What Kafka really is (a distributed, replicated commit log), why teams adopt it over direct REST calls, its core architecture, a local KRaft lab, and how to think about events.

Kafka is often introduced as "a message queue". That undersells it and leads to wrong designs. Kafka is a durable, partitioned, replicated log: producers append records, and any number of independent consumers read them at their own pace, as many times as they like.

This phase builds that mental model, sets up the lab you'll use for the rest of the course (Kafka 4.x runs without ZooKeeper), and teaches the vocabulary of events, commands and messages that every later design decision depends on.

0/5 · 0%
5 topics ~41 min 9 code blocks & diagrams
Start with the first topic
1
0.1

What Kafka Is: A Distributed Commit Log

Kafka stores streams of records in topics, split into partitions, each an append-only, ordered, replicated log on disk. Producers append; consumers read by offset and track their own position. Because records aren't deleted on read, many consumers can process the same data independently and replay history.

9 min 1 diagram 1 code practice

2
0.2

Why Kafka: From a REST Call Chain to Events

Synchronous REST chains couple services in time: one slow or failing service breaks the whole request. Publishing events to Kafka decouples producers from consumers, isolates failures, absorbs load spikes and allows replay, at the cost of eventual consistency and more moving parts.

8 min 1 diagram practice

3
0.3

Core Architecture: Brokers, Topics, Partitions, Replicas, Controllers

A Kafka cluster is a set of brokers that store partitions; each partition has one leader replica serving reads and writes and follower replicas copying it. A KRaft controller quorum manages metadata (which broker leads which partition). Producers write to leaders; consumers in groups divide partitions among themselves.

8 min 1 diagram 1 code practice

4
0.4

Your Kafka Lab: KRaft in Docker, CLI Tools, and kcat

Run Kafka 4.x in KRaft mode with Docker (single node, then a 3-broker cluster), and learn the tools you'll use all course: kafka-topics, the console producer and consumer, kafka-consumer-groups, kafka-configs and kcat.

8 min 2 code practice

5
0.5

Events, Commands, and Record Anatomy

A Kafka record has a key, a value, a timestamp, headers, and (once written) a topic, partition and offset. Designing good records starts with the difference between events ("something happened"), commands ("please do this") and generic messages, which shapes naming, ownership, retries and schema evolution.

8 min 1 diagram 1 code practice