Currently my architecture is very much event driven. Every API request is served as quickly as possible sending events that run after the response.
However this is a monolith and the event handlers run under the same process that manage the API. Responding a single API request is efficient, but the process CPU will quickly choke managing API + background work.
I have two ways to scale this:
Offset background tasks to workers
Make a cluster and load balance the same process
Although both approaches should be implemented on the long term: Which one should be the first one to scale?
My assumption is that a non healthy monolith would be easier to fix with option (1), while option (2) covers earlier important infrastructure needs (so it will be optimal for well structured monoliths)