xgeek116

xgeek116

Hello,

We have been using Elixir and Phoneix for creating REST APIs for a few months now.

But I can’t see the benefits of this switch (from nodejs / Nestjs) in terms of performance, speed etc ?

So :

  1. Can you please tell me why are you using it ? (did you switch from another technology ?)
  2. What are the major benefits ? To explore them
  3. Is there a specific domain to used it in ? (AI, mailing etc.) ?
  4. In terms of deployment, scaling etc. Do you find it efficient ?

Many thanks

Showing Posts 1 to 10

cmo

cmo

  1. It’s a joy to develop in. Switched from F#/C# and Python (part way through the project).

  2. The concurrency model of the BEAM. Speed/ease of development, documentation, REPL, community.

  3. Pretty much whatever domain you like. Web, distributed, data, orchestration, embedded, machine learning, desktop, mobile (mobile is in it’s infancy).

  4. Yes it’s efficient. It’s no Rust/C, but you can use those from Elixir. Deployment is fairly trivial.

webuhu

webuhu

  1. It’s fun. Its design paradigm (or better say the groundwork of Erlang) fits better with my worldview.
    It feeds me. As a single developer, deciding most things on my own, nobody ever complained why I’m using it. (switched from former PHP to Ruby / Node.js; & I have never regretted)

  2. I really like dynamic typing for the benefit of fast progress.
    I manage to do less bugfixing and more time for progress.
    Documentation is wonderful compared to other languages.

  3. Everything network related it’s perfect. But also for IoT (nerves) and starting in AI there are valid options.

  4. You can scale very very far without really thinking about it.
    If you really need to scale beyond that, you’ve got a perfect groundwork.
    Energy efficient - probably not the best option. :wink:
    Efficient in terms of development speed - definitely.
    Efficient in general - it does its job very good.

kanishka

kanishka

I switched from other functional languages because Elixir has a larger ecosystem with an emphasis on supporting practical engineering tasks like database backed web applications. Both Ecto and phoenix are nice to use. Mix has also been pleasant.

I would choose it over node/nest because I can spend more time developing and less time upgrading and migrating within churning ecosystem.

dimitarvp

dimitarvp

Elixir and Phoenix are good for:

  • Any web app with server-side rendering.
  • Any web app with client-side rendering (you can use partial hydration with JSON API server that Phoenix can also do). Phoenix integrates well with every frontend framework but you’ll have to do some plumbing with webpack, rollup, esbuild and others.
  • Any API server (REST and GraphQL through HTTP[S] are best supported though we have functional libraries for gRPC as well).
  • Any long-term persistent servers – general background workers, crawlers, data collectors and aggregators, and many others.
  • Any app backend that requires persistent bi-directional connections to its clients. Phoenix’s WebSockets support is very good.
  • And lately some ML is on the rise though I’m not sure how well-supported it is at the moment.

You can use Elixir for likely no less than 80% of all possible projects out there.

It’s at least as fast as the hot paths in JS, so it’s pretty fast. We’re talking average 15-35 milliseconds per request in a web app even when DB is involved.

As others mentioned it’s no C/C++ or Rust but (a) you can use these in your super hot paths if you want, and (b) most apps don’t need such a beastly speed so you’re 98% likely to get away with pure Elixir.

Elixir is a secret weapon. Many people can’t see that because they want to arrive at an already super popular ecosystem. Rest assured however, companies using Elixir are very happy with their choice, and they can get away with hiring less devs, too.

12
Post #4
derek-zhou

derek-zhou

I am just curious, why switch then? You must be hoping for something, right? What is that something you were hoping for, but didn’t get? Speed? I am not sure an Elixir stack can beat NodeJS for throughput, but I am quite confident that a Elixir stack shall have a better latency histogram, like 99% percentile latency. Is that something you want?

tj0

tj0

I think the biggest benefit that no one has mentioned yet is maintainability over multiple years.

The ecosystem is stable yet steadily improving. And you may have noticed already that the language lends itself to making easier to understand code which means less bugs or maintenance headache.

If you want to have a long-running stable system with minimal maintenance cost, I’m not sure how the JS ecosystem can compete.

11
Post #6
wanton7

wanton7

Why are you creating REST APIs? Is it for web app? If that’s the case have you looked at Phoenix LiveView? With it you could avoid creating any kind web facing API and save huge amount of dev time and save even more with simpler web app development model. Also you would be mostly working with Elixir when it comes to UI, so pretty much full stack Elixir.

NaN

NaN

I came to Elixir / Erlang from Rust that said…

Concurrency… Previously I worked in fin tech, privately. I built highly concurrent permutation testing / modeling applications. In Rust you can use C bindings and control thread affinity, and must to get a 1-1 model to avoid context switching, etc. BEAM does that for you.

As with any language spinning up threads in Elixir has some overhead with that under consideration… its not as heavy as OS threads. The smaller you can break down a set of problems the more concurrent you can become and provided you don’t loose efficiency due to the cost of threading you can tackle real world problems very quickly.

For example, notwithstanding bloat for piping through Phoenix among other things, I build a file parser that takes semi structured .log files at 11.1gb and can extract data in 33 seconds with ~6 delimiters. (Hardware : 32gb ram, Intel© Core™ i9-10885H CPU @ 2.40GHz × 8, m,2 drive)

Ive not tested this in Rust… but building such an architecture would take much more work… and it still may not be as fast..

dimitarvp

dimitarvp

I do both Elixir and Rust, a lot (especially Rust async + tokio lately), and I know Rust can do this 2.5x - 3.0x faster but yeah, having in mind that it would take longer to develop then it’s not certain it’s worth it to develop such a toy problem in Rust – unless such payloads have to be ingested several times per minute.

Nicoo

Nicoo

During 20 years of development, coming from PHP → Node.js → Go → Crystal lang, a little bit of Flutter/Dart, Rust and others. I feel Elixir to be a good middle ground for productivity, maintainability, robustness, ecosystem, community and fun to code.

I find in it the main qualities I liked in other languages, plus the things specific to Elixir / Phoenix / Erlang. There is a lot to do with Elixir. :slight_smile:

It’s some benefits but it’s not exclusive, nothing prevents you from doing some Node.js / Next.js for some projects and Elixir for others (this is what I do).

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews