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





