Adetayo Akinsanya unkletayo.dev
Engineering / Kafka from First Principles • Part 0 of 20 Published

Mastering Apache Kafka from First Principles: Series Introduction & Learning Roadmap

An introduction to distributed log storage, zero-copy kernel transfers, consumer rebalancing, KRaft consensus, and transactional event streams

Why You Need This in Real Life

The year is 2010. Deep inside LinkedIn’s Mountain View headquarters, an architecture crisis is unfolding. A sprawling web of 1,400 point-to-point microservice integrations is buckling under 50,000 requests per second. Every checkout requires notifying inventory, billing, fraud detection ML models, and push notification pipelines via synchronous REST calls. When a single downstream fraud service locked its database for three seconds, worker threads starved across the cluster, triggering cascading HTTP 504 gateway timeouts across the entire platform.

LinkedIn’s data infrastructure team faced a critical choice: continue managing a fragile N2N^2 mesh of point-to-point integration scripts, or build a fundamentally new distributed engine.

They built Apache Kafka—a distributed, ultra-high-throughput append-only commit log.

However, operating Kafka in production is notorious for subtle failure modes: consumer rebalance storms freezing processing groups for 45 seconds, partition offset data loss due to misconfigured acks=all, and disk I/O bottlenecks caused by unaligned partition counts.

This 19-part series breaks down Apache Kafka from first principles—explaining how its kernel storage engine, network protocols, consensus algorithms, and producer/consumer internals work under the hood.


What You Will Gain From This Series

By following this series step by step, you will master the underlying mechanics of distributed event streaming:

  1. Hardware & Disk Fundamentals: Why sequential disk I/O rivals RAM speed, how Linux OS Page Cache functions, and how sendfile() zero-copy bypasses user-space CPU memory copying.
  2. Low-Level Storage Engine: How append-only log segments, .index sparse memory maps, and log compaction cleaner threads maintain high throughput.
  3. Producer & Consumer Internals: How RecordAccumulator batches bytes, how MurmurHash2 guarantees partition ordering, and how Cooperative Sticky Assignors eliminate eager rebalance storms.
  4. Consensus & Reliability: How High Watermark (HW) and Log End Offset (LEO) guarantee replica durability, how KRaft replaces ZooKeeper via Raft metadata quorums, and how 2-Phase Commit transactions achieve Exactly-Once Semantics (EOS).

Who This Series Is For

This series is designed for software engineers, distributed systems developers, data platform engineers, and system architects.

  • Prerequisites: Basic understanding of client-server web architectures and command-line interfaces. No prior distributed messaging experience is required—we build concepts from zero.
  • Skill Level Target: Moves you from high-level Kafka CLI user to senior distributed systems engineer capable of designing high-throughput event platforms, tuning JVM/OS parameters, and troubleshooting production incidents.

What You Will Be Able to Achieve

After completing all 19 parts, you will be able to:

  • Architect resilient event-driven microservices capable of handling millions of events per second with sub-10ms latency.
  • Eliminate consumer group rebalance freezes, data loss incidents, and uncommitted offset loops.
  • Tune OS kernel, JVM, Hikari/Kafka network thread pools, and producer/consumer configurations for maximum throughput.
  • Complete the Capstone Project (Part 19): Building a real-time event-driven order processing engine with Kafka producers, consumer groups, dead-letter topics, and transactional state stores.

Roadmap Overview: The 7 Learning Modules

+-----------------------------------------------------------------------------+
|                          Kafka Learning Roadmap                             |
|                                                                             |
|  Module 1: The Distributed Data Crisis & Hardware Fundamentals (Parts 1–3)  |
|  Module 2: Core Abstractions & Low-Level Storage (Parts 4–6)                |
|  Module 3: Producer Architecture & Durability Mechanics (Parts 7–9)         |
|  Module 4: Consumer Groups & Rebalancing Mechanics (Parts 10–12)            |
|  Module 5: Replication, Consensus & Exactly-Once Semantics (Parts 13–15)    |
|  Module 6: Enterprise Ecosystem & Production Operations (Parts 16–18)       |
|  Module 7: Capstone Project: Real-Time Event-Driven Architecture (Part 19)  |
+-----------------------------------------------------------------------------+

Next Steps

Ready to explore distributed event streaming? Begin with Part 1, where we dissect the N2N^2 integration crisis and why synchronous REST coupling fails at scale.

References & Further Reading

  1. Kreps, J., Narkhede, N., & Rao, J. (2011). Kafka: a Distributed Messaging System for Log Processing. NetDB Workshop.
  2. Narkhede, N., Shapira, G., & Palino, T. (2021). Kafka: The Definitive Guide (2nd Edition). O’Reilly Media.
  3. Kleppmann, M. (2017). Designing Data-Intensive Applications. O’Reilly Media.

Up Next in Series →

Part 1: Why Apache Kafka Exists: Solving Microservice N² Integration Spaghetti

Continue to Part 1 →