Scaling up with Elixir

Click for: original source

It’s exciting when your website or platform gets a spike in traffic – that is, unless it fails. A disappointing web experience can quickly encourage new users to look elsewhere for an alternative that is faster and more responsive to their needs. By Nathan Long.

One important factor is how your code handles concurrency – that is, its ability to juggle multiple tasks at once (read more about concurrency here). And as many companies have shown, for concurrent programming, you can’t beat the Erlang virtual machine.

For example, you may have heard that 90% of all internet traffic goes through Erlang-controlled nodes, with Cisco alone shipping 2 million devices a year that use Erlang. Or that WhatsApp scaled to serve 900 million users with an Erlang service written by just 50 engineers.

The article deals with:

  • Concurrency-Oriented Programming
  • Non-blocking IO
  • Non-blocking computation
  • Error isolation: if an error occurs in one process, it can fail or be restarted without other processes being affected at all
  • Superpowers applied
  • Simpler stacks

Phoenix (web framework) has a tiny memory footprint and can happily run on a Raspberry Pi Zero as the interface of a Nerves project. To be clear, Elixir is no silver bullet. Writing scalable software always requires thought and care. You will also get plenty of links to further reading. Good read!

[Read More]

Tags elixir programming functional-programming erlang