Jauny

Jauny

Phoenix a better fit compared to node or rails?

Hey everyone!

Sorry if the question has been asked before - I’ve seen a few equivalent questions but nothing similar.

I’m comparing Phoenix, Rails and Node to build an API for a client right now.
Their current backend is a Parse app with MongoDB supporting iOS and Android app and a Next.js app, so we’re purely talking about API/backend layer right now. We’d be moving out of Mongo to MySQL or Postgres.

It’s for a P2P marketplace, so the basic needs are

  • authentication (including facebook login)
  • payment (paypal and braintree/stripe soon)
  • messaging
  • CRUD
  • Probably a graphQL layer (multiple resources often required on most pages, such as users, reviews, items for sell, followers, etc on profiles)
  • Deploying on aws elastic beanstalk

Almost no eng team right now (2 founders + 1 android engineer) but hiring 10-12 engineers this year (all platforms).

I’ll probably have to argue against Node since this is what they have right now. I’m debating between Rails and Phoenix with myself, as I trust Rails in being able to be good enough and make me fast as there will be gems for everything.

Are there any red flags I should be aware of with Phoenix? Something that might not be as easy as with Rails?
This is not going to be such a straight forward project as we’re talking of a rewrite + migration of backend, which is always tricky, so I wanna make sure we head the right direction, building the correct platform to support all clients and be efficient.

Cheers :slight_smile:

Most Liked

abitdodgy

abitdodgy

We are using Phoenix in production at a multinational retailer that handles millions of transactions per month. So far it has been a fantastic decision and an absolute pleasure. It’s the most reliable part of the stack in terms of uptime and speed. It’s also cheap to run and maintain. We’re migrating chunks of our ERP (extremely complex system built around SAP) to Phoenix, and the results have been consistently positive.

Although, the one thing I miss from working with Rails in the larger ecosystem.

Fl4m3Ph03n1x

Fl4m3Ph03n1x

If you have to deal with MongoDB, then you are better off with NodeJS, mainly because the driver for MongoDB is official (meaning it is made by MongoDB themselves).

Elixir does have a community driver, but it pales in comparison to the NodeJs one. We used the Elixir driver for a while but its performance was so abismal we were forced to integrate our Elixir stack with NodeJS just for the MongoDB drivers to get the performance we needed.

If however, you want GraphQL, then both Elixir and Node are good options. There is even a GraphQL book for Elixir in case you want to check it out:

easco

easco

Apart from the learning curve of understanding a framework, I’ve not run into any problems using Phoenix as an API server (both Rest and GraphQL through Absinthe) for iOS and Android applications.

When the Phoenix server is making a direct response to an query we see response times that are measurably faster than Node, but not perceptible at the human/UI level. In much of our usage, however, the Phoenix or Node application is acting as an intermediary (a middle-tier) to back-end systems whose API calls dominate the execution time.

One thing with Elixir and Phoenix that seems to catch folks by surprise is the unique deployment options. If you have a deployment pipeline in place for Node entities, you will likely have to explore the Elixir deployment options and change that pipeline for Elixir. It’s not overwhelming by any stretch of the imagination, but lots of folks come here with questions and remarking on how it was not as straightforward as they thought.

Where Next?

Popular in Questions Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> somethi...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43622 214
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 47930 226
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New

We're in Beta

About us Mission Statement