Another key characteristic of a Microservice is that it is independently changeable. We can upgrade, enhance, or fix a specific Microservice without changing any of the clients or any of the other services within the system.
In the Microservices architecture, each microservice has its own data storage. By modifying one Microservice, we should then be able to deploy that change within the system independently without deploying anything else.
Sample Microservices architecture app
The preceding image depicts a high-level architecture diagram for a Microservices system. This is an example of a typical e-commerce system, and as you can see on the left-hand side, there's a shopping website running in the customer's browser, or it could be a mobile app using the API gateway.
The browser connects to the demo shopping website via the internet--the demo shopping website might be an ASP.NET MVC website running on IIS. All the processing required for all the interactions with the website is actually carried out by a number of Microservices which are running in the background.
Each Microservice has a single focus, or a single set of related functions, has its own data storage, and it's also independently changeable and deployable. So, for example, we could upgrade the Orders service without upgrading any other part of this system.
There might also be multiple instances for each type of Microservice. For example, if the Orders service is in demand, we might have several instances of the Orders service in order to satisfy the demand. And in order to direct a request from the shopping website to the correct instance of an order service, we have an API Gateway which manages and routes a request to the correct Microservice within the system.
So, in this example, when a customer places an order, the shopping website might use multiple services and multiple functions within those services in order to satisfy that transaction. And this is why, in the Microservices architecture, a transaction is normally a distributed transaction, because the transaction is actually satisfied by multiple pieces of software, that is, Microservices.