English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Distributed Programming in Erlang

Distributed programs are those designed to run on computer networks and can only coordinate their activities through message passing.

There are many reasons why we may need to write distributed applications. Here are some of them.

  • Performance - By running different parts of the program in parallel on different machines, the program can run faster.

  • Reliability - We can create fault-tolerant systems by constructing the system to run on multiple machines. If one machine fails, we can continue on another.

  • Scalability - When expanding an application, it is inevitable that even the most powerful computer's capabilities will be exhausted. At this stage, we must add more computers to increase capacity. Adding new computers should be a simple operation and should not require major changes to the application architecture.

The central concept in distributed Erlang is the node. Nodes are independent.

The Erlang system includes a complete virtual machine that has its own address space and a set of processes.

Let's take a look at the different methods used in distributed programming

Serial NumberMethods and Descriptions
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 node

This is used to create a new process on the node

4

is_alive

Returns true if the local node is active and can be part of a distributed system

5

spawnlink

This is used to create new process links on the node