Why I Chose Elixir Phoenix over Rails, Laravel, and Next.js

272 pointsposted 4 months ago
by akarshc

135 Comments

mati365

4 months ago

I implemented CKEditor integrations for Rails, Livewire, Phoenix, and React. I think the best developer experience was with Phoenix - at every step I was surprised by how well thought-out the framework is and how easy it is to build integrations for it. I definitely can’t say the same about Rails or, especially, React with the awful Next.js. For anyone curious: https://github.com/Mati365/ckeditor5-phoenix

As for Livewire - it feels like a simplified copy of Phoenix. In my opinion, it’s less advanced and less intuitive. For example, Livewire components don’t support slots, while Phoenix components handle them without any issues. Slots are critical for clean component composition - without them, you end up with messy, repetitive templates and a lot of unnecessary logic in the components themselves.

When it comes to Next.js, constant router changes and questionable decisions have become a daily routine. There’s no point integrating with something that gets rewritten every week and can’t be trusted to stay stable.

dominicrose

4 months ago

PHP (Laravel) + JQuery still works for me in 2025, but I would never use Livewire.

Using Node.js would hurt productivity but it's more powerful if needed. It may be needed because it has async/await and it has socket.io. It's also possible to use Typescript.

Next.js can be useful if you need everything (good SEO + highly interactive) but let's be honest how many websites need good SEO and websockets? LinkedIn maybe.

Tade0

4 months ago

I'm curious about your experience with Rails. What specifically caused issues?

jarek83

4 months ago

I wonder what made it hard for you in Rails.

omnimus

4 months ago

I am not sure you can say Livewire is a copy. The name suggests that is the case but both projects were started at similar time Livewire is afaik even older project than Liveview (Hotwire is youngest - in a way). They both take different approaches because PHP/Elixir have very different characteristics.

I think Livewire is still pretty great. Since PHP can't do websockets easily they focus on http and in most cases thats just fine. Liveview websockets can be an overkill.

rustystump

4 months ago

It makes me sad that today you cannot say react without nextjs in the same sentence.

React used to be the leader in how to make ui reasonable in the generic client sense. Having done java swing, android, swift ui, and custom game dev ui work with all the forms of state management, react was on to something… until the ssr fad attacked. Now it is all but nextjs in disguise.

lowercased

4 months ago

> For example, Livewire components don’t support slots

IIRC, Livewire 4 will support slots, but... that's still a few weeks away from release. There seem to be a number of perf and qol improvements in LW4.

ramon156

4 months ago

I want to give both of these a try, especially if you say react+next.js is awful. You'd think TS-TS would be well thought out

xutopia

4 months ago

I love how this article reads more like the individual ignores features and capabilities of other frameworks to then state that the framework he chose is better.

Rails has everything he mentions as an advantage of Phoenix. He's also implying that Rails does not use web sockets to communicate with frontend which is not only wrong it should be evidently wrong to anyone who built a Rails app in the last 3 years.

That's not to say that Phoenix and LiveView aren't phenomenal tools, they are! However what's keeping me in the Rails world is Hotwire Native. I truly feel like a one man army building mobile and web apps in a quick turnaround time.

garbthetill

4 months ago

Ive only used ruby a handful of times, so my comment might be ignorant. But other than community , what does ruby and ror do better than say elixir & phx, i feel like the latter is leagues ahead simply because nothing can compare to the beam platform for soft real time systems, you have fault tolerance, nifs, actor model , you can have millions of processes running at the same time for cheap, easy to reason about concurrency , fp makes code concise imo, otp, the beam gc doesnt stop the world etc I just think on paper phx is superior thanks to the beam platform

That being said use what you like and hotwire native sounds cool will give it a try. I also think the author of the blog shouldve went a bit deeper with his points

ed

4 months ago

> He's also implying that Rails does not use web sockets to communicate with frontend which is not only wrong it should be evidently wrong to anyone who built a Rails app in the last 3 years.

I’m actually a rails dev but I’d reach for phoenix if my app required a large number of persistent sockets (e.g. high-volume MCP servers). I say this mostly because the hosting story is better for phoenix (gigalixir) than rails (heroku, or similar services that run behind a request router). Of course if you want your own infra this argument doesn’t apply. But a $100 gigalixir box can easily serve 100k persistent connections — even a few thousand persistent connections is a non-starter on Heroku.

