Microservices: The Rationale
There is increasing demand that enterprise software systems be Elastic, Resilient and Agile.
- Elasticity is adaptability to varying loads. When load increases systems should scale up for performance and conversely they should dynamically scale down to reduce costs when load decreases.
- Resiliency is gracefully handling outages while continuing to provide business value. Since failures are inevitable, systems should contain and isolate their scope.
- Agility is responsiveness to business needs with minimum disruption. Software delivery should be rapid, incremental and iterative to stay competitive.
Microservice-based systems, when implemented correctly, are specifically designed to meet these demands. Additionally, microservices allow large, monolithic enterprises to gradually convert to cloud-native software systems and fully leverage the benefits of Cloud computing.
This combination of Agile Development methodology (rapid, incremental iterations) combined with microservice architectures (small independent services) dovetails perfectly with Cloud-computing principles and offers huge business advantages as evidenced by companies like Netflix, LinkedIn & PayPal.
The "Microservice Premium"
Adopting a microservice architecture comes with a significant cost -- often referred to as the "Microservice Premium". The key concept to grasp here is that microservice-based systems are distributed systems, which requires facing a whole new set of challenges.
Per Martin Fowler:
"Almost all the successful microservice stories have started with a monolith that got too big and was broken up...Almost all the cases where I've heard of a system that was built as a microservice system from scratch, it has ended up in serious trouble..." ~ Martin Fowler (ThoughtWorks) MonolithFirstStrategy
So, when is the right time to start moving to this new & complex architecture? The general consensus seems that the best time to transition is when there's no other choice.
Adopt microservices only when your business needs outgrow the simplicity of a monolithic application.