Let's look at some of the reasons why you might want to choose microservices for your applications. Not every application should utilize microservices, as you will see in the next section. Very distinct reasons warrant the use of microservices. Let's take an example to justify why we want to choose microservices.
Let's pretend you want to develop a simple e-commerce app. If we say that there are three different elements of microservices in an app, User, Product, and Order. The app should cover the following features:
- User: Log in
- User: Register
- User: Change addresses
- User: Change payment methods
- Products: Show the list of products in a category
- Products: Show details about an individual product
- Order: Submit an order of products
- Order: Submit payment for an order
You could develop the backend for such an app as a monolith...