Handling Concurrency
A frequently asked question is “How do you scale microservices?” We have these single-threaded, stateful Components—what happens if they don’t keep up? Are there other reasons to run concurrent instances? We have completely ignored dealing with concurrency in this project.
You’re right to think it isn’t as simple as just running more instances. That works very well for applications because they are inherently stateless. Autonomous components, on the other hand, are very much stateful.
And it isn’t just intentional scaling that would lead us to multiple instances. We might accidentally cause two instances to be running at the same time through our own error with our deployment system. Or perhaps we want to have two going ...
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