bostonvaulter2

4 months ago

> He's also implying that Rails does not use web sockets to communicate with frontend which is not only wrong it should be evidently wrong to anyone who built a Rails app in the last 3 years

Where is the article saying that? I only see " Those things are possible in Rails and Laravel, but they take a bit more effort to set up." which is a very different (and more nuanced/personal take) then what you're stating.

akarshc

4 months ago

That’s a fair take, rails with hotwire is genuinely powerful, especially with hotwire native. but the post wasn’t about claiming phoenix is better, it’s about how liveview’s model (server driven state, process isolation, lightweight channels) fit a specific use case. both ecosystems solve similar problems differently, rails leans on conventions and progressive enhancement, while phoenix leans on concurrency and fault tolerance from the beam. at the end of the day, it’s less about which is superior and more about which workflow clicks better for what you’re building.

ammanley

4 months ago

Bit of an tangent, but I remember hearing about Hotwire Native a while back, and then relative silence. Can I ask how your experience has been with it, and the level of support/documentation/features for the kind of mobile apps you've been building with it?

gregors

4 months ago

The problem is the websocket implementation (last time I tested it) sucked. I'm assuming even now if you're doing non-trivial websockets you need to use the node or golang implementation.

jherdman

4 months ago

> But I still needed background jobs, real-time updates, and two-way communication that just works. Those things are possible in Rails and Laravel, but they take a bit more effort to set up.

I'm pretty sure this isn't true at all with Rails. Out of the box you get Solid Queue (jobs), and Solid Cable (real time messaging).

akarshc

4 months ago

All the things are possible in rails as well. it is a beautiful framework, but it is so much easier to use with phoenix. Do try it out

sergiotapia

4 months ago

Take it from someone that uses both systems in production, they are not equivalent. Oban is leagues easier to use and obvious than Solid Queue. Solid Queue has no easy way to rerun a successful job, in Oban you can just update some dumb table columns and done, the Oban supervisor will sniff it out and workworkwork.

Solid Queue has a ton of database tables. Oban has `oban_jobs` and `oban_peers`. Oban just runs, simple on the same app. Solid Queue you can do that but it requires reading a lot of obscure blog posts and changing the settings. No sane defaults.

Just as a whole the Erlang and Elixir primitives allow oban to be built truly in the most retarded, obvious way and get away with it. It's wonderful to use as a dev.

Solid Queue I'm bearing because I get other stuff I need from Rails.

tvink

4 months ago

Solid cable is quite a bit of setup though,compared to Liveview. The way LiveView manages the rendering for your is leaps ahead of how actual rails SolidCable development feels.

ryanrasti

4 months ago

I share the OP's enthusiasm for Elixir, but as the CTO of a startup that ran it for three years in production, our experience was a mixed bag as the codebase grew.

The core promises of the BEAM (concurrency, fault tolerance) absolutely held up. Libraries like Ecto and Oban are world-class, remote `iex` is a lifesaver in prod, and the talent pool is exceptional.

However, developer experience (DX) was our biggest bottleneck. At our scale of 300k lines of code, the pain points were sharp:

* Compile times: A one-line change could easily take >10 seconds to compile in dev, constantly shattering flow.

* Tooling: ElixirLS was a coin flip. Unreliable autocomplete in a large codebase meant constantly grepping for function names and schema fields.

* LiveView: It wasn't a fit for our complex UI, which required a lot of client-side interactivity, forcing us to build a React frontend. This introduced the exact split-stack complexity (GraphQL overhead, context switching) LiveView promises to fix

I wrote a full retrospective for anyone considering the stack for a long-term project: https://ryanrasti.com/blog/elixir-three-years-production/

Alifatisk

4 months ago

> Compile times: A one-line change could easily take >10 seconds to compile in dev, constantly shattering flow.

Has anyone else experienced this? I've mostly read comments on how good Elixir is and if you are a Rails user you will only benefit more from Elixir. This is a bit surprising

auraham

4 months ago

Can you elaborate on how React was a better fit than LiveView for your use case?

In my opinion, the main drawback of LiveView is that we assume that the user do no click on the Back button of the browser. In other words, if the user changes the page by pressing the Back button, then Phoenix closes the socket, creates a new one, and the state is lost. I really like LiveView but not sure how to persist the state between page reloads without using Ecto (also, not sure if that is idiomatic).

klecansky

4 months ago

I had a similar experience when learning Elixir. I really like the language, but I ran into a lot of issues with the LSP not working properly. It might be because I’m using Windows with WSL, but I’m really looking forward to the new official LSP (https://github.com/elixir-lang/expert), and I hope it will make things better.

akarshc

4 months ago

Absolutely, any frontend, LiveView or React, can get messy if not carefully maintained. As the app grows and more developers contribute, regular code reviews and removing unused logic are essential, otherwise DX suffers just like in any other framework. I also agree there is still so much room for improvement in this space.

gregors

4 months ago

As someone who did Rails professionally for a very long time, Phoenix/Elixir is now my default stack.

Possibly the one thing that Rails still does better is generating quick throw away CRUD apps with their generators. Rails is still pretty much flawless in that regard. That beings said, when things mature and complexity grows Phoenix/Elixir is definitely the better all around tool.

nasmorn

4 months ago

I think LLM have really closed that gap. Quick throwaway stuff can be generated in a couple of minutes. But phoenix gives me back all the control in cases I care.

x0x0

4 months ago

why / what do you find works better?

schultzer

4 months ago

A lot of people tend to flag Elixir for its size and rightfully so, but the community is trying to punch above it’s weight with SOTA libraries. As an old developer once told me: less is more. https://github.com/elixir-dbvisor/sql

nasmorn

4 months ago

OTOH JS is too big for my taste. Everything has 10 implementations with no consensus about doing things. So everyone chooses their own horrible menu. Like an American super market. Or you go full chain restaurant with whatever Vercel pushes currently

uka

4 months ago

> First things first, why do we code? To solve problems in the most optimal way possible.

I admire the enthusiasm. As a person who codes just to solve problems in a good enough way - I assume I should stick to Rails.

kolme

4 months ago

I had to laugh out loud when I read that sentence.

Really? I write code to pay my bills and sometimes just for fun.

Trying to do everything "the most optimal way possible" is going to get in the way of actually getting stuff done.

"Why do we code? To prematurely optimize all the things".

akarshc

4 months ago

Rails is awesome!

cantor_S_drug

4 months ago

For those who want to experience the strength of Elixir, they should watch all videos of Saša Jurić on Elixir.

duckydude20

4 months ago

iirc he wrote elixir in action. also. really good.

dimitrisnl

4 months ago

The post is mostly about Phoenix LiveView, while the title makes it about the framework.

To be honest one of the reasons I don't like Phoenix is that even if I opt-out of LV in the generators, I still get a lot of LV code.

causal

4 months ago

Yup - an important distinction that wasn't obvious to me when I first jumped in. LiveViews are very opinionated and generate a ton of boilerplate. Not always a bad thing, but Elixir is elegant because of how spartan and expressive the code is - LiveView is kind of the opposite IMO.

hoppp

4 months ago

+1 to Elixir. The entire erlang ecosystem is great and Elixir allows devs who don't have time to learn Erlang to leverage it.

One of the best languages for startups who want to design scalable software from the start

exabrial

4 months ago

The Elixir live view model to me look like one of the only sane programming models for modern web development right now... Otherwise your best choice still remains to be server side rendering.

dismalaf

4 months ago

> Otherwise your best choice still remains to be server side rendering.

?? Phoenix Live View IS server side rendering...

mcdow

4 months ago

I really want to choose Phoenix, but I can't get over the fact that LiveView is front-and-center. The whole web-socket model just seems so brittle to me.

lawn

4 months ago

Although I agree that LiveView sucks up too much air in the ecosystem, you can just ignore that and develop web apps the standard ways of you want.

fareesh

4 months ago

liveview feels a bit too magical

client disconnects, state desyncs, then reconnects, then liveview figures out via crdt and other things how to accurately diff the state

feels like i have to trust it too much - i'd have a lot more confidence if people were vocal about how they are running it at scale, battle-tested etc. etc.

shopify is straight up yolo running rails edge, which is a crazy endorsement

dizhn

4 months ago

I watched a few demos and it is clearly magic and I was very impressed. Though I can't picture how a more standard run off the mill web app would be built with it.

user

4 months ago

[deleted]

andai

4 months ago

Interesting article, but I had to scroll all the way to the bottom to find what you actually built. I consider this important information, because the right tool for the job will depend on what the job actually is!

(Although I must say the advantages you listed — a strong compiler, concurrency, reliability — do sound universally good.)

It would have been interesting to see the specific problems you had when building specific features, and how the unique advantages of this stack helped you solve them.

huqedato

4 months ago

The tragic part that all my 'corporate' customers don't even want to hear about Elixir. For them only JS, Python, C# and Java exist in this world. Any other stack is either "unacceptable", "unsustainable", "exceedingly expensive" or "unmanageable". In 7 years of using Elixir I couldn't impose it in any corporate project, used it only for hobby/personal/indie stuff.

Supermancho

4 months ago

Almost 20 years after I bought my first Erlang books, I would never recommend Erlang OR Elixir to anyone but a senior dev who likes coding on their own and want to try something different. This pool is almost 0 people, since I was someone who wanted to play with it. I found the juice not worth the squeeze, in time investment vs capability. The build system alone is enough to throw most people off.

dasil003

4 months ago

In the corporate world ecosystem and fungibility of programmers are the top priority. The only way Elixir will get traction there is by Elixir companies literally growing to Fortune 500 size and showing the language/ecosystem is viable at that scale. Even then I doubt the advantages of Elixir will move the needle for that type of company because once you scale up the challenge is 99% people, teams, and communication; the elegance and efficiency of the code and ops don't matter much in those types of environments.

djcoin

4 months ago

I'm always curious about C# because it seems to be fast, feature-full, not too much bloated, etc. I'm an elixir dev/fan, but what's wrong with C#? How would Elixir shine compared to it?

bitbasher

4 months ago

Sounds like you need to sell it better ;p

rkangel

4 months ago

Oban is great, but for most cases you don't need it. In languages with a less good concurrency model we are used to needing some form of library or system to manage "background jobs", but in Elixir you can just spin up some GenServers under a supervisor to do work. Start there and only use Oban if there's some form of consistency/resumability guarantee that you need.

cultofmetatron

4 months ago

> Oban is great, but for most cases you don't need it.

7 years in on an elixir startup that has well over a thousand active paid accounts using our system every day to run critical businesses. I have to politely disagree.

USE OBAN from day one for any kind of background jobs. do not trust genservers. they lose their state if a pod goes. There's no retry logic built in.

> Start there and only use Oban if there's some form of consistency/resumability guarantee that you need.

oban is easy enough to integrate. it takes like 10 min of your time and you get a LOT out of the box. use genservers if you're running ephemeral servers but if you are creating background tasks, absolutely use oban for anything you plan to put on production.

Oban is such an easy value proposition to justify. consider it as important to learn as core phoenix

parthdesai

4 months ago

With GenServers, what happens if you pod/machine crashes? You lose all the unprocessed jobs. Oban gives you safe retries, and guarantees consistency. If you're using a relational DB, I would infact suggest to start with Oban, and then take a look at the jobs and see if you are okay with losing jobs and move to GenServers.

paradox460

4 months ago

For a startlingly large number of use cases, you don't even need to go that far; the built-in task system can typically cover almost all the use cases you'd reach for simple background processing, and exposes an interface very similar to the promise interface in other languages

itbeho

4 months ago

I haven't found Oban difficult to work with and it has the added benefit of ensuring your jobs are run only once. There is also the cron functionality that I find really useful for scheduling.

dev_l1x_be

4 months ago

These "why I chose articles" can be summed up adding: because I like it more and I cherry picked some facts for justification.

adamors

4 months ago

Exactly, this is all blogspam at this point. Ignores all the features available in Rails so he can pick Elixir/Phoenix the “winner”.

righthand

4 months ago

I am curious how much longer NextJS will last considering it is a lock-in vehicle for Vercel.

However as far back as I can recall it’s shift onto the dev stack was less about “is it a good framework” and more about “this framework can help Product org prototype faster”.

With the advent of Llms, will Product org even care about the dev speed for prototyping?

agos

4 months ago

the sentiment around NextJS is terrible, I have rarely seen something go from "oh this might be cool" to "stop pushing this badly engineering crap on me" so quickly. Yes, it's widely used and that's to be expected given the amount of money spent in promoting it, but it's not loved by any mean and I see this as a fatal flaw that they'll have to reckon with sooner or later. It's so bad that it worsened React's reputation by association - React already had some issues to care about, but they went in Next's direction, and people have noticed

Exoristos

4 months ago

There's absolutely no reason to use Vercel. I've always run Next on our own servers, for multiple clients and some very complex projects. Page Router or App Router.

guywithahat

4 months ago

One benefit i found over rails was just some of the libraries were more modern. I'm not a backend developer, so maybe I'm just not skilled enough to know how to do these things, but I found rails libraries tended to be dated and missing more modern features.

Specifically I wanted to run both the API and website on the same server (since it was a small company), and with Rails the gem Devise didn't natively support both and while rodauth claimed to support both I couldn't get the build flag to work. With phoenix it just worked out of the box with the most popular libraries, allowing me to move on without becoming an expert in backend frameworks. I agree with most everything else the author said too, specifically about it being more performant and liveview allowing me to build more dynamic websites easily.

dismalaf

4 months ago

> the gem Devise didn't natively support both

Sounds like a Devise problem.

gregors

4 months ago

A lot of ruby gems have definitely seemed to suffer from brain drain the last few years.

It's worth noting that the creator of Elixir was also an author of Devise.

alberth

4 months ago

After Elixir announcing being "feature complete" a few years ago, and then Phoenix going down the LiveView path for quite sometime ... I feel like the Phoenix/Elixir stack became less exciting to me.

Hope to be wrong though. Erlang based systems are really interesting and under appreciated.

toast0

4 months ago

> I feel like the Phoenix/Elixir stack became less exciting to me.

Isn't that what's supposed to happen? It's not really fun to build on top of an exciting platform. Boring means if I build it today, it's likely to continue working for a long time. I've always got more to do than time to do it, so having to rebuild everything all the time because of underlying excitement is not by idea of a good time.

user

4 months ago

[deleted]

recroad

4 months ago

Can you explain more? What became less exciting and why exactly?

nowaymo6237

4 months ago

As much as I love node and typescript i am forever bummed it never achieved a railsy or Laravellian framework

akarshc

4 months ago

True, the closest thing i like in the node.js backend world is nestjs. It’s a solid framework for building apis, but as an mvp framework, it’s not quite on the same level as laravel, rails, or phoenix.

Exoristos

4 months ago

I used to feel the same way, but at a certain level of Node.js experience I came to prefer the backend JavaScript idiom. It's much lighter and more pragmatic, and gives the knowledgeable engineer a lot of flexibility. So stick with it.

purplerabbit

4 months ago

Have you checked out t3 stack? Curious which pieces are missing from that that you'd deem critical

phplovesong

4 months ago

Anything PHP and you going to have bad time once you need concurrency. This time will come sooner or later.

misiek08

4 months ago

The best, most popular serverless platform? There are stacks much worse than PHP, like JVM for example ;)

