How do you choose the right programming language for a project? As a developer or a key-decision maker you could decide based on your personal preference, or what is fashionable at the time, but if you’re not considering real experiences and use cases, you may end up making a decision that becomes difficult to execute, expensive to complete and a nightmare to maintain.
As Francesco mentioned in the Erlang blog of our #MyTopdogStatus series, you could start by asking why a language was created. This will help ensure that you’re choosing a language designed to fix a problem suited to your needs. On a number of occasions, José Valim has stated he wanted to give the power and productivity of Erlang to more developers.
Another great tip for choosing a language is to look under the hood and see what powers it. For that, the previously mentioned Erlang blog gives you a great insight into the OTP and Virtual Machine (VM) that helps make Elixir the powerful language that it is.
Lastly, you can look at case studies to see how other companies have used the language, why they’ve chosen it, and what they were able to achieve. In practice, it’s not easy to find this information, as we still don’t know exactly how many companies use Elixir or their exact use case. Luckily, we can refer to www.elixir-companies.com or openly ask the community. You could even subscribe to the newsletter of Plataformatec who funded the initial creation of Elixir and always share fantastic stories about the language in use. And we hope this blog post will be helpful too!
Simply put, here is a checklist of common benefits that a company gets from using Elixir:
Need to grow or scale – If you have a service that you expect to be used by millions, then you’ll benefit from the reliability and scalability of the BEAM VM.
Handling a lot of incoming requests – Even if you don’t have millions of users, if all of your users make intense use of the system and generate a high volume of requests, you will need a system built for concurrency.
Easy to develop and maintainable – One of the priorities of Erlang and Elixir is keeping the code simple. As a result, one of the advantages most companies will see is ease of usage and fast development for everything from fixing bugs to adding new features.
Now, without further ado, let’s look at who’s using Elixir and how.
Event handling by Pinterest
Have you heard that Pinterest are using Elixir? Well, now you have. They use it to handle the routing of the events generated in their system. Think about all of the actions taking place on Pinterest in a day. How many do you think there are? The answer is around 30 thousand events per second that need to be processed. In addition, they have over 200 million active users.
Keep in mind, 20 years ago, it would have been impressive to achieve 10 thousand concurrent connections. Luckily, the way the BEAM works lets us handle and deal with huge spikes in concurrent connections in a way that would be very difficult to replicate in other technologies.
Elixir is a good example of a language which takes advantage of the BEAM VM, which is why it was a great choice for Pinterest. Not only were they able to handle the demands of their users, but they were also able to significantly reduce the lines of code needed by simplifying it and clustering it. The end result being, they were able to half the number of servers needed, down to just 15, allowing their solution to scale up with simple, maintainable code and lower operating costs. And, it’s better for the environment too.
Faster distributed data by Moz Pro
Companies often look for alternatives to SQL for data storage. In the case of Moz Pro, one of the leading SEO analytics companies in the world, they decided to replace their traditional MySQL databases with a distributed indexing data system built in Elixir. In doing this, they managed to get responses of 50ms, significantly quicker than the previous +800ms.
Elixir’s ability to be distributed in different nodes while keeping transparent communication between the connected nodes makes it easy to create this kind of solution, improving service speed, no matter how much data you need to store.
The BEAM can handle millions of processes per node. That helps to create cache systems, as well get rid of other external solutions like Redis or Memcached. In addition, the BEAM provides elements like DETS, ETS and Mnesia which help to create distributed data systems with ease.
Proxying requests by Lonely Planet
This example shows the ability of an Elixir and the Phoenix Framework to create a project that can handle massive spikes and loads from their millions of users while managing the flow of requests to external sites like booking.com and HostelWorld.
Elixir is a great solution for creating systems to manage a high volume of requests to external resources. It allows you to create a pool of workers to access external APIs and keep back-pressure systems to avoid overwhelming your partner websites, which is an essential part of a successful system of this nature.
In addition, the Phoenix Framework is a very complete system to build extremely complex websites. It makes extensibility, documentation and avoiding boiler-plate issues easy by minimising the lines of code needed. This allows you to focus on the implementation of integrations with third-party platforms.
GraphQL by Financial Times
The Financial Times made fantastic use of the Absinthe framework in Elixir, and Elixir’s meta-programming ability to create DSLs (Domain Specific Languages). Ellis Pritchard, the Senior Software Developer at the time said:
“I found developers picked up Elixir basics very rapidly if there is an existing framework of code to work within at first since there are patterns they can spot and replicate. Good developers love learning new things, and are adept at switching between languages and frameworks; plus the learning curve for Elixir, certainly within an existing code base, seems low”.
They use Elixir for microservices in their system. You can check their GitHub account for more details and take advantage of the elements they share which are battle-tested in production.
Mobility Services by Toyota Connected
Toyota Connected launched its Mobility Service Platform (MSPF) which connects their cars, allowing them to send real-time events. Functional uses for this include sharing information on traffic patterns or driver behaviours.
It is a platform that is expected to have millions of connected vehicles sending events to the cloud regularly. This kind of concurrent traffic makes Elixir an obvious choice for the project. In addition, Toyota Connected features an API that third-parties can use to create apps and website integrations. This allows third parties to take advantage of the data and create a better user experience for their drivers.
A great example of this is the Hui service in Hawaii, which uses the Toyota Connected system to run a keyless car-share service.
Custom Sports News by Bleacher Report
Bleacher Report is a sports news service that serves 1.5 billion pages per month to its users. They offer a customised service to ensure push notifications are relevant to each individual. That in itself is difficult because it means you cannot cache the content between users.
Much like Lonely Planet, Bleacher Report also has to consider how they send requests to third-parties (mainly Google and Apple) to reach their users without limiting the throughput or overwhelming their providers.
When transitioning from Ruby on Rails to Elixir they were able to shift from using 150 servers, down to 5 servers, all while increasing response time for their 200m+ daily push notifications.
Microservices for Games by SquareEnix
The increase in massive-multiplayer online gaming has seen a huge shift in the way games are developed. Now, digital environments must consider the way they can handle millions of concurrent players at once. To handle this, SquareEnix is using Elixir for authenticating players, in-game communication and the CMS (Content Management System).
These are services which are common to several titles because they rely on the same company and are usually a critical point of convergence for the traffic of the system. Elixir helps provide a healthy throughput, dealing with all of the input requests and releasing the session, authentication and profile data from other services without collapsing the system.
Chat for gamers by Discord
Another huge use for Elixir in gaming is the chat systems. Discord, a leading provider of chat for gaming have built their systems in Elixir. Their app can allow huge groups (up-to 300 thousand in theory) to join the same voice call. You can read about how they upgraded to be able to handle 11 million concurrent users here.
ECommerce by PepsiCo
The ECommerce team at PepsiCo told ElixirConf US 2019 “We view Elixir – which is a core part of our software stack – as a nimble and reliable building block for powering critical business solutions.” It is fantastic to see companies of PepsiCo’s size proudly speaking about the benefits of Elixir. We hope to add many more companies of their size to this list over the coming years.
Is it time for you to join the pack?
Leading companies in a variety of industries are already taking advantage of Elixir. They’re doing it to reduce the cost of their physical hardware, improve the reliability of their site when dealing with high volumes of concurrent users, to scale up data while reducing the time to access it, to allow for fault-tolerant third-party integration, even when dealing with high volumes of traffic and to create reliable micro-services, even when dealing with extremely high numbers of request.
Even if the above requirements aren’t needed for your current project, you can still benefit from the future-proofing, ease of use, available documentation and tooling that Elixir offers.
Our consultancy work with the elixir programming language.