官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 东莞市| 望城县| 海淀区| 沛县| 两当县| 衡阳市| 西宁市| 湘西| 仙居县| 天全县| 赤城县| 漠河县| 民县| 囊谦县| 南康市| 邻水| 石阡县| 永和县| 梅河口市| 大方县| 宽甸| 本溪市| 泽库县| 房产| 阜城县| 乌拉特后旗| 鄄城县| 凤城市| 辽阳市| 石城县| 锡林郭勒盟| 望奎县| 库伦旗| 泰兴市| 北京市| 克拉玛依市| 平山县| 丹江口市| 青浦区| 六盘水市| 安溪县|