Erlang - Distributed Programming


Distributed Programs are those programs that are designed to run on networks of computers and that can coordinate their activities only by message passing.

There are a number of reasons why we might want to write distributed applications. Here are some of them.

  • Performance − We can make our programs go faster by arranging that different parts of the program are run parallel on different machines.

  • Reliability − We can make fault-tolerant systems by structuring the system to run on several machines. If one machine fails, we can continue on another machine.

  • Scalability − As we scale up an application, sooner or later we will exhaust the capabilities of even the most powerful machine. At this stage we have to add more machines to add capacity. Adding a new machine should be a simple operation that does not require large changes to the application architecture.

The central concept in distributed Erlang is the node. A node is a self-contained.

The Erlang system contains a complete virtual machine with its own address space and own set of processes.

Let’s look at the different methods which are used for Distributed Programming.

S.No Methods & Description
1 spawn

This is used to create a new process and initialize it.

2 node

This is used to determine the value of the node on which the process needs to run.

3 spawn on Node

This is used to create a new process on a node.

4 is_alive

This returns true if the local node is alive and can be part of a distributed system.

5 spawnlink

This is used to create a new process link on a node.