Skip to content

A Go implementation of the broadcast challenge for the Fly.io Gossip Gloomers series of distributed systems challenges

License

Notifications You must be signed in to change notification settings

thtg88/maelstrom-broadcast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fly.io Gossip Gloomers Distributed Systems Challenges - Broadcast Challenge

This repo contains a Go implementation of the broadcast challenge for the Fly.io Gossip Glomers series of distributed systems challenges.

Requirements

Go 1.20

You can install Go 1.20 using gvm with:

gvm install go1.20
gvm use go1.20

Maelstrom

Maelstrom is built in Clojure so you'll need to install OpenJDK.

It also provides some plotting and graphing utilities which rely on Graphviz & gnuplot.

If you're using Homebrew, you can install these with this command:

brew install openjdk graphviz gnuplot

You can find more details on the Prerequisites section on the Maelstrom docs. Next, you'll need to download Maelstrom itself. These challenges have been tested against Maelstrom 0.2.3. Download the tarball & unpack it. You can run the maelstrom binary from inside this directory.

Build

From the project's root directory:

go build .

Test

To use the different Maelstrom test commands, please refer to the Fly.io instructions, starting with the Single-Node Broadcast.

Challenge #3a: Single-Node Broadcast

https://fly.io/dist-sys/3a/

# Make sure to replace `~/go/bin/maelstrom-executable`
# with the full path of the executable you built above
./maelstrom test -w broadcast --bin ~/go/bin/maelstrom-broadcast \
  --node-count 1 --time-limit 20 --rate 10

Challenge #3b: Multi-Node Broadcast

https://fly.io/dist-sys/3b/

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.

# Make sure to replace `~/go/bin/maelstrom-executable`
# with the full path of the executable you built above
./maelstrom test -w broadcast --bin ~/go/bin/maelstrom-broadcast \
  --node-count 5 --time-limit 20 --rate 10

Challenge #3c: Fault Tolerant Broadcast

https://fly.io/dist-sys/3c/

Your node should propagate values it sees from broadcast messages to the other nodes in the cluster—even in the face of network partitions! Values should propagate to all other nodes by the end of the test. Nodes should only return copies of their own local values.

# Make sure to replace `~/go/bin/maelstrom-executable`
# with the full path of the executable you built above
./maelstrom test -w broadcast --bin ~/go/bin/maelstrom-broadcast \
  --node-count 5 --time-limit 20 --rate 10 --nemesis partition

Challenge #3d: Efficient Broadcast, Part I

https://fly.io/dist-sys/3d/

# Make sure to replace `~/go/bin/maelstrom-executable`
# with the full path of the executable you built above
./maelstrom test -w broadcast --bin ~/go/bin/maelstrom-broadcast --node-count 25 --time-limit 20 --rate 100 --latency 100

Challenge #3e: Efficient Broadcast, Part II

https://fly.io/dist-sys/3e/

With the same node count of 25 and a message delay of 100ms, your challenge is to achieve the following performance metrics:

  • Messages-per-operation is below 20
  • Median latency is below 1 second
  • Maximum latency is below 2 seconds
# Make sure to replace `~/go/bin/maelstrom-executable`
# with the full path of the executable you built above
./maelstrom test -w broadcast --bin ~/go/bin/maelstrom-broadcast \
  --node-count 25 --time-limit 20 --rate 100 --latency 100

About

A Go implementation of the broadcast challenge for the Fly.io Gossip Gloomers series of distributed systems challenges

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages