I have read many posts and watched video to understand Microservices precisely however I found Martin Fowler’s explanation about Microservices most helpful. This blog post is just the recap & summary of what I understood about Microservices Architecture.
Characteristics of Microservices
- Build services in form of Components
- Components can be independently replaceable and upgradable
- Components can be combination of Libraries and Services
- Services can be built in other languages and services can inter communicate
- Organized keeping business rules in mind
- Traditionally (Monolithic), Services were organized considering technical aspects like different services related to UI, Database, Server etc
- Microservices, suggests to group it as per business capabilities like shipping, Order, Catalog etc
- Smart end points and dump pipe
- In ESB (aka spaghetti box 😉 lol), we tend to add all smartness in ESB itself and endpoint is just a dump where consumer gets preprocessed data
- MicroServices on other hand encourages dump pipe (ESB) and smart endpoints
-
- Decentralized Governance or Data Governance
- Every Service should be responsible for their own database & persistence
- Can’t communicate to other databases directly, it should be via API’s only (These are mostly inspired by Amazon’s 2 Pizza team size)
- Every service can have different languages or tools
- Infrastructure Automation
- Continuous Delivery is very important for each services to make sure there is no or minimal down time
- Top class monitoring capabilities to perform analysis of degraded performance or downtime
- Important to have roll back plan and ability to spin up new server in case of service or service fail
- Design for failure
- As there could be many microservices, its inevitable that they would fail.
- Companies like Netflix, they have a application (chaos monkey) which randomly goes out and fail their microservices deliberately
- Its important to perform these kind of exercises to understand how resilient their network and microservices are.
Similarities between SOA and Microservices
Its debatable topic, as many Architects believe that Microservices is just a new term and does exactly what SOA is supposed to do. SOA is here for decades and Software Architects are designing their system around same characteristics as a part of SOA Architecture. I think SOA is very broad term and everyone has their own definition for SOA, it would be safe to say that Microservices is just a subset of SOA and derived its characteristics from its parent.
How big the Microservices can be
Again debatable answers, everyone can have different opinion. However as per Martin, your Microservices can only be as big as your two pizza team size.
Advantages of Monolith Architecture
- Monolithic applications are simpler to build. on other hand Microservices are complex to build and may contribute to project failure of not planned well in advance.
- Monolithic application experience are consistent. Its mostly guaranteed that if one functionality is working then others will work as well.
- Ability to refactor code between modules. As its same application, developers can decide and move codes between modules as a part of code review or refactoring. The same advantage may be disadvantage for some teams if they want to preserve their module.
Advantages of Microservices
- You can perform Partial Deployment in microservices. Instead of deploying whole application, we can just deploy services.
- Availability of system is higher. If one microservice goes down, application would still work for other part. In case of monolithic application, chances are high that whole application goes down because of some server issue. Because of this , obviously microservices looses Consistency.
- Microservices can Preserve Modularity so that code is owned & maintained in same module. If some team needs to refactor code and move between module then same becomes disadvantage and Monolith applications wins over it.
- Ability to go in multiple Platforms for same application. Every microservices can be built on their own and different languages.
Leave a Reply