jaeyson

jaeyson

Do we have "ELI5" for Elixir here?

Not trying to add more mess here but, reddit has ELI5 but i wanted to know if it’s okay to ask Elixir-specific (or outside of it) in a similar style of questions? i.e. I’ve heard backpressure (i’ve just read that term via Elixir-lang blog Announcing GenStage) and how/why does one (ie. Elixir) approach this? I’ve read it but i cant wrap it in my head (newbie).

Most Liked

mafinar

mafinar

Now, to answer your question on back-pressure. Let me draw an analogy from an experience I actually had during our covid 19 vaccination.

So my wife and I went to get vaccinated at a centre. We parked the car and saw a queue being formed right outside, of people waiting to get vaccinated. That queue reached from the parking place up to this tent-like structure.

Some volunteers came, and asked for proof of location, health card information etc and input those information into their iPads. And while that was happening, another volunteer at the front of our queue (and as we will find out soon, at the back of another) asked for 10 people to get in. When our turn came, we went inside and faced a similar, “controlled” and on-demand queueing system, we get called in groups, we enter in groups, and get serviced, and exit the premise. While this felt like a lot of rules to be implemented, it did end up feeling “effective”. The doctors who were giving vaccines did not have a crowded hall, and that hall had low number of people, manageable and quickly emptiable. On the other hand, you never really waited too long at any of those buffers.

Now, think about the nature of this group act, from the “provider’s” (i.e. volunteers’ or doctors’) perspective, they are obviously fewer in numbers than us, and they can only take so many at a time, by giving them the calling capability, the capacity is being managed. The traffic (i.e. we who are waiting to get vaccinated) are parked and get serviced only when the persons responsible to process are capable of doing so, and it is not something we see (i.e. when the person before me finishes I can “just go”) but that process is hidden from us. and we get called in batches, and that batch number often has a connection with the provider numbers (if there are 4 doctors maybe a batch of 2*4 or 3*4?).

This description is based on my experience and may not have any resemblance at all with the actual process or statistics behind it but let’s convert this whole “pipeline” into a programming one. You have a steady stream of data, and there are dedicated functions (let’s stick to functions now, simpler ones, and let’s not get to multithreading), that transform them, and output of one function is the input of others, until you get the satisfactory computation.

If these functions have limited processing power, and data just keeps coming in, why not have the data parked, and only process a handful at a time? So, welcome the data, but take only what your capable of. This phenomenon, this artificial buffer of data waiting to be processed- is back-pressure. If you think of it as a FIFO (First In First Out) queue, and the entrance is considered as “back”, then the pressure built up from incoming requests, would be back-pressure.

I am not so good with ELI5s and this was an attempt. Apologies if I failed at it.

mafinar

mafinar

Hello and welcome to DevTalk. I am not a moderator here but as someone who’s been active since this forum began, asking questions or opening posts is not considered a mess here but are welcome. And this is a place I interacted with some of the friendliest programmers I have met. So you are welcome to ask questions. Although ElixirForum is equally friendly.

AstonJ

AstonJ

This is a great idea @jaeyson!

We were going to start a ‘Glossary’ section on the Elixir Forum where a thread would be posted about something, and then people could explain it in their own words. If you’re a member you can see the thread here: https://elixirforum.com/t/do-you-think-we-need-a-glossary-section/12988

I think we could do such a version here (general dev), then another on the new Erlang Forums for BEAM related stuff - what does everyone think?

Great post btw Mafinar!

Popular General Dev topics Top

andresriveros
I am currently subscribed to: The Ruby Rogues Remote Ruby Maintainable Planet Argon founder and ohmyzsh creator. https://maintainab...
New
Exadra37
So, if we can reduce the likelihood, we can reduce the overall risk. That’s good. It’s actually very similar to a very common idea called...
New
AstonJ
Great paper by Igor Kopestenski on Erlang and GRiSP: Erlang as an Enabling Technology for Resilient General-Purpose Applications on Edge ...
New
finner
When you are under pressure to deliver you ideally want your Pull Request to be reviewed, approved and merged as quick as possible. So do...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
dwaynebradley
In their weekly newsletter, Jared Santo from the Changelog shared this blog post by Mark Ericksen over at fly.io: What is really inter...
New
Exadra37
Kubernetes is everywhere. Transactional apps, video streaming services and machine learning workloads are finding a home on this ever-gro...
New
jaeyson
Hi all, does anybody tried Shankar Devy’s Phoenix Inside Out book series? Also, will there be a big difference (aside from context prior...
New
malloryerik
With 100% less blockchain. I went searching for a lightweight immutable database that could be audited and ran into this. I guess this ...
New
jaeyson
Hi!, hope everyone’s ok. Sorry if this question is ambiguous (i’ll remove this if i break some rules here). This is more like a self-ques...
New

Other popular topics Top

malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
Margaret
Hello content creators! Happy new year. What tech topics do you think will be the focus of 2021? My vote for one topic is ethics in tech...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New