Gossip Glomers is a series of distributed systems challenges by Fly.io in collaboration with Kyle Kingsbury, author of Jepsen. It's a great way to learn distributed systems by writing your own.
The challenges are built on top of a platform called Maelstrom. Maelstrom simulates network traffic using stdin and stdout of node processes.
“
ZIO-Maelstrom is a high level Scala driver for Maelstrom which abstracts away the low level details of the platform and let's you focus on solving distributed systems challenges
Alternatives
Maelstrom has an official Go library called maelstrom-go
There is also a java open-source library called maelstrom-java
Since Maelstrom is Closure program, you will need JVM installed on your machine. This templates makes use of graalvm native image to create OS native executable files for improved node performance. I have used sdkman to install java.
scripts to compile solutions using graalvm native image
scripts to run solutions with expected workload
Create a new project using the template repository or clone the repository
Important
If you have not installed graalvm using sdkman, please update "nativeImageGraalHome" in build.sbt to point to your graalvm installation directory. You may have to install native-image component using gu install native-image command if it is not already installed
Echo challenge for example, has echo/src/main/scala/gossipGlomers/Main.scala as shown below
# This command will compile and create a fat jar and a runner scriptsbt"echo/bootstrap"# This command will run maelstraom with appropriate work load arguments./echo/target/testjar.sh
# This command will run a reduced workload to generate graalvm native reflection configurations# Those configurations will be stored in resources/META-INF/native-image dir of the projectsbt"echo/maelstromRunAgent"# This command will compile and create a native image and a runner script# It will use the reflection configurations generated in previous stepsbt"echo/nativePackage"# This command will run maelstraom with appropriate work load arguments./echo/target/test.sh