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:
- Consensus — how distributed nodes agree on a leader when any node can fail at any time
- Partitioning — how data is mapped to shards deterministically and fairly across a consumer group
- 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
| Lab | Topic | Artifact | Command |
|---|---|---|---|
| Lab 01 — Raft Leader Election | Raft consensus, terms, votes, heartbeats | RaftCluster.java simulation | mvn test |
| Lab 02 — Kafka Partitioning | murmur2 hash, round-robin, range assignment | MurmurPartitioner.java, RangeAssignor.java | mvn test |
| Lab 03 — Multi-module Maven | Parent POM, BOM, module dependency graph | queue-api / queue-core / queue-app | mvn verify (from parent) |
Core Concepts
| Concept | One-line definition |
|---|---|
| Raft term | Logical clock that increments on each election attempt |
| Majority quorum | floor(N/2) + 1 nodes must agree for any decision to commit |
| Election timeout | Random delay before a follower promotes itself to candidate |
| murmur2 | Non-cryptographic hash used by Kafka to assign keys to partitions |
| Range assignment | Kafka's default consumer group partitioning: first N consumers get an extra partition if not evenly divisible |
| Reactor build | Maven builds all modules in dependency order in a single mvn invocation |
dependencyManagement | Parent POM section that pins versions; child modules inherit them without specifying version |
| BOM | Bill of Materials — a pom with only dependencyManagement, imported by other projects |
Deliverables
-
Raft election simulation:
mvn testpasses all 5 tests inRaftElectionTest -
Kafka partitioning:
mvn testpasses all 8 tests inPartitionerTest -
Multi-module build:
mvn verifyfrom 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 type | What 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()?" |