Реклама партнера — Название партнёра
UNIT.City — місце, де люди працюють... КРАЩЕ! Обирай свій простір просто зараз 👉

A simple language for a complex world. How Erlang keeps your messengers from freezing

In the world of programming, few languages ​​can boast such stability and adaptability as Erlang. It arose from the need to solve complex telecommunications problems and today remains one of the key technologies for systems where reliability, parallelism of processes and scalability are valuable. dev.ua tells about the evolution of Erlang: from its inception to modern use in top IT companies.

Leave a comment
A simple language for a complex world. How Erlang keeps your messengers from freezing

In the world of programming, few languages ​​can boast such stability and adaptability as Erlang. It arose from the need to solve complex telecommunications problems and today remains one of the key technologies for systems where reliability, parallelism of processes and scalability are valuable. dev.ua tells about the evolution of Erlang: from its inception to modern use in top IT companies.

Origin

The history of Erlang began in the late 1980s in the research laboratory of the well-known telecommunications company Ericsson. The creators of the programming language, Robert Wirding, Joe Armstrong and Mike Williams, faced a serious problem: the existing programming languages ​​were unsuitable for developing reliable telecom systems. In those days, everything was so interconnected that even the slightest failure in one of the switches could cause the collapse of the entire network. The same applied to infrastructure upgrades - turning off one element led to the downtime of the entire system.

The team conducted a series of experiments and decided to create their own language that would allow for efficient and rapid software development, support multithreading, be resistant to software and hardware errors, and provide continuous system updates without stopping the system. By separating lightweight processes from each other, which are connected by asynchronous communication, the developers allowed Erlang to literally "break on the fly", so that failed processes could be easily closed and new ones started. Thus, when a failure occurred in telecommunications, it affected only a specific call between two subscribers and did not affect the system as a whole, which continued to work for most subscribers.

“The most important advantages of Erlang are reliability, scalability and efficient use of resources. We can process thousands of parallel tasks without a large load on the system. Erlang also allows hot restart of processes in case of failures, that is, it is possible to restart processes without stopping the entire system. This helps to quickly restore everything and reduce downtime, which is critically important for business,” Favbet Tech told about the advantages of Erlang

Despite the fact that support within Ericsson was not unanimous, Erlang proved its effectiveness in real projects and got a chance to live in the company. The years 1994–1996 were decisive for Erlang. When a large internal initiative to create a new system architecture failed, the company needed a reliable solution, and it was then that Erlang began to be actively used in all new projects of the Swedish technology giant. By 1996, Erlang had become an internal standard at Ericsson.

All Ericsson broadband solutions: ADSL, fiber, HFC, access to cable TV networks, GPRS, AXE 301 switch, are all built on Erlang.

Transition to an open source model

In 1998, Erlang became an open source programming language, the first open source project at Ericsson. The decision was initiated by a group of people who had been working on implementing Erlang within Ericsson. They convinced management that going open source would be a good idea for Ericsson, as it would allow more people to use Erlang, get more feedback, improve tools and applications, and collect feedback.

Since the release of Erlang open source, the programming language has spread far beyond telecommunications, establishing itself in other areas such as fintech, gaming, healthcare, automotive, IoT, and blockchain.

The most famous use case of Erlang was its implementation during the development of the popular messenger WhatsApp. Although WhatsApp founders Jan Koum and Brian Acton had no previous experience with this language, they noticed that Erlang had proven itself in the IT field and was created specifically for working with communications in a mode close to real-time. They were convinced that Erlang not only coped well with tasks with a high level of parallelism, but also made it possible to ensure stable operation of the system over a long period of time thanks to the ability to update the code without interruptions.

"Erlang has proven to be a reliable and versatile tool that has significantly helped WhatsApp scale and maintain a high quality of service," Brian Acton told Wired in an interview.

Erlang is used in key products of Ukrainian technology company Favbet Tech , in particular, in the betting platform. This is a service that serves a large number of users and is subject to high load. Erlang does its best here, because it is a functional programming language designed to create reliable, stable, scalable and highly loaded systems.

