Book Recomendations: Migrating to Microservices Databases
Just finished reading Migrating to microservices databases by Edson Yanaga. If you can relate to the 3 nouns in the title then you’ll want to check it out.
Code is easy; state is hard.
— Edson Yanaga
If you are on the journey of migrating your monolith to a micro-service architecture (like every other developer this days) then, at some point, you probably found yourself staring at a whiteboard full of rectangles and hexagons thinking: where does the data fit in this mess?
Maybe you’ve read about the “Database per service” pattern and now you’re wondering what your requirements are on data consistency. Or somebody told you about CQRS but you don’t know it’s advantages and disadvantages.
Edson’s book opens with a brief recap of the micro-service world. Going from “Why microservices” to A/B testing and Canary deployment, the book provides a super-quick explanation of each concept without going into many details.
By contrast the second part of the book deeps dive into how to handle the data of your micro-services. Chapter 3 explains how to do Zero downtime migration of your relational DB and which tools to use.
On Chapter 4 Edson introduces the different consistency models and compares CRUD Vs. CQRS (explaining also Event sourcing)
The last chapter is, to me, the best. Chapter 5 contains a recount and description of some of the different Integration Strategies we might want to consider when migrating the monolith. Each strategy is briefly described, and we are also provided with an assessment of applicability and section of considerations to keep in mind if using this strategy.
The hardest part of design is not knowing the architectural patterns or the different techniques to solve a problem, but knowing which solution is a good fit to which problem. Yanaga’s book serves as a good catalog of possible solutions to consider, when working with data on micro-services. It provides a concise analysis of each strategy and helps us avoid those ”I wish I’ve thought this better before writing the code” moments.