Architecture Tour
English · 中文版
MiniKafka keeps transport outside the semantic core. Most experiments call the Direct API, so the main path is visible without sockets:
Producer
-> keyed partition choice
-> record batch
-> leader PartitionLog
-> follower fetch / ISR
-> high watermark
-> Consumer or ConsumerGroup position
The storage layer owns append-only segments, sparse offset indexes, CRC
recovery, retention, and keyed compaction. BrokerCluster assembles topic
metadata, producer state, group coordination, replica sets, and transaction
visibility. JsonTcpServer is only a bounded newline-delimited JSON adapter
over the same operations.
Read the repository in this order:
log/for batches, segments, indexes, recovery, retention, and compaction.producer/for partitioning, batching, acknowledgement, and deduplication.consumer/for positions, group ownership, generations, and fencing.replication/for follower pulls, ISR, high watermark, epochs, and promotion.transaction/for markers, isolation, and atomic output-plus-offset commit.broker.py,cluster.py, andlifecycle.pyfor ownership and shutdown.adapters/last, because transport does not define the core semantics.
The next chapter gives the graded MiniKafka → Apache Kafka mapping. The behavior matrix connects observable claims to tests.