Rails vs Phoenix

As Elixir and Phoenix are well known now, I think it might be handy to have a thread that lays out differences, benefits and personal experiences that anyone might like to share :slight_smile:

  • What do you like about Phoenix?
  • What do you miss from Rails?
  • Where are they similar?
  • Where do they differ the most?
  • When would you use/recommend either?
  • Anything else you’d like to share?
8 Likes
  1. easier to understand how it works and lots of pros from Elixir and of course awesome forum
  2. job places in most counties and their states
  3. MVC, databases etc.
  4. Language differences => usage (code management) and popularity
  5. At start (I mean to learn a language for job): Rails and Phoenix in more “advanced” level (at now)
  6. I think Elixir / Phoenix only needs time to gain more popularity and a certain amount of work to meet the newly published standards. Right now you can not complain about the interest of independent programmers and activity of this forum, but this is not yet the level of other languages including Ruby.

What do you think about add translations to elixir-lang site? I think it will be an additional advantage for novice programmers. If someone is interested I can try translate it to my primary language. :smile:

3 Likes

Go open an issue in the repository, or even send a mail to the core mailing list. But i bet José could be interested :slight_smile:

3 Likes

This might be a bit off topic but people always say Rails’ ecosystem is bigger (true). I’m wondering what Ruby libraries people like to use that don’t exist in Elixir—would love to help out the ecosystem grow and gain parity.

4 Likes

What do you like about Phoenix?

The speed and concurrency.

What do you miss from Rails?

Whatever you may need, there is always a gem for that. Want to do recurring billing with paypal, there is a gem for that. This is one area where Elixir is really lacking.

Where are they similar?

Both the communities are awesome.

When would you use/recommend either?

At this moment if you have to integrate with other products e.g. paypal, I’d go with Ruby. If the app needs to be performant I’d go with phoenix. A combination of these could also be a good approach.

Anything else you’d like to share?

It would be awesome if we can talk about ways to use code written in Ruby from Elixir. Be it using ports or message queues.

1 Like

If you think that this is a good idea to ask I will just ping @josevalim.
I noticed that the biggest difference between these projects is their popularity. So I thought that translate this page can help increase interest of beginners and de facto increase elixir-lang popularity.
I see that elixir-lang page have no option to change language, so I thought there are no plans to introduce this. What do you think about it José?

1 Like

We would love more translations but not on the main website because that would add burden to us to maintain multiple translations. imagine for example how to handle bug reports and pull requests if we had 10 translations on the same repository.

However, we have recommended others to fork the website, remove the dynamic stuff, like blogs and deploy your translation. I think there are 2 or 3 translations running like that although I can’t recall the idioms.

Another idea is to support Elixir School, which seems to have a good workflow for translators and is a great way to get started with Elixir.

4 Likes

Am I the only one who cringes at the “versus” in the title here?

I don’t want to propagate the idea that for one language/framework to grow means that some other has to diminish. Or that a junior developer can pick one to learn and then rest on their laurels for the rest of their career without continual self-education. Always be learning. Try both out if you’re not sure which one fits a situation. At this point of both frameworks, in a given situation, I can imagine choosing/recommending either one.

If I need to summarize my thoughts on the reasons to choose one over the other it is that Rails gives you more short term benefit (from the large community. number of gems, number of blogs, ease of finding knowledgable developers, etc.) at the expense of potential long term scalability bottlenecks (if your app/company survives that long). Personally I prefer a long-term vision, but I do the people paying my paycheck a disservice by only thinking long-term. Phoenix is the better long term solution, but without a team who has used it before, you’ll find yourself slower in the short term just learning new ways of thinking and new tools and making beginner mistakes. If your app never needs to scale beyond a level you can get from of Rails out of the box or via blog recipes, then you spent more time than you need to.

7 Likes

5 posts were split to a new topic: Split posts from Rails vs Phoenix thread

IMHO - better interop between Ruby and Elixir would drive adoption and benefit both communities. Elixir could use the Gems. Rails would benefit by consolidating the job-queue and web-socket processes onto the BEAM.

2 Likes

