liveBook · Manning

Transaction log

As explained in Kafka Streams in Action, Second Edition

A transaction log is an append-only sequence of events or records maintained in occurrence order.

A transaction log is an append-only sequence of events stored in occurrence order. In Kafka, each topic partition has its own transaction log, so records are appended rather than written as application status messages. section 2.4

Kafka’s partitioning model determines how records enter these logs:

  • Records with identical keys always land on the same partition. section 2.4
  • An application can explicitly choose a record’s partition. section 2.4
  • Records without keys or specified partitions are alternated per batch. section 2.4
Listing 2.1 Topic directory structure example
root@broker:/#  tree /var/kafka/topic-data/purchases*

/var/kafka/topic-data/purchases-0
├── 00000000000000000000.index
├── 00000000000000000000.log
├── 00000000000000000000.timeindex
└── leader-epoch-checkpoint
/var/kafka/topic-data/purchases-1
├── 00000000000000000000.index
├── 00000000000000000000.log
├── 00000000000000000000.timeindex
└── leader-epoch-checkpoint
/var/kafka/topic-data/purchases-2
├── 00000000000000000000.index
├── 00000000000000000000.log
├── 00000000000000000000.timeindex
└── leader-epoch-checkpoint

Inspect a topic directory to see one log file and its related indexes for each partition. section 2.4

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Defines the log’s role and partition placement, but defers file growth and management to log segments.
Examples
Shows partition directories containing numbered .log files alongside index, time-index, and leader-epoch files.
What you can do after
Evaluate Kafka .log files as event sequences rather than application status or execution logs.
How it connects
Connects transaction logs with Kafka topics, partitions, record keys, and producer partition assignment.

Also explained in

Compare how 6 books explain transaction log →

Related concepts

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