How does BEAM handle system calls? If I have a million BEAM processes and each one calls stat(), what happens?
What do you expect to happen in other languages, when your program makes a million calls to `stat()`? Is that something that happens often? What kind of application needs that? Is there a language that solves this neatly? (I'm genuinely curious, independent of my newbie elixir evangelism)
The BEAM Has Spoiled Me
51–60 of 88 posts
Re: The BEAM Has Spoiled Me
#52Earlier quoted context omitted.
> I'd say 19 out of 20 engineers I've spoken to don't really leverage BEAM. That's because most tasks we as engineers write rarely have the need for distribution or parallelism. It's mostly "get data A, get data from B, mix, save resulting data C". nd when you need to do that in parallel, you through it in Kubernetes, or Apache Beam. It's even more pronounced in web/microservices situations because the web server tak…
Apache Beam I see, but what has Kubernetes to do with getting and mixing data in parallel?
Re: The BEAM Has Spoiled Me
#53Earlier quoted context omitted.
Phoenix takes a little bit of reading to figure out (though the documentation is brilliant, and really easy to read). Once you understand how it works, though, creating an API is extremely straightforward. It's amazing.
I just couldn’t get past ecto! It never seemed to “click” for me. Maybe I need to go back and learn it more in-depth, it sounds like it’ll be fantastic once I get the hang of it.
The first part is your schema. It defines an Elixir struct that is your domain model of your data.
The second idea/part is the concept of a changeset. It represents a change you'd like to make to the data store, but haven't yet. These are composable, so you can bundle a bunch of changes into a single, atomic unit, which you then send to your repo. If any part fails, then the whole thing fails, no changes are made to the persisted data.
The last thing is migrations, which strictly speaking are optional, but a huge convience. They define how you'd like your database to be structured. The cool thing about them is that they define rollback operations automatically.
Once Ecto "clicks", it really becomes a strong selling point to the language as a whole. It makes working with persisted data super easy.
Re: The BEAM Has Spoiled Me
#54I've written a decent amount of Elixir for a personal project, and have come to a few conclusions. For a start, it's very different. That will become self evident if you try to learn either Erlang or Elixir, when coming from a language like Python/C++/etc (and though Elixir looks a lot like Ruby, it's still more like Erlang, tbh). So that can be classed as a negative. Secondly, fault tolerance in Erlang/Elixir/OTP is…
Re: The BEAM Has Spoiled Me
#55I've written a decent amount of Elixir for a personal project, and have come to a few conclusions. For a start, it's very different. That will become self evident if you try to learn either Erlang or Elixir, when coming from a language like Python/C++/etc (and though Elixir looks a lot like Ruby, it's still more like Erlang, tbh). So that can be classed as a negative. Secondly, fault tolerance in Erlang/Elixir/OTP is…
twisted/python has had manhole facility since early 2000s, I still sometimes use it to day
Re: The BEAM Has Spoiled Me
#56> Some teams are happy to use Elixir to write web applications, to fit it into their pre-existing microservice deployment model. I urge developers to reach for those bigger thoughts that fault tolerant lighweight processes enable. You can consider each process a logical microservice, but you don’t need the friction of deploying it separately, and serializing to/from json, and containers, and orchestration, and distri…
I think the author's use of the microservices is unfortunate and confusing. With the BEAM, it is easy to create fully independent process trees. The architecture enables it. In fact, you can pull in dependencies and add them as "OTP applications" (which is in essence a fully independent process tree, doing its thing.) The BEAM lends itself very well to structuring parts of your application as independently supervised…
Re: The BEAM Has Spoiled Me
#57I'm reading all this and wondering what BEAM is.
Re: The BEAM Has Spoiled Me
#58> Some teams are happy to use Elixir to write web applications, to fit it into their pre-existing microservice deployment model. I urge developers to reach for those bigger thoughts that fault tolerant lighweight processes enable. You can consider each process a logical microservice, but you don’t need the friction of deploying it separately, and serializing to/from json, and containers, and orchestration, and distri…
Release independence? If one team has a regression and needs to roll back their week's release, everyone gets rolled back too.
Maybe in very large, mature companies this happy land of backwards compatible, fully independent microservices, deployed totally independently, is possible. But in startups tearing forward at full speed with limited crew it's a pipe dream. The better solution is for proper source control management, so problematic changes that are actually independent can be reverted effectively, leaving everything else alone.
Re: The BEAM Has Spoiled Me
#59Earlier quoted context omitted.
Can you recommend any learning materials that were particularly useful to you?
Honestly the docs themselves are excellent https://elixir-lang.org/getting-started/introduction.html
Re: The BEAM Has Spoiled Me
#60Earlier quoted context omitted.
Phoenix takes a little bit of reading to figure out (though the documentation is brilliant, and really easy to read). Once you understand how it works, though, creating an API is extremely straightforward. It's amazing.
I just couldn’t get past ecto! It never seemed to “click” for me. Maybe I need to go back and learn it more in-depth, it sounds like it’ll be fantastic once I get the hang of it.