Chapter 9. Migrating to Microservices

Microservices are great! If you need them, that is. The road to microservices is paved with good intentions, but more than a few teams are jumping on the bandwagon without analyzing their needs first. Microservices are powerful, and they should absolutely be in your toolbox. Just make sure you consider the trade-offs. There’s no substitute for understanding the business drivers of your applications; this is essential to determining the proper architectural approach. And it turns out, they aren’t the only approach you can leverage.

Modular Monoliths, Macro Services, Oh My!

It should be stressed that monoliths span the continuum of modularity and they actually can be structured in such a way that they don’t suffer all of the maladies normally associated with the term monolith. You can apply microservice design principles to monoliths! When facing all the issues the monolith entails, it is tempting to (attempt) to jump directly to a microservice architecture. However, for many, that path leads to a distributed big ball of mud.

If you can’t build a monolith, what makes you think microservices are the answer?1

Simon Brown

Obviously, a distributed big ball of mud is the worst of both worlds—all of the accidental complexity, none of the benefits of a truly distributed system. Many have found moving to a modular monolith first facilitates finding bounded contexts within your application. It is possible to break a monolith into modules that give ...

Get Responsible Microservices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.