It (JVM) is getting better lately, for example with virtual threads, but still in same resources you can handle much more traffic via PHP and it can be hosted virtually on every hosting!

tr888

4 months ago

Not knocking the choice but:

> I still needed background jobs, real-time updates, and two-way communication that just works. Those things are possible in Rails and Laravel, but they take a bit more effort to set up.

These all have first class support in Laravel out the box.

agos

4 months ago

do real time updates and two way communication work out of the box with a cluster as well?

benterix

4 months ago

It's a pity the author didn't decide to offer a trial without attaching a credit card. I get it, we had these discussions here many times. But as a person that could potentially subscribe, I'm baffled at the choice.

You could argue that I'm not really willing to subscribe if I'm not willing to provide my CC details yet. But it doesn't work this way. Before I subscribe to a new service, I really like to know it well, to have a kind of emotional relationship to understand what it is giving/saving me. "Give me you CC or get off" makes me not even want to try.

cpursley

4 months ago

Not everyone has VC funding where profit does not matter.

akarshc

4 months ago

you can opt in for a 3-day free trial without needing to add a credit card after signing up.

PhysicalDevice

4 months ago

The functioning of the app reminds me of Rails. I really think Rails is awesome but sadly despite the fragmentation JS ecosystem is still superior. SPA style with client side routing is just extremely fast and creates pleasant to use apps.

