Challenge 5b: Multi-Node Kafka-Style Log

desccode

Took our single-node Kafka and went distributed. Swapped in-memory maps for linearizable KV store and got a rock-solid multi-node log. Turns out atomic CAS + retry loops = distributed coordination gold.

How it Works

Distributed Coordination

Why This Works

  1. Linearizable Offset Allocation: CAS loop guarantees unique, monotonic offsets

  2. Optimistic Concurrency: No locks, just retry on conflict = max throughput

  3. Strong Consistency: Lin-KV gives us the guarantees we need where it matters

  4. Sparse Log Support: Inherent in our key design, gaps just work

metrics

Trade-offs

Pros:

Cons:

Could optimize with batch operations or client-side caching, but this clean approach crushes the spec. Lin-kv proving once again that the right primitive makes distributed systems borderline trivial.

Next try to improve performance.