Engineering

Beyond Ruby on Rails

Ruby on Rails framework has influenced web development globally. The framework introduced a set of features and practices that forever changed the pace of application development. It shortened the time to market by order of magnitude, compared to previous solutions. It contributed to Ruby’s mission introduced by a language creator Yukihiro Matsumoto, who said that programmers’ happiness and productivity was his main focus when he was working on a new programming language.

Ruby on Rails (RoR) has many other advantages that we know and love. Certainly, a clear and understandable syntax, reach third-party software and tools that improve productivity even more are noteworthy, as well as a vibrant community that puts much effort regularly updating frameworks, fixing issues, and work on security improvements to keep up-to-date with the best industry standards.

Ruby on Rails framework is a mature technology, and it makes perfect sense to use it in a specific group of applications to leverage all benefits. It’s perfect for quick prototyping where it shines or to build regular web applications. E-commerce or CMS applications can also be rapidly created in RoR technology thanks to the enormous amount of available gems, which help you to add features like a payment gateway or a marketing emailing campaign in minutes.

How we put a bet on Elixir

Ruby is not the most performant language out there, because it does not provide the proper tools for solving concurrency problems. Of course, it can be scaled to handle big loads. If Twitter could handle 143k Tweets per second using Ruby, you probably could do that as well. The problem is that scaling Ruby is not the easiest thing to do. Handling concurrency is complicated, which means more time spent on debugging and solving issues hard to reproduce. Just imagine what you could achieve if you could spend all that time on something else?

In the past, we have faced those performance problems in one of the demanding projects we’re working on. We decided to give a chance to other technology, which gives us the same fun of development as RoR but also allows us to make bigger, cheaper, and more performant real-time applications. That’s how we put a bet on Elixir.

It’s a functional programming language that runs on top of the Erlang VM (BEAM) and has many similarities with Ruby. Erlang is a robust, reliable, compact language that gives you actor style concurrency, immutability, and error handling semantics. With the support for millions of lightweight processes, it allows to build massively concurrent applications very quickly. It’s extreme fault-tolerance isolates errors and system crashes, allowing the system to quickly recover without a user ever noticing that it has failed.

Elixir team tried to preserve what’s best in Ruby ecosystem while dealing with the most critical problems it has. The community ended up creating Phoenix and Ecto, which are brand new libraries, yet familiar to Rails developer. They also did an excellent job providing abstractions that simplify the intricacies of Erlang and significantly reduce the learning curve of primitives, which makes Elixir an exciting choice for building apps.

We can boast with many projects from our portfolio that were successful thanks to Elixir and Phoenix framework, likewise many other big label companies such as Discord, Pinterest, Moz, Bleacher Report, or bet365 (read more here and here).

It’s not only about performance

We talked a lot about the new language inside the company. We’ve concluded that we started to use Elixir on one of the demanding projects where performance was needed, but we quickly realized that we were not using Elixir for performance reasons only (because we usually don’t need it).

It turned out that when performance problems stopped to bother us, we saw a multitude of other advantages of this language. The projects we do in Elixir are a lot different than those that are typically done in RoR.

First of all, the effortless real-time operation allows us to make systems that previously seemed impossible. With each subsequent project, we’ve learned new things, and we learned new possibilities that we transferred to other products.

Secondly, excellent performance out of the box meant that an additional layer of cache logic was no longer needed (in other hand cache solution is default in most cases in Rails), and therefore level of application complexity became smaller (which resulted in easier debugging), and the implementation time has shortened.

Thirdly, a relatively smaller number of errors turned out to be a positive side effect (thanks to immutability and functional programming, but also such things as no need to use cache). Combined with the fact that we don’t have to waste time on performance challenges or problems, it means that all this time can be spent on product development, providing real value to customer and users, which is undoubtedly a huge advantage.

Finally, Elixir is a fast language, but not the fastest in the world. Elixir gives you the benefits of speed, but without the significant tradeoffs that other, faster languages require.

Interest in Elixir increases year to year. The open-source community is involved and still growing. Elixir is in the top 10 Most Wanted languages, according to the StackOverflow survey. In the same survey, you can read, "Developers who work with Rust, WebAssembly, and Elixir contribute to open source at the highest rates." Elixir developers are also in the top 5 of the highest salaries according to the survey. We also believe that Elixir has all the attributes to become one of the languages that will shape the future of software development. If you want to be a part of that future, we have a proposal for you.

Let’s meet and talk

We believe that a good Ruby developer can be a great Elixir developer. If you’re a Ruby developer, we believe that you have all the essential skills that can make an excellent Elixir developer. Join us with such baggage of skills, and we’ll teach you the Elixir language and help to grow. We’re Appunite, a software development agency located in Poznań, Poland, and we’re hiring!