liveBook · Manning

Distributed commit log

As explained in Apache Kafka in Action

A persistent distributed log is an append-oriented record of ordered events replicated across multiple machines and retained for later reading.

An online store needs order and inventory events to reach several systems without a tangle of point-to-point integrations. A persistent distributed log provides a shared place for those events: producers write them, and consumers read them when ready. If a consumer fails, it can resume; a new service can also read earlier events. section 1.1

Start with a log: a sequential list that accepts new entries at the end and can be read from a chosen position. In Kafka, a topic’s data is spread across partitions on multiple brokers. An offset identifies a message’s position within its partition—not a position across the whole topic. section 4.5

Following an order event

A producer sends an order event to a topic. Its partitioner selects a partition; messages with the same key go to the same partition. A consumer group divides partitions among its consumers, with each partition assigned to one consumer in that group. Another system can later read retained events for its own work. section 4.5 section 1.1

Distribution addresses two limits of a single log. Partitions let brokers share storage and consumers process in parallel; replicated partitions improve reliability when machines fail. Each partition has a leader replica that coordinates it. This adds operational structure, but it does not turn Kafka into a replacement for a database, key-value store, or search engine. section 4.2 section 4.5

Figure 4.3 Scaling vertically means adding more resources to a single instance. Scaling horizontally means adding more instances to a system.
A group of square windows

AI-generated content may be incorrect.

The scaling diagram contrasts a bigger single machine with adding machines—the reason a high-volume log is distributed rather than merely given a larger server. section 4.2

How Apache Kafka in Action covers it

How deep it goes
Defines the sequential log and explains topic partitioning, offsets, consumer groups, and replica leadership without detailing their implementations.
Examples
Illustrates its use with retail order and inventory processing, consumer recovery, and a vertical-versus-horizontal scaling diagram.
What it assumes
Starts with the sequential-list definition of a log and introduces producer-consumer roles before the distributed components.
What you can do after
Evaluate/understand how Kafka partitions an event log for parallel consumption and replicates partitions for reliability.
How it connects
Connects the log to publish-subscribe messaging, horizontal scaling, parallel processing, replication, and fault tolerance.

Also explained in

Compare how 2 books explain distributed commit log →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Apache Kafka in Action. The section links point to the parts of the book it draws on.