Building Micro services - by Sam Newman
Posted on November 2nd, 2015
This book provides a great overview of what are micro-services, how they came to be, the complications and advantages that come from designing your systems with micro-services.
Sam starts by providing an overview of micro-service architectures. Ease of change/upgrade, composability, polyglot environment, scalability and many others are some advantages that come with it. However, a micro-service architecture also brings a lot of extra work and complications such as logging aggregation, deploy automation, service orchestration, service compatibility and a few others.
He moves on to explain how various systems evolved since the late 1990s. Many of those systems were trying to follow an old Service Oriented Architecture (SOA) that was so commonly spread in the Java Enterprise Edition peak with all its Enterprise Java Beans (EJBs). As a consequence of failure, many companies abandoned services in favor of more monolithic solutions. Others slowly evolved towards what is now being called a micro-service architecture.
By chapter 3, Sam starts describing how one would begin a path towards a micro-service architecture. He discusses how services should be shaped along the teachings of Domain Driven Design (DDD) looking for seams in the business. He moves to think about how those seam-shaped services will integrate with each other and with existing legacy projects. From then on, Sam helps us think about what to do with a big monolithic system to slowly get it towards a service architecture that works.
As we get those services spawned, problems with ensuring that our changes can make it safely to where they are needed start showing up. Sam talks about deployment needs and problems. As we feel safe that one individual service is working as expected, how do we find problems that come from interactions between services? The following chapter talks about testing patterns that help us deal with the many moving parts of a micro-service architecture.
Chapter 8 brings us back to the reality of production. Yes we can take many measures to avoid issues but reality is that there will be issues. Finding out which service (if any) is miss behaving is now a lot more challenging. Dealing with monitoring in this architecture is a lot more complicated than with a single monolithic application. The multiple servers, services and indirections make finding which log file has the issue a lot more complicated. And that's assuming the problem is not in the interactions. Along those lines, how can those multiple services handle security concerns? Should users be authenticated on every service? What happens if a malicious users gets access to one server of a given service? Is everything compromised? Chapter 9 helps us think through many of those questions.
The last couple of chapters handle the impacts of micro-services on your company's structure and vice versa. Conway's law has impacts that cannot be ignored and that probably should be considered in the way your system will be designed. Chapter 11 finally talks about scaling micro-services and dealing with failure in an environment of many moving parts.
Finally, Sam wraps it all up on the last chapter (12) giving a good quick summary of what you should be looking for if you're moving in the direction of micro-services and what to avoid.
Overall, the book presents a broad theorethical overview of a micro-service architecture. It hints towards general good practices and things to look for. It is not a recipe book nor does it include detailed code samples of any part needed to build a system with a micro-service architecture. If you want to follow this path, Sam's book is a good (and small) start for what surely will be a lengthy and hard road.