Phase 07 — Production Systems: Consensus, Partitioning, and Build Modularity

Track: PMC Apache Committer Engineer
Phase: 07 of 12
Prerequisites: Phases 01–06 (code quality, review culture, patch workflow)


Why This Phase

A senior Apache committer is expected to reason about three categories of production system problems:

  1. Consensus — how distributed nodes agree on a leader when any node can fail at any time
  2. Partitioning — how data is mapped to shards deterministically and fairly across a consumer group
  3. Build modularity — how large codebases are split into independently-testable, deployable modules

Each lab in this phase gives you a working Java implementation of the core algorithm, not just a description of it.


Labs

LabTopicArtifactCommand
Lab 01 — Raft Leader ElectionRaft consensus, terms, votes, heartbeatsRaftCluster.java simulationmvn test
Lab 02 — Kafka Partitioningmurmur2 hash, round-robin, range assignmentMurmurPartitioner.java, RangeAssignor.javamvn test
Lab 03 — Multi-module MavenParent POM, BOM, module dependency graphqueue-api / queue-core / queue-appmvn verify (from parent)

Core Concepts

ConceptOne-line definition
Raft termLogical clock that increments on each election attempt
Majority quorumfloor(N/2) + 1 nodes must agree for any decision to commit
Election timeoutRandom delay before a follower promotes itself to candidate
murmur2Non-cryptographic hash used by Kafka to assign keys to partitions
Range assignmentKafka's default consumer group partitioning: first N consumers get an extra partition if not evenly divisible
Reactor buildMaven builds all modules in dependency order in a single mvn invocation
dependencyManagementParent POM section that pins versions; child modules inherit them without specifying version
BOMBill of Materials — a pom with only dependencyManagement, imported by other projects

Deliverables

  • Raft election simulation: mvn test passes all 5 tests in RaftElectionTest
  • Kafka partitioning: mvn test passes all 8 tests in PartitionerTest
  • Multi-module build: mvn verify from the parent dir builds and tests all 3 modules
  • Written answers to at least 3 interview questions from the Hitchhiker's Guide

Interview Relevance

Company typeWhat they ask
Apache project PMC"Walk me through what happens when a Kafka broker fails"
Distributed systems team"How does Raft prevent two leaders in the same term?"
Platform/infra team"How do you share a dependency version across 20 Maven modules without copy-paste?"
Data engineering"Why does Kafka use murmur2 instead of Java's hashCode()?"