Distributed Systems in Erlang
Distributed Systems in Erlang
These are a set of assignments that I have used in several courses in Distributed
Systems. They have been used to exemplify systems, algorithms, or aspects such as
performance and fault tolerance.
The students have had a week of half-time study to complete the assignments and write
a small report on their findings. After handing in the reports each assignment is discussed
during a seminar where one can also extend the system or do experiments using more
computers.
The assignments assume a basic understanding of Erlang, but I've deliberately used a
limited set of Erlang functionality. I have not used OTP since I think that this will hide
complexity or, for many of the smaller assignments, add too much code. Nor do I use
some libraries that handle group communication or global registry. The aim is often for
the students to develop these themselves and better understand the pros and cons of
different strategies.
All assignments work in progress and are likely to change in the future. All assignments
are licensed under Creative Commons Attribution.
An Erlang primer
This is not a crash course in Erlang since there are plenty of tutorials available on the
web. I will, however, describe the tools that you need so that you can get a programming
environment up and running. I will take for granted that you know some programming
languages, have heard of functional programming, and that recursion is not a mystery to
you.
• crash.pdf
• primy.pdf
• namy.pdf
• routy.pdf
Detector:
Failure detectors are the heart of distributed systems. This small tutorial will whow you
how the failure detectors work in Erlang and their linmitations.
• detector.pdf
Casty:
In this assignment you will build a streaming media network. We will play around with
shoutcast streams and build proxies, distributors and peer-to-peer clients. You will use
the Erlang bit-syntax to implement a communication protocol over HTTP. The parser will
be implemented using higher order functions to hide the socket interface. You will learn
how to decode a mp3 audio stream and make it available for connecting media players.
Sounds fun? - Let's go!
• casty.pdf
• goldy.pdf
Toty
The task is to implement a total order multicast service using a distributed algorithm. The
algorithm is the one used in the ISIS system and is based on requesting proposals from
all nodes in a group.
• toty.pdf
Muty
Your task is to implement a distributed mutual-exclusion lock. The lock will use a multicast
strategy and work in a asynchronous network where we do not have access to a
synchronized clock. You will do the implementation in three versions: the dead-lock
prone, the unfair and the Lamport clocked. Before you start you should have good
theoretical knowledge of the multicast algorithm and how Lamport clocks work.
• muty.pdf
• groupy.pdf
• snapy.pdf
• garby.pdf
• opty.pdf
• timey.pdf
• paxy.pdf
• chordy.pdf