Thinking in Erlang
One day Erlang training.
This training should get you started with Erlang and understand how to design a highly available distributed system. Because there is only one day, we focus on the essential concepts and skip over many details that would be covered in the normal three days course.
After learning the basics and doing a few exercises we will start writing a simple chat client and server and improve it as we learn new things.
You are encouraged to help the people around you once you figure things out for yourself.
At the end of this training you should be able to:
- Install Erlang
- Have basic knowledge of the Erlang language
- Understand concurrency and message passing
- Learn how to handle errors
- Understand how to build highly available systems
- Recognize Joe Armstrong, Robert Virding and Mike Williams
- Your own laptop
- Erlang R16B02:
- Wi-Fi connection for installing Erlang during the training
- Otherwise, read below if you wish to install Erlang beforehand
20 minutes, Wi-Fi required
If you can, please come with Erlang R16B02 already installed on your machine. Please use the ESL packages. Arch Linux users can use the pacman package directly.
If everyone comes with Erlang installed we can move through this part quicker.
- Install Erlang
- Watch Erlang the Movie while it downloads/installs
- Start and stop the shell (
Overview of an Erlang system
Get a first look at modules, applications, processes and supervision trees.
- Diagram summarizing a distributed Erlang system
Basic syntax and types
We will cover the following types which are necessary to follow the training, and skip the few types we won't need.
We will cover the following syntax.
- Function definition
- Function clauses
- Pattern matching in function clauses
- Local function calls
- Remote function calls
- Case .. of
- Pattern matching with
We will cover the following recursion concepts:
- Recursing through a list
- Program loop
Concurrency and message passing
What makes Erlang so special.
- Overview of processes
- Order of execution is undefined
- Processes are cheap
- Processes are isolated
- Message passing
- Receive .. after
- Selective receive
- Server processes
- Process registry
Remote error handling
First taste of high availability.
- Safe RPC
- What to do when processes crash?
- Supervision trees
Quick look at distribution
Connect nodes, make them speak together.
- Node names
- Connecting nodes
- Global process registry
Highly available systems
Everything you need to know before you can build a highly available system. These apply to any system, not just ones written in Erlang.
- Error detection
- Error identification
- Live upgrades
- Stable storage