7 ms·
Why Elixir Is the Best Language for Building a Bootstrapped, B2B SaaS in 2024
- stanmancan 3y agoI moved from PHP/Laravel to Elixir/Phoenix about two years ago and I can't imagine using anything else these days.
- stanislavb 3y agoDo you have experience with Ruby on Rails? 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.
- dartos 3y agoWhat makes you say that? I think, once you learn both frameworks, they’re just about as productive as the other.
- throwawaymaths 3y agomaybe in the "writing code" dimension. I would much much rather maintain code in elixir.
- cpursley 3y agoI just don't understand this, the ergonomics are about the same. Phoenix was inspired by Rails and Elixir by Ruby, after all. I've also worked with both and I'd say it's a match in terms of productivity.
- dmix 3y agoI love Elixir and the productivity is probably real, but one big thing I've learned as a senior dev was reflected well in a recent HN post > Take the road most documented https://news.ycombinator.com/item?id=39165328 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.
- alberth 3y ago> Take the road most documented 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.
- gregors 3y agoWhen Shopify adopted Rails is was quite new technology though...So they literally didn't follow this advice. In fact the CEO was part of the Rails core team. Here's a talk in 2008 by the CEO about their caching issues https://www.infoq.com/presentations/lutke-rockstar-memcaching/ https://www.infoq.com/presentations/lutke-rockstar-memcachin...
- dmix 3y agoI've been using Rails since 2007 I'm familiar with what it was like back then. 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.
- thibaut_barrere 3y agoI also started using Rails a long time ago (circa 2005), and I have become older too (46 years now). 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.
- gregors 3y agoI've got in-depth experience with many Rails apps and quite a few Phoenix apps (and many other stacks). I used to agree with your opinion, though I think Rails no longer holds a massive edge. Phoenix is now just as effective at releasing real-world products especially run-of-the-mill web apps. And when things get complex after a bit of time (usually due to business logic evolving) - much more effective. 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.
- ericb 3y ago> On the other hand Phoenix destroys Rails in any realtime scenario. 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?
- karmajunkie 3y agoyeah, elixir is still going to destroy it at runtime. the concurrent story is even more important with the features you’re talking about and especially in that segment, it’s not even close.
- cultofmetatron 3y ago> I think Phoenix has something similar/ 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
- unethical_ban 3y agoWhat took you away from Louisville (laravel as my tts heard it)?
- stanmancan 3y agoI used it for 5ish years and never felt like I really understood the framework; there way too much magic going on. 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.
- TheCapeGreek 3y agoLivewire was rewritten once for V2 -> V3 iirc? 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.
- stanmancan 3y agoLaravel really forces you to do things the "Laravel way" and as soon as you try to step outside that box you run into tons of headaches along the way, and upgrades become painful. I haven't found that to be the case with Phoenix at all. 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.
- pier25 3y agoHow does LiveView compare to LiveWire?
- stanmancan 3y agoLive View is SO much better it’s not even close. It’s faster, more reliable, easier to use, way less weird gotchas.
- pier25 3y agoSince you left Laravel about two years ago you only used LiveWire v1, correct? I haven't used it myself but apparently v3 solved plenty of weird gotchas.
- stanmancan 3y agoThe last Laravel project I used was using Livewire V2. 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.
- pier25 3y agoDo LiveWire responses get so big that the size becomes an issue? 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.
- stanmancan 3y agoLivewire has to send the full state of the request for the component. Search results is a good example where the state can start to get big. Once it hits the server re-hydrates the models. They are also HTTP requests which have some handshaking. 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.
- deleted 3y ago[deleted]
- karmajunkie 3y agoi have to be honest: as a lover of the language, and with due respect to the author, i’m really tired of these “why i picked elixir” takes extolling the same virtues (or some subset thereof) we’ve seen written up in darn near every introductory article on elixir for the last five or six years. 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?
- pier25 3y ago> but because the year and a half i spent reproducing functionality could have been spent adding new features What would you have used instead?
- Scarbutt 3y agoDoesn't matter much, really, as long as it's something with a big ecosystem.
- tomtheelder 3y agoI assume the original language of the codebase
- pier25 3y agoThanks I was distracted and didn't get that
- bnchrch 3y agoDisclaimer: Elixir is extremely productive, Phoenix is outstanding, the community is world-class, and as a result of the Erlang VM / OTP / Beam you can remove whole parts of your traditional webstack. If you haven't tried it I cannot recommend it enough. 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.
- Aeolun 3y ago> requires any kind of offline-enabled features Considering it requires a server this is kind of a given right?
- pdimitar 3y agoI am not your parent poster but I would interpret their comment as: If you need offline mode you are better off disabling / removing the LiveView machinery in your Phoenix project.
- cancan 3y agoI can't speak for Tyler (the author) but as someone who's worked with him and managed him for over 2 years, I'd say take Tyler at his word versus assigning malice to his writing. 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!
- elbasti 3y agoEndorse 100%. 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.
- tschellenbach 3y agoDjango and Rails are by far the best for small projects. It's not close.
- sho 3y agoI'd agree, for 95% of projects. If you are serving web pages, or implementing something that doesn't have a lot of server side work in between requests, then sure, pick Rails. 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).
- hansonkd 3y agoI love Elixir, but I have to disagree with the principal aspect of this post. 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.
- randrus 3y agoThat resonates. I’ve heard it this way: it’s not the language it’s the leverage.
- pdimitar 3y agoI am probably getting annoying as this is my 3rd such post in this thread but... have you posted a job ad in ElixirForum?
- hansonkd 3y agoYes, that is how I found the engineers I did find. I wasn't impressed by the applications I got, although who I hired was fun and talented. If I remember they were either engineers who's primary projects were actually erlang, high priced agencies, people who were elixir curious, or people have only made pet projects. 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.
- phendrenad2 3y agoYou know, you can get all of this in PHP and jQuery for probably half the effort.
- melon_taeppe 3y agothe django admin panel alone makes it a better framework for a bootstrapped app
- TheCapeGreek 3y agoIt's neat that Django has that, I've toyed around with it, but for rapidly bootstrapping internal tools I still think Laravel does it better with either Nova, or these days preferably Filament.
- weatherlight 3y agoPsst... Elixir has this too :) https://github.com/mojotech/torch https://github.com/mojotech/torch
- 3dpancake 3y agoI am really missing out on the Elixir hype. And Phoenix has liveview, so the htmx hype gets multiplied with the Elixir hype? 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.
- elicksaur 3y agofwiw Python also has pattern matching: https://benhoyt.com/writings/python-pattern-matching/ https://benhoyt.com/writings/python-pattern-matching/
- weatherlight 3y agoruby does too. its not remotely the same
- elicksaur 3y agoWhat are you saying isn’t the same? This is a very hostile, dismissive response when I was simply pointing out Python had a similar concept in the hopes it might help the person understand something they said confused them. 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.
- voidfunc 3y agoMeh, if you're not building your b2b SaaS company on one of the big names (python, Java, ruby, go, javascript) in 2024 you're just deeply unserious about running a company. The language is the last of your problems.
- calvinmorrison 3y agoHow did you miss PHP?
- voidfunc 3y agoJust forgot about it... Big 6!
- cultofmetatron 3y ago> you're just deeply unserious about running a company is this sarcasm? ecosystem matters for certain projects.
- firemelt 3y agoi still dont get it why people say elixir/phoenix is better than rails people said that since phoenix incarnation I mean we still got to so everything on phoenix meanwhile on rails we have gem for everything
- dbbk 3y agoMy current company uses Elixir so I've had to pick it up, and while I get the idea, man the compile times are just awful. Our full app takes a good 15 minutes to build locally. And I don't know why, but I've had so many times where the incremental build has become corrupt and it needs to rebuild everything. Coming from a PHP and Node background, I definitely miss the speed of development.
- dmix 3y agoThat does sound awful.
- Zababa 3y agoIs it worth it to learn Elixir (including Phoenix, and I would guess some Postgres) to be able to rapidly build websites? My day job is mostly Go microservices, making anything this way takes a lot of time and doesn't really feel worth it for single-person projects.
- MainlyMortal 3y ago[dead]