I have been reading Elixir in Action and I have noticed that in an example, the author decides to forgo Tasks and use pools.
The reasoning behind this is that since we were dealing with a Database, and since the DB may be overrun by multiple simultaneous queries, we need to limit its access somehow via a pool.
Thus, the idea I get from the book is that if we have a resource we want to keep from overusing, we should use a pool, otherwise, if our resource is practically unlimited, we should go for Tasks since they are much simpler.
A personal case
As an example of this lets assume I have a
service A that needs to notify another
service B by sending 2000 requests/second to B (which has no problem in handing it).
In this specific case, would it make sense to use a pool of processes in A for it to use as senders to B?
Since I don’t have any resource here that needs to be safeguarded and processes are so cheap to create I don’t think a pool would make sense.
What do you think ?