Is Elixir/Phoenix ready for production?
By Development on Sun 11 March 2018in
Someone asked this question on the Elixir Forum. Following is my answer:
When I first saw Elixir, we were developing custom apps (e-commerce, CRUD, etc) with Ruby on Rails, Python, and PHP.
We were using Erlang for the “tricky bits”, e.g. IoT and real time web, and liked it a lot. In 2006, we tried to use Erlang for web development. The core was great, but the rest of the ecosystem was lacking (e.g. database interfaces, templates, automatic page loading). Productivity was not great, so we ended up making hybrid apps.
When I saw Chris McCord’s post comparing Rails and Phoenix in 2014, I was really excited. The metaprogramming capabilities of Elixir let them build a web framework that combines the power of Erlang with the ease of use of Rails.
I wanted to make sure that it would be ok to bet the company on Elixir and Phoenix. The basic productivity was great, and the Elixir and Phoenix teams focus a lot on developer experience and getting started. I knew we would be able to deliver custom development projects efficiently.
My next question was whether we would have the libraries we needed for various project requirements, e.g. interfacing with credit card payment systems. It is fine to develop a few things, but it’s hard for a startup project budget and timeline to cover development of basic libraries. As a safety valve, I looked at calling Python and Ruby from Elixir using tools like Elixir Snake and Erlport. They worked fine, and I knew that we would be ok. In practice, we haven’t needed to do that much, all the libraries we have needed have been available or we could write them quickly. We have mainly ended up using Python for things like Pandas for data analysis.
In addition to standard web development tasks, Elixir and Phoenix support the next-generation “stateful web” applications like chat that are really hard to build any other way. One thing that I really like is that a single platform can do it all, i.e. public web, back end CRUD for admin, mobile APIs, interfaces to 3rd party APIs, and real time messaging. It actually simplifies development a lot, because we don’t need to use multiple languages, multiple servers, background job queues, etc.
In the last three years, we have done all our new projects in Elixir, and it’s worked fine. You don’t have to worry about OTP when getting started, you can build apps with just Phoenix. You will want to learn it in the future, though, as it is where the platform gets a lot of its power. As for difficulty finding developers, we haven’t found it hard for devs to get up to speed on Elixir and Phoenix. Within two weeks they are fully productive, particularly if they have experienced people available to help.
There is some learning curve associated with functional development. It’s similar to learning object oriented programming. You can start programming immediately, but it takes six months before you are really thinking functionally. Then you find it difficult to use barbaric languages with mutation and miss pattern matching dearly :-).