Even when you're playing your favorite video games and you get a notification that your character has leveled up, or a dating app informs you of the match of a lifetime, Erlang is also used. Nintendo's handheld consoles use an Erlang-based messaging system to handle millions of simultaneous connections. Thanks to Erlang, League of Legends' messaging system allows gamers to chat simultaneously. One of the world's most popular online dating apps, Grindr, processes up to 2,000 messages per second, also using Erlang.

Erlang today: flexibility and constant updates

Although the Erlang syntax itself has barely changed in decades, the language is constantly evolving.

Erlang executes code through the BEAM virtual machine, similar to Node.js or Java, but with unique features. Programs are compiled into bytecode and executed by BEAM, which acts as a separate operating system inside another operating system or directly on a server. Over the past decade, BEAM has been optimized to handle millions of processes simultaneously without loss of performance.

The peculiarity of BEAM is that each process is isolated and has its own memory management. Thanks to special schedulers, query execution occurs evenly and predictably, even during peak loads. Unlike Java or Node.js, in Erlang, increasing the number of queries does not lead to a decrease in throughput or system "hangs".

BEAM is not the fastest, but it is the most stable and predictable virtual machine, capable of handling millions of simultaneous connections without service degradation. A programmer only needs to write code for one user — scaling to millions is done automatically. If one process fails, the others continue to work without failures.

Erlang’s reliability and popularity have essentially turned it into an entire ecosystem, on the basis of which other programming languages ​​with their own frameworks have been developed. In 2011, Brazilian engineer José Valim created the Elixir programming language based on Erlang. In addition to the capabilities of Erlang, he also borrowed ideas from Ruby and Clojure. Elixir is used by such well-known companies as Discord and Pinterest.

This is why Erlang remains an extremely adaptable and competitive programming language. Concurrency and error handling allow developers to focus on business logic without worrying about the complexities of low-level programming.

Interest in Erlang is steadily growing, both from startups and large companies. For example, Favbet Tech has implemented several waves of Erlang training courses, where future specialists are taught both the basic principles of the language and real commercial practices. The program consisted of 8 theoretical classes and practical homework, and the best students get the opportunity to pass an interview and join the team. The practical focus of the course is especially valuable for students: working with processes, exception handling, testing, and the basics of OTP.

At Favbet Tech, the microservice architecture of projects is based on teams, where every graduate after the courses has a chance to enter the real development process, receive mentoring, and develop quickly.

Favbet Tech is currently looking for Erlang specialists of various levels. Previous experience would be a plus, but not a requirement, especially since the company provides training courses.

"Perseverance and willingness to continue learning are more important. I came after the courses organized by the company every year. During the course, I attended all the scheduled lectures and was responsible for completing my homework, although, to be honest, not everything worked out the first time. At the same time, I want to note that I came to the course with my own baggage of knowledge, that is, I am not a complete beginner. In my opinion, the main thing is flexibility of thinking, willingness to learn new things and develop. Erlang won me over with its reliability, ease of scaling, and the logic of building a system from small independent processes. It was different from the same Python, at first it was unusual and sometimes difficult, but with understanding came the realization that I am with Erlang for the long haul," the Favbet Tech specialist told about her experience.

Erlang Perspectives

As practice shows, 30 years of history for Erlang is not the limit. The programming language continues to develop, and its openness and accessibility attract both small startups and large companies. The BEAM virtual machine is constantly being improved: in particular, important innovations have been introduced, such as the JIT (Just-In-Time) compiler, which allowed WhatsApp to reduce the need for servers by 30%. New features and optimizations are added without breaking the compatibility that was built into the programming language at the stage of its creation.

Favbet Tech notes that stability, scalability, and heavy workloads are suitable for building a reliable infrastructure around artificial intelligence. In practice, reliability and proven solutions remain key factors in choosing Erlang.

Robert Wirding emphasizes that the Erlang language has proven its viability and continues to be the foundation of modern highly reliable systems.

Read the country's main IT news in our Telegram
Read the country's main IT news in our Telegram
On the topic
Read the country's main IT news in our Telegram

Have important news to share? Message our Telegram bot

Key events and useful links in our Telegram channel

Discussion
No comments yet.