The wording of the title was very deliberate because I feel that 9 times out of 10 people wishing to compare Rails and Phoenix will most probably Google ‘Rails vs Phoenix’ - and I would love for them to be referred here so they will (imo) be more likely to see a well balanced and fair discussion.

If you also object to the post content I would appreciate you telling me how I could do a better job of inviting comments about what people like about Phoenix, what they miss from Rails, where they feel they are similar, where they feel they differ the most, when they might use or recommend either plus anything else they’d like to share that others might find helpful.

2 Likes

You do not understand me correctly. I do not want to allow bug reports or pull request in other languages.
The main part to be translated is an Elixir tutorial and optionally site UI (links, buttons etc.).
Note also that the copy of page could be confused with an attempt to fraud and therefore deliberately omitted. Am I wrong with it?
Optionally docs could be translated too if collected docs data (function definition, spec and description) would be saved into database.
But basically what I want is to just translate an elixir tutorial.
If I would like to have translated copy of the tutorial the best course would be set up my own page with custom look.
This gives more work than normal translation and in some cases (for example if I want TLD or better hosting) I need to pay for my site.

What do you like about Phoenix?

  1. Based on Elixir, Functional programming really helps me
 a lot.
  2. Phoenix template, it is damn fast.
  3. Concurrency, nuff said.

What do you miss from Rails?

Devise

3 Likes

Take a look at https://github.com/smpallen99/coherence

4 Likes

Channels, use the right tool for the job (asset pipieline, more in the DB, GNU gettext), changesets, explicitness, Phoenix is not your application, raw performance while pretaining general pleasure, View ↔ Template distinction

What do you miss from Rails?

Eco system. Not only gems (something good & stable devise-ish comes to mind), but also integrations for bug monitoring, application performance monitoring and all that. Easy integrations for useful services e.g. relating to payment etc. - in general we found everything we needed though (PostGIS, JWT & friends)

Where are they similar?

Overall MVC structure (although that seems to change) and a focus on developer happiness and productivity and largely a nice community.

Where do they differ the most?

Phoenix is not your application vs. holy monorail of all the things that even inlines perfectly fine library functionality (timecop). Also to the point where Phoenix is more a normal elixir/mix project whereas Rails is
 a Rails project.

When would you use/recommend either?

Basically I’d wanna check if:

  • is my team up for using Phoenix? Do people want to? Have we had previous experience? Are people ok with doing some FP?
  • how big is the project (if not much previous phoenix experience I’d tend to hesitate to bet on it)
  • are the libraries in the eco system that I need from what I see from the general feature set
  • does the application call for websockets/long polling?
  • how much traffic will the application be under?
  • is it viable to onboard people and be a bit less productive in the beginning?
  • Who will maintain the project? (e.g. for client work)
  • is this a project we will work on for long or is it a quick one off (I tend to say that I think you can still build things a bit faster in rails in the beginning, but I feel like in the long term phoenix becomes faster due to more explicitness it’s easier to understand and extend)

Anything else you’d like to share?

Thanks for Elixir and Phoenix. It’s a joy for me and I love it very much although we should avoid the “it’s better than everything else!!!”.

Just gave a talk at Rubyconf.pt about Elixr and Phoenix - people loved it and were very interested :slight_smile:

6 Likes

These tasks are more complex in Elixir, b/c a typical application consists from dozens independent apps. But there is a plenty of projects that provide some opportunities in these areas:

3 Likes

Having suggested coherence in place of devise; what is recommended to fill the authorisation role of pundit?

2 Likes

For those interested in auth, have a look at this thread :slight_smile:

2 Likes

It appeals to me that here is a web server technology that will spread it’s workload across multiple cores working concurrently and do so implicitly without a special rewrite. Low power multicore CPUs (e.g. Octacore ARM) offer high throughput at very low cost. This massively reduces the need to crank up multiple instances as workload rises (in the way cloud providers love to do). This is about Elixir/ BEAM more than Phoenix but they are inextricably linked.

The other comment is that with Rails: background jobs need extra plumbing and often extra external processes that have to be configured and coordinated at every turn. Phoenix by contrast appears to encompass such capabilities without fuss.

2 Likes

We now have a thread (missing libraries and tools) setup to do exactly that.