For example, https://blueapex.pro i built this with client side routing. And with TS types end to end client and backend I think Node.js coupled with React are effectively the best way to build modern web apps.

badosu

4 months ago

Working with Phoenix, and even more so Elixir and OTP, has been a great joy at a similar to almost the same level I had when transitioning from DotNet to Ruby in 2010 for my experience.

There are still some rough edges, and the job market might be more challenging, but overall I feel anything Elixir related at the moment provides for a high quality filter - both in terms of job opportunities and teams as well as the general product development experience.

causal

4 months ago

I have been pretty happy with Elixir - the syntax takes getting used to, but I'm usually impressed by its elegance.

Phoenix I'm mixed on - it has a few things that "just work" and I'm happy about, but being an opinionated framework I find myself bumping into those opinions the more I want to do things my own way. Usually there's an escape hatch, but being new to both Elixir and Phoenix it's not always obvious to me how to do things when the happy path fails.

magdyks

4 months ago

My biggest problem with Elixir is the lack of support for 3rd-party libraries and the small community. I love the idea of it, but every time I try to ship a real project in LiveView, I'm left feeling like the community is not that mature. Maybe coming from a Go backend React frontend stack, that might be the case, but maybe for quick CRUD apps, it's great.

dpflan

4 months ago

Elixir is pretty "nifty", and has Rails feels. I have worked on and seen its performance compared to scaled up Rails application. The BEAM / OTP is a very cool system to program on top of. I think it would be a great underlying system to develop a consciousness for AI systems with its concurrency paradigms and message passing, node connecting, other builtins. I'm not sure if the AI/ML focused Elixir projects like Nx have really taken off, but again, an Elixir based system that accepts numerous connections, passes messages around like exciting synaptic communications between functions... it just seems cool, maybe just on paper...

