Elixir: The Best Choice for Modern Web Applications
Elixir not only lends software projects the performance they demand, the programming language also leverages the ability of applications to serve organizations beyond what they believed possible. In this presentation, DockYard CEO Brian Cardarella breaks down the basics of Elixir, its fundamental Erlang structure, and its advantages over a host of other “latest and greatest” technologies.
Watch his full presentation and read the summary below.
What is Elixir?
Elixir is a programming language that runs on the Erlang virtual machine (VM). Elixir was created on top of Erlang to solve problems with concurrency that existed in the previous generation of backend solutions. The result is a functional, concurrent language that shares Erlang abstractions for building distributed, fault-tolerant applications.
Erlang is the power that drives Elixir’s capabilities. It’s a battle-tested, 30-year-old language originally meant to handle global telecom systems but with several future-forward abilities. Think zero downtime with self-healing capabilities built in, and the ability to handle in-place upgrades of an application while it’s running in production. Being able to push code updates live gives an app an incredibly cutting-edge feel.
What Makes Elixir Better?
Engineering teams face increasing demands to solve difficult business problems with advanced technologies. They’re often overwhelmed by the newest programming languages. Meanwhile, the applications they’re asked to deliver are still expected to perform at the highest of levels.
Flexibility, scalability, and speed — reaching and maintaining these optimal performance attributes require something proven that doesn’t present a significant risk. Elixir — built on top of Erlang, a platform already used by multi-billion-dollar corporations — is just that.
Can Your Share Additional Benefits of Programming with Elixir?
With a clean, familiar syntax and a mature tooling system, Elixir is incredibly easy to work with. The language incorporates built-in unit testing and documentation to ensure software is working properly. Other benefits include:
Pattern matching — This incredibly powerful feature replaces imperative code with declarative, making code less prone to error and more readable — thus more maintainable. Put another way, rather than writing code that describes how to extract data from some structure, developers simply write a pattern that matches the data structure itself, and in the process, the extraction is done automatically.
Memory — Elixir’s memory management architecture supports its ability to scale linearly. Because each process manages its own memory, and there is less processing time needed for cleaning up “garbage” code, the application execution never comes to a halt. On a multi-processing machine, other work can be done in parallel with a process undergoing garbage collecting.
Scalability — Elixir software applications want to be efficient by making the best use possible of all the cores in a CPU. Nothing special needs to be written; the Erlang VM handles the resource distribution automatically. In past years, multi-core CPUs were expensive, but cost has reduced significantly, making them a great choice when using Elixir.
Who Uses Elixir?
One of the early adopters of Elixir was Bleacher Report. The sports and sports culture news publisher wanted a way to push breaking news stories as quickly as possible to its app subscribers, but was averaging about three minutes between the time the news was pushed across the system to the time readers could access it. The company started with 150 Amazon Web Services (AWS) instances, and servers jammed with data requests, along with significant developer personnel overhead.
After the move to Elixir, Bleacher cut a third of its AWS instances, with response time from servers improved to 10-30 milliseconds. In addition, it reduced the number of servers it needed, and was able to better allocate engineering resources. As a result of these improvements, Bleacher push notifications were able to reach subscribers in roughly three seconds.
Elixir is also used in a host of other industries — from automotive to information technology, to communications and collaboration.
DockYard is a digital product agency offering exceptional strategy, design, full stack engineering, web app development, custom software, Ember, Elixir, and Phoenix services, consulting, and training. With a nationwide staff, we’ve got consultants in key markets across the U.S., including Seattle, San Francisco, Denver, Chicago, Dallas, Atlanta, and New York.