Challenge #3b: Multi-Node Broadcast

In this challenge, we’ll build on our Single-Node Broadcast implementation and replicate our messages across a cluster that has no network partitions.

Specification

Your node should propagate values it sees from broadcast messages to the other nodes in the cluster. It can use the topology passed to your node in the topology message or you can build your own topology.

The simplest approach is to simply send a node’s entire data set on every message, however, this is not practical in a real-world system. Instead, try to send data more efficiently as if you were building a real broadcast system.

Values should propagate to all other nodes within a few seconds.

Evaluation

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

./maelstrom test -w broadcast --bin ~/go/bin/maelstrom-broadcast --node-count 5 --time-limit 20 --rate 10

This will run a 5-node cluster for 20 seconds and broadcast messages at the rate of 10 messages per second. It will validate that all values sent by broadcast messages are present on all nodes.

If you’re successful, continue on to the Fault Tolerant Broadcast challenge. If you’re having trouble, mosey on over to the Fly.io Community forum for tips.

  1. Read More About Echo
  2. Read More About Unique ID Generation
  3. Read More About Broadcast
  4. Read More About Grow-Only Counter
  5. Read More About Kafka-Style Log
  6. Read More About Totally-Available Transactions