Microservices – Scaling Monoliths vs. Scaling Microservices

microservices

One of the common arguments for using microservices is better scalability. But I wonder whether this argument is really valid.

Lets say we had an application consisting of 10 microservice with 9 of them having each two instances (for redundancy) and one of them with 4 instances to handle the load (scalability). The pro-microservice argument is then that you are able to scale this miroservice indepently from the other services.

However, lets say all 10 microservices were modules in a single monolith and that several (e. g. 22 like the sum from above) instances of this monolith were deployed. The system should be able to handle the load for the one critical part, because there are enough instances to do so. If instances are containing program logic not needed, the only downside would be, that the binary and the amount of needed RAM would be slightly larger. But then again, the difference shouldn't be too big in most cases – at least not compared to the rest of the stack (think of Spring Boot). The upside of a scaled monlith would be a simpler system without (most of) the fallacies of a distributed system.

Am I missing something?

Best Answer

The point of microservices is not to reduce processor load. In fact, because of the overhead of communication and repetition of functions that used to be global utility code, it usually increases processor load somewhat.

The point of abolishing a monolith is much more to be able to maintain, deploy and run a complex system of functionality at all. Once your system reaches a certain size, compiling, testing, deploying etc. a monolith becomes just too expensive to be feasible while maintaining a decent uptime. With microservices, you can upgrade, restart or roll back a system piecemeal.

Make no mistake, we don't write microservices because it's inherently a better solution to couple things loosely over remote interfaces. In fact, the loss of strong type and consistency checking that a monolith could provide is often a major drawback. We do it because we have to because complexity has gotten the better of us, and are making the best of a suboptimal situation.

Related Topic