---
title: "Challenge #5b: Multi-Node Kafka-Style Log"
---

# Challenge #5b: Multi-Node Kafka-Style Log

In this challenge, you’ll need to take your [Single-Node Kafka system](https://fly.io/dist-sys/5a) and distribute it out to multiple nodes.

Your nodes can use the linearizable key/value store provided by Maelstrom to implement your distributed, replicated log. This challenge is about correctness and not efficiency. You only need to keep up with a reasonable request rate. It’s important to consider which components require [linearizability](https://jepsen.io/consistency/models/linearizable) versus [sequential consistency](https://jepsen.io/consistency/models/sequential).

## Specification

This challenge works the same as the single-node except that it’s now running with two nodes. All correctness checks in Maelstrom should pass.

### Service: lin-kv

You’ve used the `seq-kv` service in the [Grow-only Counter challenge](https://fly.io/dist-sys/4), however, in this challenge you can use the linearizable version called [`lin-kv`](https://github.com/jepsen-io/maelstrom/blob/main/doc/services.md#lin-kv). The API is the same but they have different consistency guarantees.

You can instantiate the Go client in the library by using the [`NewLinKV()`](https://pkg.go.dev/github.com/jepsen-io/maelstrom/demo/go#NewLinKV) function:

```
node := maelstrom.NewNode()
kv := maelstrom.NewLinKV(node)
```

## Evaluation

Build your Go binary as `maelstrom-kafka` and run it against Maelstrom with the following command:

```
./maelstrom test -w kafka --bin ~/go/bin/maelstrom-kafka --node-count 2 --concurrency 2n --time-limit 20 --rate 1000
```

This will run a two-node system for 20 seconds with 4 clients (`2n`). It will validate the system for correctness.

If you’re successful, that’s great! Continue on to the [Efficient Kafka challenge](https://fly.io/dist-sys/5c). If you’re having trouble, jump over to the [Fly.io Community forum](https://community.fly.io/) for help.

1. **Echo**
   Get the hang of working with Maelstrom in Go by creating a node which is a binary that receives JSON messages
   
   [Read More About Echo](https://fly.io/dist-sys/1)
2. **Unique ID Generation**
   Implement a globally-unique ID generation system that runs against Maelstrom's unique-ids workload
   
   [Read More About Unique ID Generation](https://fly.io/dist-sys/2)
3. **Broadcast**
   Implement a broadcast system that gossips messages between all nodes in the cluster. Gossiping is a common way
   
   [Read More About Broadcast](https://fly.io/dist-sys/3a)
4. **Grow-Only Counter**
   Implement a stateless, grow-only counter which will run against Maelstrom's g-counter workload. This
   
   [Read More About Grow-Only Counter](https://fly.io/dist-sys/4)
5. **Kafka-Style Log**
   Implement a replicated log service similar to Kafka. Replicated logs are often used as a message bus or
   
   [Read More About Kafka-Style Log](https://fly.io/dist-sys/5a)
6. **Totally-Available Transactions**
   Implement a key/value store which implements transactions. These transactions contain micro-operations
   
   [Read More About Totally-Available Transactions](https://fly.io/dist-sys/6a)
