The following list can be used as a general guide to choosing a microservice architecture. This is not a definitive list, but gives you an idea of when to go with a microservice architecture over a monolithic architecture. Note that, unlike choosing a monolithic architecture, the decision here is more complex and may involve consideration of many of the following points:
- When the application scope is large and well defined and you are sure that the application will grow tremendously in terms of features—for example, an online e-commerce store, a social media service, a video streaming service with a large user base (yes, I'm thinking of Netflix), or an API provider
- When the team size is large and there are enough members to effectively develop individual components independently
- When the average skill set of the team is good and team members are confident about advanced microservice patterns
- When the initial time to market is not critical as the microservice architecture will take more time to get going initially
- When you are ready to spend more on infrastructure, monitoring, and so on, in order to improve the product quality
- When your user base is huge and you expect it to grow—for example, a social media application targeting users all over the world
Though a monolithic architecture would suffice in most cases, and you should choose it for simpler use cases, investing upfront in a microservice architecture will reap long-term benefits when the application scope is large and you know it will grow further. There is no silver bullet and there are always trade-offs.
For more on these architecture patterns, you can refer to a nice blog post at https://articles.microservices.com/monolithic-vs-microservices-architecture-5c4848858f59.