biql

4 months ago

Just curious, what libraries did you miss in particular compared to Go?

brap

4 months ago

Doesn’t the LV approach suffer from latency issues?

If I understand correctly all state is managed by the server, which means even the most trivial UI interaction needs a roundtrip. Not to mention the cost of managing the state and connection of every client. So how does that work in practice?

lawn

4 months ago

In practice it's mostly fine actually.

But yes, for interactive elements it's not optimal. They have some JS helpers for simple things but you may need to drop down to JavaScript hooks yourself if you want do better.

I've been playing around with Hologram, which transpiles Elixir to JavaScript. It's very early days but it has the potential to be a much better solution than LiveView.

https://hologram.page/

akarshc

4 months ago

latency is minimal because liveview sends only dom diffs, not full page updates. most interactions feel instant. each connection runs as a lightweight beam process, so managing per-user state scales efficiently. for very high-frequency ui updates, some client-side js may still be needed, but for forms, lists, modals, and live updates, liveview is smooth and responsive.

mountainriver

4 months ago

In the era of vibe coding just use the fastest servers. I wrote my last api in Rust and it wasn't any harder than anything else, it's wicked fast and stable.

After doing that, it seems a lot of the higher level languages will go away soonish

ahnick

4 months ago

curious what your process was for hardening your API for security? or is that still a pending step?

hu3

4 months ago

I'd rather fix AI slop in simpler languages, thank you very much.

And by the time performance is a startup's concern in majority of cases, they would have to rewrite most of the code anyway, including critical parts, so why not start with a language that's easier to find developers?

bluerooibos

4 months ago

I'm taking one look at Elixir and I'm not sure how it's supposed to be an improvement from Ruby? The readability and syntax seems to be a step backwards, so I'll stick with Ruby/Rails, thanks!

user

4 months ago

[deleted]

habibur

4 months ago

Last I checked, Erlang strings were represented internally as a linked list of integers, one int for every character.

That worked, but I felt like not every efficient, as web is very text heavy.

Has that changed in the later versions?

finder83

4 months ago

I believe that's still true of Erlang, but Elixir has UTF-8 encoded strings. In practice the only time you need to use Erlang strings from Elixir is if you're using an Erlang API.

waynesonfire

4 months ago

Both Erlang and Elixir support two types of text representations.

The first is a linked list of Unicode codepoints (also called a character list or a charlist for short). In Erlang, this is written using double quotes. For example, "abc" in Erlang is actually the list [97, 98, 99]. In Elixir, the same representation uses single quotes: 'abc' is a list of integers.

