Monolith to Microservices: Evolutionary Patterns to Transform Your Monolith 1st Edition
How do you detangle a monolithic system and migrate it to a microservice architecture? How do you do it while maintaining business-as-usual? As a companion to Sam Newman’s extremely popular Building Microservices, this new ebook details a proven method for transitioning an existing monolithic system to a microservice architecture.
With many illustrative examples, insightful migration patterns, and a bevy of practical advice to transition your monolith enterprise into a microservice operation, this practical guide covers multiple scenarios and strategies for a successful migration, from initial planning all the way through application and database decomposition. You’ll learn several tried and tested patterns and techniques that you can use as you migrate your existing architecture.
- Ideal for organizations looking to transition to microservices, rather than rebuild;
- Helps companies determine whether to migrate when to migrate and where to begin;
- Addresses communication, integration, and the migration of legacy systems;
- Discusses multiple migration patterns and where they apply;
- Provides database migration examples, along with synchronization strategies;
- Explores application decomposition, including several architectural refactoring patterns;
- Delves into details of database decomposition, including the impact of breaking referential and transactional integrity, new failure modes, and more.
From the Preface
A few years ago, some of us were chatting about microservices being an interesting idea. The next thing you know it’s become the default architecture for hundreds of companies around the world (many probably launched as startups aiming to solve the problems microservices cause) and has everyone running to jump on a bandwagon that they are worried is about to disappear over the horizon.
I must admit, I’m partly to blame. Since I wrote my own book on this subject, Building Microservices, back in 2015, I’ve made a living working with people to help them understand this type of architecture. What I’ve always tried to do is to cut through the hype, and help companies decide if microservices are right for them. For many of my clients with existing (non-microservice-oriented) systems, the challenge has been about how to adopt microservice architectures. How do you take an existing system and rearchitect it without having to stop all other work?
That’s where this book comes in. As importantly, I’ll aim to give you an honest appraisal of the challenges associated with microservice architecture, and help you understand whether starting this journey is even right for you.
This book is designed as a deep dive into how you think about, and execute, breaking apart existing systems into a microservice architecture.
What You Will Learn from this ebook Monolith to Microservices
We will touch on many topics related to microservice architecture, but the focus is on the decomposition side of things. For a more general guide to microservice architectures, my previous book Building Microservices would be a good place to start. In fact, I strongly recommend that you consider that book to be a companion to this one.
About the Author
Sam Newman is a technologist, working for ThoughtWorks. He spends his time helping people build IT systems. Aside from that he commits sporadically to open source projects, has spoken at more than a few conferences, and even found time to write some things.
After spending time at multiple startups and 12 years at ThoughtWorks, Sam Newman is now an independent consultant. Specializing in microservices, cloud, and continuous delivery, Sam helps clients around the world deliver software faster and more reliably through training and consulting.
Sam is an experienced speaker who has spoken at conferences across the world and is the author of Building Microservices from O’Reilly Media.
Reviews about the ebook Monolith to Microservices
- Sebastian Gebski:
Sam Newman did it again. He has written a very good ebook on microservices.
The one which is technology-agnostic & at the same time – very practical.
What I like most is that Sam doesn’t try to avoid answering uncomfortable questions – e.g. what to do when we have queries spanning across separate storages. Another positive fact is that we’re not getting the 100th description of what is CQRS & Event sourcing.What else? There’s no zealotry, no expressed preferences regarding any particular tools (except Sam’s love towards FaaS ;>), examples presented are good enough (not really deep into the details, but on a sufficient level).What did I miss? Some more explicit statements regarding data redundancy (pragmatism over normalization), helpful conventions (append-only approach & immutability of selected data – this was partially covered in the chapter about deletes).
Strongly recommended. Short, but a very decent book.
P.S. The version I’ve got was sponsored by Nginx (2019.10) – it may differ slightly from the version which will be mass-printed.
- Robson Castilho:
I enjoyed this book a lot more than Mr. Newman’s previous Microservices book though it’s still pretty high level. I think he comes across as a very competent and professional Independent Consultant. He doesn’t try and sell anything, he asks the questions most consultants/vendors won’t ask (i.e. Do you need Microservices? Do you need to break up your Monolith? etc)He knows what he’s talking about and he’s confident enough to not feel like he has to sell you anything and he can speak frankly. Very impressive.My main complaint is the one I had for his other book which is there still is no detailed analysis of a Microservice. You still have no idea what one is just from reading this. Admittedly though this isn’t meant to be a Microservices book as much as a Monolith to Microservice book. But, having said that, it would have been fantastic to use a real or contrived Monolith example and break it down (in detail) to microservices. I’m sure that would double the book size, but it would be real concrete information.
- Max Wolffe:
Overall I found this book to be an excellent, practical guide to approaching a monolith decomposition, though I have a few issues with it.The Good:
– Newman starts by presenting all of the reasons why you might want to do microservices and how you could solve them WITHOUT doing microservices. This was the main complaint with “Building Microservices” which presents microservices without being too critical about when one would want to avoid microservices.
– There’s a great section describing how one might help their organization to make a change to microservices. This section builds nicely on Newman’s second chapter of “Building Microservices”, “The Evolutionary Architect”.
– There are some good decomposition patterns, notably: branch by abstraction and the strangler fig pattern.
– There is an EXCELLENT section on the growing pains one might encounter when they start adopting microservices. I found this section to be particularly useful because it’s leveraging Newman’s considerable experience as a consultant, in which he’s seen lots of different companies adopt microservices and encounter problems.
– Newman focuses on core, long-lived aspects of migrations instead of on specific technologies (which will be outdated in a year), with just enough technology examples to help one connect concepts to real-world examples.The Not So Good:
– The actual decomposition recommendations almost entirely ignore the issues brought up in the “Growing Pains” chapter. One huge issue that microservices bring up is that network calls have a different guarantee than databases: they may fail, they aren’t transactional, they may timeout, etc. This causes big problems with two proposals in the book:
– Dual write migrations – A migration strategy in which one writes to both systems using rest calls, migrates data, and then changes reads to the new source of truth. The big issue with this strategy is keeping both stores consistent since calls to either system can fail or timeout. In my experience, this is one of the hardest parts of migrations, and it’s barely handled as written. I would have loved to see more examples of how companies handled this, from Newman’s experience.
– Orchestrated Sagas – A similar issue arises in Orchestrated Sagas. There may be partial failures on any part of the way with both the inbound saga and the “compensating transaction”. The book suggests using choreographed transactions where possible but doesn’t bring up this danger of orchestrated transactions.
I’m wondering if it would have been better to restructure the book to first present the unique issues which microservice architectures encounter and then present decomposition techniques that lead to architectures that are resilient to these issues.
– The decomposition examples given are pretty straightforward. This is probably to make the points very clear, but it would have been great to have at least one example of a decomposition that was tricky or which wasn’t worth decomposing at all. Newman mentions that such examples exist, but doesn’t do any further examination.
Overall, a very practical guide to migrating from a monolith to microservices, and (importantly) why you might not want to.
- David Van Couvering:
I loved Sam’s other book on microservices, but this one addresses the key issue – you almost never build microservices from scratch. The last three companies I have worked at have all had monoliths they were trying to move off of, and even after deciding a microservice architecture was the right choice, the big problem was how to get off of the old one. And the biggest challenge, by far, is the data.This is where Mr. Newman’s book shines – he has so many different smart and useful patterns for addressing data migration. I am putting them to use already.Highly recommended if you find yourself staring at this big ball of mud and feeling completely overwhelmed. This book will give you courage and prevent you from crawling into a corner and pulling a blanket over your head.
What I liked the most about the ebook is that is short and dense. It has everything in the proper amount of length, giving a good overview of the problems, and provide some of the possible solutions to them with a bit of “what I would do”.Really good book.
It is an amazing book. It covers everything from start to end. If you want to travel the road of Microservices.It’s structured in a way that fits the mental model of monolith developers but to evaluate Microservices architecture. It’s going to serve as a glossary of what to do & what not to do when doing Microservices.Starts with simple 3 questions, during the journey you would feel yeah it feels very real. But without a single line of code. You will get answers along the way, from people problems, team ownership, tackling database, the importance of DDD, and suggestions on tools one have to learn along the way.
Thanks, Sam Newman for writing such an amazing ebook.
Practical advice on how to move to Microservices. It also discusses the reasons you would want to migrate your app to a Microservices architectural style and even gives alternatives that might help you achieve the same goal without migrating. I liked the realistic examples, trade-off analysis.I enjoyed Chapter 4, on Decomposing the Database the most, because I think that’s probably the hardest part when migrating to Microservices (and the one that gets the least amount of coverage in many resources). The patterns cover problems we’ve all seen in the wild and the solutions are pragmatic and useful.
- Fernando Aguilar:
Superbly explained. Quick to go to the facts. I understand now this very important subject that has been in the news so much.
- Denis Romanovsky:
A nice book with lots of recipes, patterns, and best practices for breaking monoliths into microservices. Not too detailed into tech stuff, but still good enough.
- Ben Twain:
Helpful ideas and patterns. Would have liked more prescriptive advice about the patterns and how to apply them.
- Vinayak Hegde:
A well-written book on the different problems that you are likely to encounter when migrating from a monolith to a distributed systems microservices architecture. The book is neatly divided into different parts that cover different technical and non0technical aspects of making the move such as figuring out if microservices architecture is the right path for you (Chapter 1), getting the right team and team structure in place, and also management buy-ins (Chapter 2), breaking down code and migrating using different patterns to reduce coupling (Chapter 3), migrating and breaking down datastore and database schemas and patterns to do this (Chapter 4), The likely problems that you will encounter when undergoing the migration (Chapter 5).I like the fact that the book looks at the migration path holistically liberally talking about different kinds of tools, techniques, and further reading references. I have done such migrations in the past in my career but I learned a lot in this book (even if it was the name for the patterns I implemented). The version that I read was sponsored by Ngnix so it might be slightly different from the commercial book.
Good introductory to transforming a monolith into a microservices-based system. It lays out the main ideas nicely. However, it’s a bit naive and doesn’t touch on real-world systems which are way more complex.
- Bartłomiej Falkowski:
It’s so hard to write a good book about software architecture. I think you have two options: digging deeply into the technical details or trying to be technologically agnostic and relying only on “abstractions”. This book is of the latter type – the word “Docker” is used only once and the word “Kubernetes” is used less than five times 🙂 And this is a really good book.What I liked:
– Simplicity. All the patterns short and well explained. Moreover, we always have a context of usage – it’s easier to put it in the “real-life” scenario.
– Pragmatism. I like the idea of a slider instead of a button for the description of making changes. Nothing is for free and we should always look at architecture migration in this way.What I didn’t like:
– The shallowness of some topics. For example, the phrase “extract your services based on bounded contexts” is in self a topic for multiple books. However, I understand that exploring such problems in this book would increase the number of pages dramatically 🙂 I accept it.
- Juan Moreno:
El contenido aborda los problemas que surgen al dividir un monolito en microservicios desde el punto de vista de la arquitectura, y no desde una tecnología en concreto.
- Saran Sivashanmugam:
Another great microservices book from Sam Newman. I felt this is a sequel to his earlier book, Building Microservices. Sam updated some concepts from recent microservices evolution such as choreographed vs orchestrated Sagas, added infrastructure evolution such as Kubernetes. I loved the depth he covered the monolith database refactoring and the simple but elegant solutions he proposed using schemas and views in the existing database engine for refactoring. I’m a fan of Sam’s pragmatic approach when introducing new concepts that work very well for startups and big corporations. He also delved into details about the organizational aspects of microservices and the distributed systems concerns that microservices might bring. If you liked reading his earlier book Building Microservices, then this is a highly recommended sequel helping in implementing that.
Must have read.
- Adnan Rafiq:
It is an amazing book. It covers everything from start to end. If you want to travel the road of Microservices.It’s structured in a way that fits the mental model of monolith developers but to evaluate Microservices architecture. It’s going to serve as a glossary of what to do & what not to do when doing Microservices.Starts with simple 3 questions, during the journey you would feel yeah it feels very real. But without a single line of code. You will get answers along the way, from people problems, team ownership, tackling databases, the importance of DDD, and suggestions on tools one has to learn along the way.
Thanks, Sam Newman for writing such an amazing book.
- Felipe Henrique Gross Windmoller:
This ebook teaches us many strategies to make a successful migration to microservices. I recommend it for those that will work with this.
- Fermin Quant:
A very well-written book, which shows on every page the experience of the author on the topic. It really puts into perspective the huge task of moving to microservices from a monolith, the most common pitfalls, and provides possible solutions to them.
The book is most useful as a reference for your journey of moving to microservices, it is not an absolute proven guide of not failing, but more a collection of very well-organized experiences that will help you avoid most common problems and kind of guide your decision making.
It is good that the author emphasizes at the start that microservices are not for every situation, and spends some time explaining how you can figure this out for your current situation before you start.
I previously read Building Microservices by Sam Newman which was great staying off point for Microservices. This book expands on that by including strategies to migrate from a monolith to microservices. The strategies are well explained and practical examples given to solidify the learning.Sam’s way of teaching keeps things interesting while reinforcing the information. I can’t recommend this enough for anyone planning to migrate from a monolith to microservices.
- Lazar Dilov:
Honestly, in the past years, I have read a lot of titles about microservices architecture but this one turned out to be actually useful for me and my job. For the last two years, I was desperately trying to get rid of monolithic structured applications and this book gave me the best approaches to do that! It is fairly simple but really practical and useful! Congrats to Newman! Although there were many things I already knew, there were also some observations and simple advice that can definitely change your workflow whenever you are facing such issues.
- Rafael Gorski:
This a review of the first chapter of the book… I like the written approach/style of the book. It initiates from core concepts of coupling and cohesion which are the core principle and linked well with microservices decompositions and common scenarios.Thoughts for an extension for the book:
I thought this chapter one is a good link to the requirements phase. The requirements being decomposed in the same way as a pre-design phase to then prepare for microservices design.
Good, very practical review of the thought processes and real-world symptoms and consequences when considering a move to microservices. You’ll need to think for this one, as the author doesn’t hand you the answers, but if you do think through this material, you’ll be equipped for the squishy world of actual professional software development.
- Ibrahim Tasyurt:
I loved this book. The author puts together the challenges&opportunities when transforming monolith to micro-services. Also compiles the patterns to migrate the code and data. The patterns described in this book are not only applicable to microservices transformation but any kind of re-write and migration cases.
- Isaac Perez Moncho:
Very good book, if you are thinking about microservices you must read it.
It explains the different ways you can migrate from a monolith to microservices, but also tries to explain how to understand if this move is right for you.
A brief summary would be: “strangler patter” and it’s not easy.
- Bart Schotten:
Very practical and realistic. Not just a rehash of its predecessor.