But!
As a long-time Elixir Developer who has gladly used it to bootstrap many applications and companies, I have to say I think this article is actively harmful to the community.
It's an extremely thinly veiled sales pitch for their "Petal Pro" paid boilerplate.
At the same time, it does nothing to address the tradeoffs of certain features like Live View. Which for the record is a poor fit if your app suffers from client-side latency or requires any kind of offline-enabled features.
He's a powerhouse of a developer, loves, LOVES the ecosystem and has always wanted to give back as much as he could. He's submitted patches to the core, he did so much for our Elixir CI and felt bad not giving it back via open-sourcing it and then blogging on our platform.
Tyler was instrumental in many of our technical decisions at our company, and I can confidently say nothing he made us buy was unnecessary, and he often worked very hard to save us the smallest bit of money.
Just my 2 cents!
(If that's not enough, you can dig in to the Petal Components repo and see I'm not a contributor.)
The pitch was just so direct, coupled with the perfect topic of "Want to build a SaaS? Use Elixir" I would have assumed you owned the paid boilerplate you discussed.
I unfortunately can't edit the post but I upvoted this in the hopes that people see it.
The lack of discussion about LiveView tradeoffs is one of the few things I actively dislike about the Elixir community: and I love elixir and reach for it for almost everything.
Considering it requires a server this is kind of a given right?
If you need offline mode you are better off disabling / removing the LiveView machinery in your Phoenix project.
As an engineering leader what I look for when picking tooling for SaaS which essentially boils down to two things:
1) How expensive and difficult will it be to scale the Org.
2) How difficult will it be to implement product features.
I attempted an Elixir startup and found that it failed at both. The language was lovely to use and very smart.But at the end of the day, you spend time and money reinventing solutions already solved in other frameworks which distract from the features of your product. Elixirs libraries are growing, but they have not reached parity to near drop-in solutions found in Django for instance.
Is Django the fastest in code execution? No. Is it the most elegant? No.
But there is an outstanding catalog of existing solutions and libraries out there that a junior engineer can pull from.
Developer velocity is so much faster with a well established framework. Easy to hire for. And you spend time implementing product features instead of reinventing engineering solutions. My ideal product development workflow is to implement in Django, find the bottlenecks (if any) and then specialize those flows.
Elixir is great and beautiful, but it was much more difficult to find engineers with experience in it. I really only found engineers that had a curiosity to use it or just started using it. I was never able to find an engineer that I could hire who built and scaled a Unicorn level app with it. Something quite common to find with Django.
I'm not saying to use Django. But when starting a project, I just ask that people look at how hard it will be to find someone to help you in the future and decide if you want to spend time building product value or spend time writing beautiful code.
Coming from a PHP and Node background, I definitely miss the speed of development.
I've built apps both with Elixir/Phoenix and with Rails. Yes, the Elixir/Phoenix stack is amazing and is definitely superior over Rails in several ways; however, with regards to Bootstrapping and releasing a real-world app/business (web based), Rails is still the king.
The place where I feel Rails still holds an edge is the massive amount of gems available, but hex is absolutely catching up and I'm only running into missing packages/libraries when I'm doing "weirder" things these days. The ecosystem continues to evolve for the better. On the other hand Phoenix destroys Rails in any realtime scenario. Maybe those edge cases matter to your particular project then again maybe not.
I think, once you learn both frameworks, they’re just about as productive as the other.
What forced the switch was using Livewire; cool idea but horrible performance, poor documentation, no support, and constant rewrites. Knowing it was based off of Live View I looked into that and there was no going back.
it’s not that i think they’re wrong, at all. it’s just that they add nothing new to the conversation, they’re superficial, and frequently don’t go on to give a reader any idea of how the decision worked out.
here, i’ll start: i rewrote my startups platform in elixir about six years ago and it was a terrible business decision. not because elixir was bad —to the contrary, it was fantastic —but because the year and a half i spent reproducing functionality could have been spent adding new features that would have translated to new customers, and that would have translated to an additional million dollars when we eventually sold our bootstrapped business (obviously if i’m quibbling about a million bucks im not talking about a venture backed business here.)
in terms of scratching my intellectual itch it was great, but i can’t defend it from a business perspective and whenever somebody brings up the notion of rewriting a core platform i tell this story.
now can someone please write some elixir articles about cool stuff they did with it and get those on the front page?
But if you do have something active running on the server - ingesting something, holding connections open, talking independently to other systems, anything soft real time - you will very quickly run into the limits of pure web frameworks and will be forced to re-invent all manner of wheels and end up building much more than you need to. That's where elixir shines and is, IMO, the optimum choice.
Phoenix is basically "rails for when you actually need something more than build the world/destroy the world web requests". It's great for that, and those kind of projects are more interesting IMO, too. But for anything else, use Rails (or, yes, Django).
This article provides a huge list of things you have to know for web dev. Certainly not all of them a required. And of the ones you will have to know to accomplish your task, you'll still have to learn the Elixir flavor of it.
My current job is rewriting what is basically a crud elixir app in python for a company. I'm not completely sure their reasons wanting it re-written, but they're spending money to do it, so they must have some justification. I have heard them mention difficulty in finding people to work on their existing codebase. A lot of companies they just want fungible (and cheap) programmers (like me).
I've really only bothered to learn enough elixir to reverse engineer the existing app for reference. I have no idea what good elixir looks like, and it could be that this is just bad elixir. Completely subjective, but it's not easy to follow. I had to work through some code where a bunch of functions were piped together, but all these functions were defined multiple times with different args (pattern matching on arguments). It seems like a strange way to do flow control within a pipeline, because the logic seems to really be spread around.
Maybe I have to sit down and write something from scratch to appreciate it.
is this sarcasm? ecosystem matters for certain projects.
people said that since phoenix incarnation I mean we still got to so everything on phoenix meanwhile on rails we have gem for everything
The freelancers I hired had Elixir experience from a previous job, but we ended up figuring out a lot of stuff together. It was harder to just hand off requirements and expect it to be done.
Granted my budget wasn't very big and I limited my scope to those within the Americas due to working hour constraints.
But it is very different from hiring for Python which is very easy to get a reasonably priced agency or freelancer with years of experience very fast.
Much easier to find a engineer who engaged with a large Python SaaS app than an Elixir engineer.
I’ve heard it this way: it’s not the language it’s the leverage.
---
I don't speak for anyone except myself and a few acquaintances but I wouldn't accept an offer to work on a startup with Elixir unless we're talking at least $15,000 a month or more. And even then it depends a lot on team and company culture. I am tired of sprinting without that ever being connected to me getting extra cash or even recognition.
Elixir and Phoenix are productive as hell but they also need deliberate approach and not everything should be done quickly. Requiring me to churn out 3-5 features a week in the first 6 months is the best way for me to hand my resignation a mere two weeks after starting.
Sorry, you might not have had this in mind, I am just reacting to your text.
But rest assured, ElixirForum has quite a few people who would grab an Elixir job if given the opportunity, some for as low as $2500 a month even. And most people frequenting the forum mostly check its own Jobs section. So if you really want to widen your options, definitely make a job ad post there.
This was the exact issue we encountered after I had switched a startup's backend from Node to Elixir. I was able to churn out features pretty quickly (and the switch itself turned the core batch job underlying the product from a multi-hour runtime to less than a minute), but the bus factor was pretty much 1 and we were never able to really increase that before the company ended up running out of runway and folding.
This was almost a decade ago, though, so things have hopefully improved somewhat.
[1] https://www.youtube.com/watch?v=HP86Svk4hzI
[2] https://dockyard.com/blog/2024/02/06/5-benefts-amplified-saw...
But it's good to be reminded I guess when new shiny things come across your sceen
Elixir is extremely overhyped, not because it’s not great but because most of the discourse is about how much better it is than other languages.
With Python, Rust, Go, and JavaScript I can find a ton of interesting projects and tools; tons and tons of examples of people doing interesting things, easily outweighing the language hype.
Elixir has a handful of core tools, tons of hype posting, and a smattering of introductory blog posts to those tools.
The community really has the appearance of lacking depth. (Granted I think partly that’s because the depth exists inside companies that don’t really talk about it)
Having said that, a single team of seasoned Elixir devs can achieve more/better things than 100 average devs using the usual SPA/API/microservices-JS hell with all that modern unneccessary complexity. Saying this as a former DevOps guy babysitting the mess of multiple of these teams before.
Another good thing about Elixir is that the odds of you actually needing 100 devs coding in it are close to zero. I've been in financial EU startups that moved tens of millions a month (they were not huge) with the grand total of 4 devs. The only problem was clearing up customer requirements (i.e. our product people dropped the ball and left us doing most of their work).
And expensive? Yeah but I wouldn't be against that if I was an informed business owner. Most Elixir devs are refugees from other tech stacks and are quite senior. Good talent should be compensated well.
Having worked at multiple unicorn+ SaaS products, the product feature demands are significant.
Yes if you have one sole feature that you can pour all your engineering resources into like whatsapp delivering messages then it makes sense you might get away with 2 Elixir devs.
If you are working at a unicorn who just raised $250m in founding and now has to deliver 100 new features this year... well the elegance of the language won't help as much as you think.
You'll never need 100 devs to work on a single elixir project. I as a solo dev built out the backend for my startup to profitable. We keep discussing bringing on a new developer during the occasional crunch but its been 5 years of operation and we haven't really needed it aside from increasing the bus factor. features go out fast enough as is. elixir is very productive.
based on my experience, if you need more than 5 developers, you should separate out features to independent systems and have them communicate with each other over established interfaces. Then you can use the language specialized to the task at hand. Either way, 100 engineers on a single codebase is not going to be efficient no matter what language you are working in.
That said, this article is about startup. the name of the game is to crank out features and aquire users. elixir is performant enough that you're not blowing your budget on cloud infrastructure and high level enough that you can build out and maintain your mvp with a skeleton crew.
If you run into a situation where you suddenly need to scale to 100 engineers, thats a great problem. it means you have revenue.
I don't think devs and talents are too hard to find, if you are willing to look and be flexible.
you just have to post where they are. i strongly recommend the newsletters, the jobs channel on the elixir slack, and elixirforums. all great resources.
We've had non senior people onboarded a few months and they are doing well with Elixir at the moment, fwiw!
you’re a solo developer rewriting the fundamental application your company sells and depends on for revenue? yeah, maybe not so much. (actually there’s no maybe about it. don’t do this.)
What would you have used instead?
i’d love to say you were correct, and if it was a tech acquisition you might be right. in our case they were acquiring our customers and goodwill primarily. the app was sunset a year later.
It is the Netflix playbook.
I dont know… we cant expect each article to expand on the previous article you read. i dont think article writers should scrap their article if it doesnt contribute some novel benefit. I think one additional article without new points simply emphasizes those existing points.
I mean, I get your fatigue. I just dont think there is any fault here.
Not that gods don’t make mistakes. But I kind of see where they’re coming from.
Yeah, rewrites are bad, especially as a startup.
Though I think the biggest filter were the US working hours. I think Elixir devs are much more in the EU.
And the OP presentation about ML is spot on in that regard :-)
I'll take quality of life over money any day, but I realize I'm in an extremely small minority.
Lovely language whose community and vm taught me an absolute ton that still resonates with me today.
But for a bunch of “cats” that need to be herded, engineers tend to be fairly packish in some regards so looks like it’s Go, Java, Typescript, and TypeScript/HTML/CSS(in JS)/React for the foreseeable future
Are we talking about parenthesis here again?
It's easy to understand a well written Lisp codebase once you are familiar with its concepts. What you can't do is try to read it when all your prior programing exposure is from, say, the Algol language tree.
Yes: https://aplaceofmind.notion.site/It-s-Lambdas-All-the-Way-Do...
As far as I can tell all three languages, Python, Elixir, Ruby, have pattern matching and the matching can set variables. Python’s has a “match” keyword. I’m not as familiar with Ruby, but I know it uses “case”.
I like Elixir’s the best because it’s not just what I would call a fancy switch statement. You can use it on single lines and in function definitions. Someone else might like a different form of pattern matching better. It’s just an opinion.
Elixirs pattern matching is the one thing I wish every language had from day one. Besides maybe an Optional/Maybe concept for error handling / data enclosures.
It makes for some very readable code and encourages passing return values that are easily consumed in a simple/functional way. Not capturing random error objects or unpredictable data structures.
Although I'm biased towards functional style, even though I code JS/Ruby for a living.
I'm glad you found something that works better for you, but I wouldn't say that not learning to use the framework (which you don't need to understand the internals for to use) automatically makes the other option better. It just means Elixir clicked for you better.
There's also lots of "magic" going in in Laravel behind the scenes and it can be pretty painful to try and figure out exactly why something happened.
Livewire was a mess over all. It had a lot of breaking changes along the way and performance was terrible for anything but the most basic tasks. The support was poor; the docs were alright at best, the screencasts were paid, and Caleb never showed his face in his own Discord, which was troublesome because there weren't enough people using it for the community to support each other. The weird bugs and behaviour were all over the place and the errors you received when you ran into one of them did nothing to help you track it down.
I guess to sum up my feelings: PHP was fine but Elixir did click better. Laravel is a black box and Phoenix is objectively a better framework.
for elixir books, i strongly recommend sasa juric’s elixir in action—it’s the best explanation of processes and genservers i’ve found.
> Take the road most documented
https://news.ycombinator.com/item?id=39165328
Rails likely has an advantage of documentation given its age and all the major mature businesses using it like Shopify.
A lot of newer languages have documentation/blog posts that's heavily centered around starting out with a new project vs all the bugs with existing Github issues/stackoverflows and design considerations of the framework and 3rd party plugins being fully fleshed out.
I don’t necessarily disagree with that statement.
But it can also lead you to use Java or C, because they are also massively documented & mature. And I don’t imagine that’s the desired outcome either.
Here's a talk in 2008 by the CEO about their caching issues
https://www.infoq.com/presentations/lutke-rockstar-memcachin...
I'm talking about 2024. I have a large tolerance for risk, and I'd be a risk taker for my own new projects or for a very early startup. Or if a tech offered something significantly new and better than the alternatives, like Rails did in 2007 vs PHP.
But now that I'm older, and I value getting things in front of customers with the minimum amount of bullshit. I'm not seeking out learning some fun tech purely for highs of a good fancy new language/framework (I've done that enough). I'd rather not chase down framework bugs. I want to google a bug and see 5 other people already had it.
I haven't used it myself but apparently v3 solved plenty of weird gotchas.
Not all of the problems were strictly "Livewire" problems, but also just the limitations of PHP. Having to send the state back and forward and rehydrate the state on the server on every request is just slow no matter what you do. Live View has an active process for every connected user that maintains state so you only have to send tiny little diff's back and forward.
Haven't used either LiveWire or LiveViews seriously. Honestly trying to understand what you're saying.
I was under the impression LiveWire only sent the data for the component being updated so realistically the main issue is latency (just as with LiveViews).
I mean, sending 0.1kB vs 1kB is 10x worse but in practice this doesn't seem like it would have a real impact in UX for the majority of use cases.
while thats usually true, it can also be a result of rapid customer feedback. what customers want might not be apparent till you put it in front of them. bad managers are one thing but if you're a startup, its more about responding to customer needs faster than the incumbent can.
But I must say I think there is not much bullshit, and quite a bit of stability, in what Elixir / Phoenix bring to the table (saying this after maintaining a production French state-owned service running on top of Elixir for more than 3 years now).
There are also not that much framework bugs, the level of retro-compatibility is huge compared to Ruby in particular (except for LiveView which is still a bit young, but the rest is ... quite stellar).
I quite find that I could use exactly your last paragraph to describe _why_ I wouldn't pick anything else than Elixir these days. The TCO is great, the maintenance story is remarkably stable at the moment etc.
Googling works decently well now with Elixir too, the community is mostly fairly responsive.
The Rails realtime story is going to be radically improved in Rails 8! I've been using the Turbo beta, and it is magical.
With 3 lines of code each, I made my index page, and show page live, and real-time updating.
I think Phoenix has something similar--perhaps it was the inspiration?
phoenix's channels (for realtime) is the only multiclustered websocket solution with long polling fallback that I know of that will scale to thousands of users out of the box. My startup uses websockets and its never been a bottleneck vs the headaches I've deal with doing similar stuff in nodejs. its just an absolute unit for doing realtime.
And now they have liveview which takes that and builds on it to accomplish magic.
rails has done great things but comparing it to phoenix on realtime stuff is like comparing a moped to an f16
Have you tested this? I ask because under the hood, Rails is using Faye, and Faye is using EventMachine.
About 10 years ago I load tested Faye vs. Node in a websocket scalability test for a websocket based chat app I was writing, that, funnily enough had a polling fallback. We had scalability needs up to around 10k or 20k simultaneous connections if I remember right and I wanted to know their ceilings before we wrote the real code and invested in either.
Faye kicked Node's butt on simultaneous connections and throughput. Node fell over while Faye was still going. Eventmachine, which Faye uses, can scale like nobody's business. It IS an F16.
Then there's realtime. phoenix channels is the standard. everything else is a janky copy thats issing one or more factors that make it so good. elixir users lightweight threads so there's less overhead per connection which means you can run WAY more connections on a single machine. Live view takes this further but allocating a persistent process per user on which state can be synced to the frontend without writing ay javascript.
ruby on rails has more and better gems when your'e starting out but once you get some traction, maintenance on an elixir app is much easier due to it being functional.
> Requiring me to churn out 3-5 features a week in the first 6 months is the best way for me to hand my resignation a mere two weeks after starting.
Live View only sends the diffs excuse the state lives in an active process on the server, and it uses web sockets which is much faster than http requests.
I built my startup in elixir.
having experienced all 3, I can tell you in real world perfrmance, the metaphor is accurate. if you're boostrapping a startup and you need fast, stable websockets. elixir is the GOAT.
What it has to do with Elixir is that Elixir does not scale well with a number of programmers, and many startups go through periods of explosive growth of personnel. With Elixir that very rarely works well, 99% of the time IMO it does not. Adding more people does not increase productivity, it hurts it even.
How do other languages, like Python, scale better to more devs, besides more devs available? All that comes to mind immediately is modules in Elixir being globally available, but I’m genuinely curios about your experiences.
Thirdly, Elixir devs are on average quite senior in general (as they are usually refugees from other stacks) which lends itself to one-man armies very well in my almost 8 years of experience working with Elixir.
We scaled an org with both Ruby and Elixir (later, 1 of the 2 blessed languages) and there was no tangible difference in that way.
You could also scale in other ways like microservice. Elixir plays great in that world, as pretty much every language does.
Regarding one man armies. Usual way I've seen to scale is to find those one man armies and put less expensive Jr + mid engineers on their team and have them work together. I don't think that's an Elixir thing though.
I'm not trying to sell Elixir here. I think it has benefits in smaller org size that mellow out and equalize as a company grows. Also, startups should always work in whatever language is most comfortable to founding team.
RE: microservices, yep, that's one of the ways to scale Elixir teams to more people indeed.
RE: one-man armies, agreed.
> I'm not trying to sell Elixir here. I think it has benefits in smaller org size that mellow out and equalize as a company grows.
No worries, I am sold for 8 years now. ;)
And yes, the benefits kind of plateau from one dev count and up I found. That was kind of the core of my comment, too.
> Also, startups should always work in whatever language is most comfortable to founding team.
Oh, absolutely. I love Elixir a lot but won't shill for it if I find myself in a situation where it would be a bad choice. Plus in startups development speed is probably the biggest asset of the programmers so I am not judging. (Though I don't want to work for startups anymore.)
Does stepping on each other's toes happen, of course! but no worse than typescript, java, etc.
I don't buy this argument.
There is also the fact that the companies I chose to work with didn't want a lot of Elixir devs and we truly made miracles happen with teams of 2 to 8 people.