The second is a UTF-8 encoded binary. In Erlang, this is written using the <<"abc">> syntax. In Elixir, double quotes represent UTF-8 binaries, so "abc" is a binary.

So:

Erlang "abc" = list, <<"abc">> = binary

Elixir 'abc' = list, "abc" = binary

For efficiently handling textual data, Phoenix extensively utilizes iolists (https://hexdocs.pm/elixir/1.15.8/IO.html#module-io-data) to eliminate copying. It's used in performance critical areas such as generating http responses and template rendering. In general, on the Erlang VM, iolists are a first-class, widely used data structure for efficient I/O.

zerr

4 months ago

In Elixir it's bytestring.

throw-10-13

4 months ago

Author should read the rails docs again, seems like they missed a lot.

akarshc

4 months ago

true, there’s always more to learn. i just shared what worked best for my use case with liveview. rails is also a great framework and i enjoy using it, but liveview’s built-in real-time updates and state management fit my project needs better.

Jnr

4 months ago

All good, but did you know that Next.js is a full stack framework? You can have backend and frontend in the same code base. You don't need Laravel if you use Next.

rvitorper

4 months ago

Next.js is still missing lots of backend stuff. Background jobs, cron jobs, queues, etc.

FredPret

4 months ago

BEAM / Erlang / OTP / Elixir feels different:

- no JS (well a tiny bit ships with Phoenix but I never have to look at it), no NPM, nothing that breaks every week

- the whole system lends itself to executing on multiple cores

- GenServers BEAM processes in general are amazing

pier25

4 months ago

> You don't need Laravel if you use Next

But you do need to solve a lot of stuff that Laravel already solves for you.

akarshc

4 months ago

that’s true, next.js does a great job offering a full stack experience. the difference with phoenix is that it’s built on the beam, which gives you concurrency, fault tolerance, and real-time capabilities out of the box. liveview also lets you build interactive frontends without managing separate api layers or client frameworks, keeping everything unified and fast.

longnighthn

4 months ago

This artile seems like AI generated, with vague content and , at least `Oban` is not phoenix build in: its a 3rd package.

akarshc

4 months ago

Thanks for your feedback! Yes, Oban is a third-party package, but it’s built for Phoenix, which is what I meant in the article. Also, the article is not AI-generated. I’ve mentioned the app I built with Phoenix at the bottom to give context from real experience.

jonathan920

4 months ago

What matter most is having enough code out there for ai model to learn and study it so people can build with it.

benzible

4 months ago

Chris McCord directly addresses this in his recent ElixirConf talk. There's a threshold amount of training data needed for LLMs to work well, and Elixir more than clears it. Beyond that threshold, having more data doesn't make a tremendous difference. This means the "frustration gap" for newcomers essentially disappears - people who heard "Elixir is good" can now just ask an LLM to build something and start immediately, easing their way into understanding functional programming paradigms in order to be productive. I use Claude Code daily for Elixir development and it understands the language perfectly. The real strategic advantage is that while other ecosystems scramble to solve agent orchestration problems, Elixir/OTP already solved them decades ago. Lots more here: https://www.youtube.com/watch?v=6fj2u6Vm42E&t=1321s

dismalaf

4 months ago

> It’s way ahead of both Rails Hotwire and Laravel Livewire. LiveView communicates through WebSockets

Where's the facepalm emoji?

Rails Hotwire uses websockets... The research done here seems to be so basic it literally missed something written on hotwired.dev's landing page, albeit it's mentioned far down enough you have to scroll a teeny tiny bit (half a page on my screen)...

Rails also has background jobs and all the other things considering Phoenix is modeled after Rails.

akarshc

4 months ago

You’re right. Hotwire (specifically Turbo Streams) does use WebSockets under the hood when available. And yes, Rails has background jobs, ActiveJob, and other robust primitives that Phoenix was inspired by.

That said, the key difference is not whether both use WebSockets, but how deeply integrated and unified the real-time model is in Phoenix. LiveView is not a separate layer bolted onto traditional Rails views. It is part of the core rendering lifecycle. Every UI update, state diff, and event is handled natively within the same process, leveraging the BEAM’s concurrency and fault-tolerance.

In Rails, Hotwire sits on top of the request–response model, giving you partial reactivity without rearchitecting how views work. It is elegant, but still a composition of multiple layers (Turbo, Stimulus, ActionCable).

Phoenix LiveView, on the other hand, was designed from the ground up around real-time stateful components, which leads to fewer moving parts, no client-side JS framework to maintain, and native process isolation per connected user.

So while they share concepts, the philosophy and architecture diverge. LiveView feels closer to a full reactive runtime, not just HTML over the wire.

P.S: I do love rails

sodapopcan

4 months ago

Ya, this was not worded well at all (and more likely just not well researched (in the article, I mean). The difference between hotwire/livewire and LiveView is that with LiveView you get a "live" connection to persistence BEAM process which comes with benefits like not having to rebuild things (like the current user) on each request and storing ephemeral state on the server (if you need it). Of course there are trade off like PWAs are not fun in LiveView (you likely just wouldn't do it, I never have).

dpflan

4 months ago

The author is a self-professed front-end developer according to LinkedIn, which may be influencing experience with backend systems and functionality. I was wondering really why this terse post is sky-rocketing to #1 today, hopefully we get some good discussion from the community.

Rover222

4 months ago

Yeah I feel like most devs still think of rails as it was about... 8 years ago.

andersmurphy

4 months ago

Websockets are the wrong choice. SSE is the way to go. That or your own UDP protocol.

ninetyninenine

4 months ago

I can see why elixir over rails but do you guys know about type checking?

jbverschoor

4 months ago

Until you realize you're reimplementing Rails :)

ch4s3

4 months ago

Having done both for years, I can say confidently that you can use Phoenix without recreating Rails. The differences are important, and IMO Ecto is a much better approach to interacting with a database than ActiveRecord. I've also never seen a bug in my application due to upgrading Ecto, and I definitely can't say that about ActiveRecord.

cweagans

4 months ago

The product that OP is building is a todo list. Rails or Laravel would have both worked just fine. Elixir/Phoenix are neat technologies, but I get the sense that this decision was primarily "because I want to" rather than any particular selection methodology (which is fine - you do you, OP).

akarshc

4 months ago

It’s not just a simple todo list. The product includes advanced features like goal tracking, minimal project management, a streak system, daily task resets with a 3-task limit, and AI-powered task creation that can break tasks into subtasks. Users also get individual profiles to share streak progress and build habits. On top of that, we’re working on additional features like adding team members to projects and real-time collaboration. While it’s certainly possible to build these in Laravel, implementing them is not as seamless or straightforward as it is in Phoenix.

zerr

4 months ago

Why not Crystal and one of its web frameworks?

etaweb

4 months ago

I worked with Elixir/Phoenix for over 3 years, and I recently started to learn Crystal, mostly to create CLI apps or other programs where I want to create a simple executable binary. I wanted a more expressive language than Go, and easier than Rust.

Out of curiosity, I took a quick look at some of the web frameworks available, they are interesting. Lucky's Components looks pretty good, but I still prefer Phoenix's Components because the syntax make it very close to raw HTML. Compilation is not incremental and is single threaded which means I have to wait at least 5 seconds every time I make a change (this was on a minimal project). It's not that bad, but compared to Elixir/Phoenix where it's almost instantaneous, it makes a difference.

Still, Crystal is an awesome language, and if for one reason Elixir was not a choice for a web project, I would definitely consider a Crystal framework.

auraham

4 months ago

Another advantage of using Elixir/Erlang/Phoenix is high availability. If one client/incomming requests is taking a lot of time to complete, other users are not affected. We can even inspect the system in real time via iex. Please search for "The soul of Elixir" in YouTube, Sasa Juric explains this. Highly recommended.

mbesto

4 months ago

Great. Now tell me how you plan to scale a dev team who all know Elixir?

agos

4 months ago

by hiring people without the expectation to be already proficient in it, as long as they are willing and capable of learning it in a reasonable time

sph

4 months ago

If the only metric you care about is "scaling a dev team", use JavaScript. You're welcome.

akarshc

4 months ago

I guess hiring a developer who knows rails or even laravel can easily pick up with phoenix.

lawn

4 months ago

1. Hire good developers

2. Teach them Elixir

3. Profit