HACKER Q&A
📣 oliverjudge

Elixir or Rust for back end in 2024 or something else?


Looking for a solid solution for a back end for a game and mobile app server. We can't roll the usual Epic/Xbox PaaS as we need to a little more flexibility.

Are Rust or Elixir still the got to's for dependability or should Go get a look in. Bonus points for good web tooling outside of an API back end.


  👤 gregors Accepted Answer ✓
It really depends on what you're trying to do specifically. Maybe take a look at Elixir/Phoenix it has ok performance while still allowing fast dev productivity. A nice feature is that if you run into a section that needs higher performance you can quite easily write a small section of it in Rust or Zig.

* https://elixir-lang.org/blog/2021/07/29/bootstraping-a-multi...

* https://github.com/njwest/Awesome-Elixir-Gaming

* https://www.erlang-factory.com/upload/presentations/395/Erla...

* Erlang Factory SF 2015 - Jamie Winsor -Building And Releasing A Massively Multiplayer Online Game https://www.youtube.com/watch?v=_i6n-eWiVn4&t=1131s

* Petri Kero | Building a Scalable, Distributed Backend for Mobile Games - https://www.youtube.com/watch?v=nCSO8yeR0c4

All that being said, Go and Rust are hands down faster and there's no denying that.


👤 WuxiFingerHold
If you don't know Rust yet, you should be careful choosing it just because of what strangers write on the internet. The learning curve is steep and the productivity much worse compared to GC languages unless you're an experienced Rust dev. I haven't used Elixir, but it looks like a very productive stack. If you're good at Rust and know what you're doing, then yes, Rust (Axum) is very nice. You can pair it with HTMX if you don't need a SPA.

👤 fouc
Go, Rust, and Elixir are probably all solid choices. Even PHP too - specifically Laravel. Ultimately it depends on the developers interests & existing knowledge.

Elixir (& the underlying Erlang) and Go certainly come with a lot of concurrency support out of box, and are well known for building websites. Though I imagine Go is usually typically treated as an API backend paired with an SPA like React.

Elixir/Phoenix offers LiveView which makes it easier to skip the API/SPA paradigm to some degree. But the higher the demand on browser interaction, the more you'll probably end up bringing in Javascript to the mix. Though you could use something like https://github.com/woutdp/live_svelte to integrate svelte & liveview.

I'm a huge fan of Elixir/Phoenix myself.


👤 uberman
What stack are your devs using now? Are you sure this is a question you should even be asking at this point?

I would almost certainly use whatever stack made my dev team most efficient and if demand was there use resource scaling to bridge the product until we did a rewrite.