A great book presenting patterns for transforming a monolithic system into a microservice architecture. The Sam Newman’s exposition is clear (but dense!), very pragmatic and grounded in reality, reflecting real-life experience in countless projects. It gives me a lot of confidence that a good chunk of the initial chapters is spent giving you reasons not to choose microservices: all the pros and cons are evaluated, and alternatives are proposed. This type of architecture is not for everybody, especially not for startups.
If after all the warnings you’re still convinced that microservices are the way to go, the author proceeds by defining basic concepts and outlining the general plan for a successful migration. DDD is presented as an invaluable tool for identifying service boundaries, and several other aspects are also explored: cultural changes, team satisfaction, ownership, etc. because technical matters are not the only subject that needs to be considered.
The core of the book is in chapters 3 and 4, which present a catalog of high-level patterns for splitting a monolith both from the service’s perspective and from the database’s perspective. The solutions to common problems are explained at different levels of detail: some involve fiddling with networking and infrastructure, others modifying service code via refactoring, and others propose changes in the database or its tables – but never going into actual implementation details.
Several of the patterns felt familiar; I’ve probably applied them in some capacity without knowing they existed (but I wish I knew them before!) I was very satisfied with the patterns and the methodology, it encourages incremental, evolutionary changes in architecture while offering multiple alternatives; sometimes the author shows his preference for one over the other but he’s emphatic that all depends on the context of each problem. For a an example of the plethora of options available for each situation, take a look at the discussion of how to split reference data in a database.
A couple of the patterns present somewhat surprising solutions, I really liked this out-of-the-box thinking, away from dogmatisms and from the tyranny of batch processing and monolithic databases, making a good case for event-based microservice architectures.
The final chapter deals with practical considerations and tips when the number of services starts to grow, and when to expect the problems to pop up. Interesting stuff to have in mind. Also in this chapter and in the whole book in general, the author recommends open source tools for different needs, I’ll list the most useful for my own future reference: change data capture systems, service meshes, GitHub Scientist, FlywayDB, SchemaSpy, ELK, Jaeger, pact.io.
A final word of advice: bear in mind that this book is not a standalone reference. To gain a good understanding of the details of implementing a microservice architecture, one needs to also read “Building Microservices” by the same author, which I intend to do – the perfect companion for this volume. Needless to say, I highly recommend this book to any architect considering jumping into the microservice bandwagon, but doing so in a responsible way.