Brujo has been a programmer since the age of 10 and he has more than 15 years in the industry. He was a VB, .NET, Java and Haskell programmer until he found Erlang 8 years ago. He’s now Inaka's CTO and Erlang Solutions’ Tech Lead and Trainer. He’s an active member of the open-source community and his blog (Erlang Battleground on Medium) was the most active Erlang blog of 2016.
26 January 2017
6 months with Elixir and Phoenix
I have been using Ruby/Rails for 8 years and although I’ve used different technologies over that period, I am sure 95% of my time was spent in Ruby/Rails projects. For the latest 6 months, I have been completely immersed in the Elixir world, developing a Phoenix application from scratch, full-time. In this post I will describe my experience and opinion.
In the latest years, I had the chance to use Erlang in a couple projects. I like the language (before you ask, the syntax was never a problem, I like it) and all its features. I mostly worked in projects with Cowboy and Webmachine. While using Erlang I read two amazing books:
Those two books, together with the Erlang documentation, gave me a pretty good understanding about the fundamentals of Erlang and the OTP environment.
Erlang is great language for concurrent, fault-tolerant and soft real-time systems and I enjoy using it. Rails has spoiled me, so I was missing a more complete set of tools that would allow me to use Erlang for day-to-day web development.
I started learning Elixir and from day one I was in love with it. The language simplicity and the tools around it, make it so simple to start using it. I can just imagine the effort and time spent by José to get to a point where the language is simple, powerful and flexible at the same time.
Not long after, I had the chance to start a new project, where I would be responsible for developing a REST API (consumed by iOS and Android mobile apps) and a dashboard system (used by customers). I decided to use Elixir and Phoenix for building it and this decision proved to be successful.
Thanks to the toolset provided by them, it took only a couple of days until I deploy the first feature to production. After 6 months and a number of commits and deploys, I would like to share my experience about using Elixir and Phoenix in production.
Elixir is a beautiful language and it brings many new concepts to people that are used to OOP languages. People that had already played with a functional language before, will pick the basics really quick.
It takes a bit more time to get into more advanced concepts of the language/environment, like supervision trees, agents, monitors & links, etc.
I found it really valuable the time I had spent learning more about Erlang.
Phoenix is not Rails and it has no intentions to be an Elixir version of Rails. But if you are coming from Rails (or any other modern web framework), you will find many common places.
You will also learn a lot of new concepts and will be amazed about how simple it is. Different from Rails, where sometimes features are hidden behind magic behaviours, everything that Phoenix does is explicit and easy to follow. I found it really helpful to be able to go deep on the framework internals.
Installing Elixir and Phoenix
Installing both Elixir and Phoenix (on a mac) was really simple. It only took a couple of minutes (and no manual configuration) to install both of them following the official guides.
Creating a new Phoenix project
You can easily create a new Phoenix project running the mix
Starting the app
Starting your project’s server is also straightforward using the mix
Modern web frameworks like Rails and Django enable small teams to build entire projects in a really small time frame. It can only be achieved, because the framework offers built-in components and the community around it shares lots of open source components.
In my humble opinion, Phoenix has everything that a developer is used to find on a modern web framework. It offers built-in components (e.g. routing, database wrapping, view rendering, migrations, testing, static assets management, etc).
Phoenix goes a bit further with channels, enabling soft-realtime features to your projects (Rails 5 brings something similar with Action Cable).
Elixir and Phoenix are quite new, so you shouldn’t expect to find the same number of 3rd party libraries. Although the number is not comparable, the quality of the libraries being developed are outstanding. A basic search at https://hex.pm can give you a good idea about the available libraries.
During all those years using Rails, working on different companies world-wide, deploying meant “Capistrano” (now with Docker getting popular, it is changing a bit).
I decided to deploy the project using Elixir/Erlang releases + Ansible (I wrote a post covering this topic: Deploying Elixir releases). It was the most simple and straightforward way I found.
When you are building an MVP or a small project, performance is never something you should be worried about. That’s one of the reasons why Rails shines. But what if I tell you that you can have the same development experience and time to market without compromising speed? I believe Phoenix has achieved that.
I was amazed with the performance results when running the server locally. I got really impressed when benchmarking the project running on production machines.
To wrap it up, I am betting on Elixir and Phoenix for the future. I believe they are defining a new standard for software development. The capability of offering all the Erlang goodies, using a really nice language and development environment like Elixir does, is the perfect combination for the concurrent and async world we live at.
25 Jul 2016
A video exploring the potential of fast simulated...
08 Aug 2016
Gradle did come to stay with us. Although...
22 Aug 2016
Software Testing is not for Attention...
19 Sep 2016
New video from #droidconpl2015 is out!...
19 Sep 2016
Last night I attended a software testing...
21 Oct 2016
A summary of my visit from SystemD Conference...
24 Oct 2016
Up until yesterday, I had only gone...
24 Oct 2016
Updating sources (versions, revisions, tags)...
14 Nov 2016
Elixir is a joy to work with, an easy...
16 Nov 2016
A few weeks ago I attended Mobiconf, one of...
20 Jan 2017
When you can’t bang! This story...
26 Jan 2017
I have been using Ruby/Rails for 8 years and...
07 Feb 2017
I am an old Java man, I never allocated many of...
07 Feb 2017
Earlier today, Dorothy Graham presented...
07 Feb 2017
I have seen great posts about Elixir release...
22 Feb 2017
I first time I came across the term of "dark...
22 Feb 2017
You probably know...
22 Feb 2017
I am quite happy to share that I have...
06 Mar 2017
Who will find this interesting If you’re...
07 Mar 2017
A peer2peer and/or crowdfunding, blockchain...