Elixir and Phoenix
Elixir is an open source, functional, dynamic language with a strong emphasis on concurrency and fault tolerance. It runs on BEAM, Erlang’s virtual machine, so it takes full advantage of Erlang and OTP’s fully tested ecosystem. If you think these properties are key for your new project, then Elixir may be just what you’re looking for.
Elixir was built with concurrency in mind. Its basic units of execution (called processes, but they are actually different than native OS processes) are easy to spawn and very inexpensive to keep, so it's common to have thousands of processes running at the same time.
Elixir provides a special type of process called supervisor, whose only responsibility is to monitor other processes so that in the event of failure they can restart them with an initial state. Because our system consists of multiple processes, each with its own limited scope of work, a failure in one part of it won't necessarily affect the rest.
Put this together, and we have a system that won't be affected by a failure in one particular module of it, and even if this module fails it will be automatically restarted with a fresh initial state. Sleep easy knowing that our system is up and working, and we’ll take a look at that issue in the morning ;)
Processes in Elixir are completely isolated and only communicate with each other via messages. This design, while limiting at first sight, actually allows a really flexible scalability model: having no shared resources of any kind, processes can run on the same (Erlang’s) virtual machine, on different VMs on the same computer, and even on different computers. We can provide you with a solution that natively supports horizontal scaling across multiple nodes right from the start.
Hot code swapping
Erlang is one the few languages that natively supports hot code swapping. As Elixir runs on the same virtual machine it enjoys the same benefit. This unique feature allows us to update specific sections of the code without stopping the system or even ongoing connections.
Phoenix - The web framework for Elixir
Phoenix is the most popular web framework for Elixir. It leverages the Erlang virtual machine to create full-featured web applications that follow the platform’s philosophy. It puts special focus on real time interaction with a concept called channels, which enables bidirectional communication between the clients and the server.
Is Elixir the right choice for your project?
If you are thinking of a highly distributed system, low latency, high availability or other characteristics of the sort as critical for your new project, we suggest Elixir as it can definitely provide an advantage over other platforms. If that’s not the case, but you still think your project would benefit from Elixir’s distinctive features, drop us a line. Elixir is a general purpose language with a wide range of applications.