- Building Microservices with .NET Core 2.0(Second Edition)
- Gaurav Aroraa
- 446字
- 2021-07-02 20:12:51
Understanding the microservice architecture
The microservice architecture is a way to develop a single application containing a set of smaller services. These services are independent of each other and run in their own processes. An important advantage of these services is that they can be developed and deployed independently. In other words, we can say that microservices are a way to segregate our services so they can be handled completely independent of each other in the context of design, development, deployment, and upgrades.
In a monolithic application, we have a self-contained assembly of a user interface, direct sales, and inventory. In the microservice architecture, the services part of the application changes to the following depiction:

Here, business components have been segregated into inpidual services. These independent services now are the smaller units that existed earlier within the self-contained assembly, in the monolithic architecture. Both direct sales and inventory services are independent of each other, with the dotted lines depicting their existence in the same ecosystem yet not bound within a single scope. Refer to the following diagram:

From the preceding diagram, it's clear that our user interface can interact with any of the services. There is no need to intervene in any service when a UI calls a service. Both the services are independent of each other, without being aware of when the other one would be called by the user interface. Both services are liable for their own operations and not for any other part in the whole system. Although much closer to the microservice architecture, the preceding visualization is not entirely a complete visualization of the intended microservice architecture.
In the microservice architecture, services are small, independent units with their own persistent stores.
Now let's bring this final change so that each service will have its own database persisting the necessary data. Refer to the following diagram:

Here, User interface is interacting with those services that have their own independent storage. In this case, when a user interface calls a service for direct sales, the business flow for direct sales is executed independently of any data or logic contained within the inventory service.
The solution that the use of microservices provides has a lot of benefits, as discussed next:
- Smaller codebase: Each service is small, and therefore, easier to develop and deploy as a unit
- Ease of independent environment: With the separation of services, all developers work independently, deploy independently, and no one is bothered about any module dependency
With the adoption of the microservice architecture, monolithic applications are now harnessing the associated benefits, as it can now be scaled easily and deployed using a service independently.
- Learn TypeScript 3 by Building Web Applications
- Python自動化運維快速入門
- Spring Boot+Spring Cloud+Vue+Element項目實戰:手把手教你開發權限管理系統
- 深入理解Java7:核心技術與最佳實踐
- Hadoop+Spark大數據分析實戰
- Mastering KnockoutJS
- 小學生C++創意編程(視頻教學版)
- Learning Probabilistic Graphical Models in R
- PySpark Cookbook
- Create React App 2 Quick Start Guide
- 區塊鏈技術與應用
- PHP 7 Programming Blueprints
- C語言從入門到精通(視頻實戰版)
- Mastering MeteorJS Application Development
- 代碼整潔之道:程序員的職業素養