Why do I use systems based on Erlang (Including Elixir) for web work? There are a lot of reasons, but the but they by and large come down to this. The Erlang Virtual Machine (BEAM) solves the problems I care about.

Telephone Switches

A bit of History, Erlang was created in the late 80’s to early 90’s by Joe Armstrong, Robert Virding, and Mike Williams at Ericson to do one thing, program telephone switches. Which makes sense as Ericson makes telephone switches.

Telephone switches have a lot of requirements that were driven by both business and regulatory requirements. These features include

  • Distribution
  • Scale to large number of users
  • Fault Tolerance (equipment failures happen)
  • Soft Real time
  • Non Stop Applications
  • Hot Swapping of code
  • Long Product Life

Scale

If you think about your boring old landline phone (which you may not even have anymore) the thing about them is that they just work! And the switches that make the entire system work have to be reliable to a very high level. In addition a phone switch has to handle a very large number of connections, a phone switch that could only handle 1,000 calls at a time would not be a viable product.

Hotswap

In addition you need to be able to upgrade software on the fly. You can imagine the result if the phone company would announce that tomorrow we will take the entire city’s phones offline for an hour so we can fix some bugs, it would probably not go over very well!

Fault isolation

If a bug causes 1 call to drop that is not good, if it causes all the calls on a switch to drop that is really bad! So having a way to isolate faults so that they

Long Product life

I don’t know how long the average phone switch is in production, but I have to assume that it is a long time. Being backwards compatible is a key feature. You may have to fix a bug on a system that was deployed 5 years ago, so being able to have the tools to do that is key

Modern Web

Now when I build a web application in 2017, what features do I want?

  • Distribution
  • Scale to large number of users
  • Fault Tolerance (equipment failures happen)
  • Soft Real time
  • Non Stop Applications
  • Hot Swapping of code
  • Long Product Life

Now instead of writing something new I could go and look around and see if anything has already done that, and it turns out that Ericson has done so. They have a language and runtime that is about 30 years old and has been heavily tested under a wide range of industrial uses including places like Whatsapp, Bet365, and others.

In addition the Ericson OTP team is rather conservative, much of the modern culture of the web seems to involve throwing out everything you have done and replacing it every three years. Which is great as long as you assume that your products will never last more than two years! If you want a product that will last 20 years or more then this idea is a non starter. I don’t know if the system I build today will still be running in 10 years, but if the client needs that I would like to know that It will not be a problem.