5 ms·
I love elixir, but I feel like there’s something off about the focus on reliability and error handling. At least for web applications, it’s pretty boring the id
by killthebuddha 3y ago
I love elixir, but I feel like there’s something off about the focus on reliability and error handling. At least for web applications, it’s pretty boring the idea that a single error won’t take down the entire system. At worst, a single error might take down an entire process, but that’s really not that terrible. Also, error handling code that is not colocated with the logic that threw seems like a mess. Error handlers have to decide whether we can recover and whether we need to report the problem, and that doesn’t really change just because an error won’t bork an entire system. IME error handling is mostly about deciding what is best for the user.
What I love most about elixir is the ridiculously dead-simple vertical scaling. A close second is The World’s Best Take On ORMs (aka Ecto).
- Jtsummers 3y agoDo you mean horizontal scaling? Throwing more machines and cores at your system and distributing work across additional nodes?
- ricketycricket 3y agoBoth vertical and horizontal are pretty simple with Elixir and are done in essentially the same way.
- Jtsummers 3y agoAlmost every system scales simply vertically, vertical scaling is (to a first approximation) throwing faster hardware at the problem. If you're IO bound you get a faster IO bus (this is not necessarily easy to do, but if you do it the system scales to the limit of it). If you're CPU bound you get a faster CPU. And so on. Horizontal scaling is what's hard for a lot of systems, but simple with Erlang and Elixir since they are, by design, meant to support concurrent and distributed workloads. That's why I was asking if they meant horizontal and not vertical. Erlang and Elixir are not uniquely easy to scale horizontally, but they are (if you don't fight their nature and produce programs that consist of one giant execution thread) ridiculously easy to scale horizontally by tacking on additional CPU cores or physical CPUs.
- evadne 3y agoWhatsApp did a lot of work in this area, and I would encourage folks who are interested to seek out information related to that. 2014 - https://www.infoq.com/presentations/whatsapp-scalability/ https://www.infoq.com/presentations/whatsapp-scalability/ There is also Lasp, which is very interesting: https://lasp-lang.readme.io/docs https://lasp-lang.readme.io/docs
- killthebuddha 3y agoI think it makes a lot of sense in theory to consider adding CPUs as horizontal scaling, but in practice I'm not sure it makes sense. Moving your app to a machine with twice as many CPUs is more like moving it to a machine with twice as much RAM than it is like doubling the number of machines your app is deployed to.
- ricketycricket 3y ago> Almost every system scales simply vertically, vertical scaling is (to a first approximation) throwing faster hardware at the problem. If you're IO bound you get a faster IO bus (this is not necessarily easy to do, but if you do it the system scales to the limit of it). If you're CPU bound you get a faster CPU. And so on. My interpretation was vertical scaling is within a single node and adding cores or CPUs to a single node is vertical. Multi-core and multi-node really present similar problems, so adding more cores or adding more nodes isn't terribly different from a design perspective. > ...easy to scale horizontally by tacking on additional CPU cores or physical CPUs. If you define adding more cores to a single machine is actually horizontal scaling, then we agree in principle, just not in the definition of scaling.
- sph 3y ago> Almost every system scales simply vertically Not true in practice. You can scale hardware easily to hundreds of cores, if your app is able to spread the load, but the performance ceiling is very low if your app is single-threaded. The BEAM with its design is very parallel, and the more cores, the happier it is.
- killthebuddha 3y agoI meant vertical scaling, but it sounds like our understanding of vertical scaling is different. My framing is "horizontal scaling = more machines, vertical scaling = more powerful machines". I guess one way to think about it is that Elixir makes scaling the number of cores a strictly vertical kind of scaling.
- Jtsummers 3y agoYeah, additional cores is a fuzzy area. That's why I asked. Elixir takes advantage of additional cores trivially, so upgrading a CPU (how many people see vertical scaling) to have additional cores helps your Elixir workload. But it's doing that by distribution (more typically falls under horizontal scaling) across those additional cores. Again, it's fuzzy. When the world consisted of mostly 1-4 core CPUs it was easier to separate the two concepts because we didn't have the option of throwing 128 cores into a single server, we had to buy 32 to 128 servers to get that many CPUs.
- namaria 3y agoI've always assumed horizontal scaling implies a network interface between new sets of cores. That in my view would provide a very sharp definition.
- deleted 3y ago[deleted]