Be Parallel, Be Cautious
With great power comes great responsibility. Elixir is a powerhouse when it comes to running parallel processes. You can literally spin up thousands of concurrent requests that are active at the same time. But this can cause problems.
Programs don’t exist in a vacuum. They interact with other programs like databases or external APIs. A program can only handle so many parallel requests before it becomes overwhelmed. You could easily exhaust a database connection pool or downstream API service by sending too many simultaneous requests.
It’s best to always have control over the amount of parallelism in your system. Libraries that you’ll see later in this book, like Ecto and Oban, all include a limited number of parallel ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access