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

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 user interface, direct sale, and inventory. In the microservice architecture, the services part of the application changes to the following depiction:

Here, business components have been segregated into individual 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 image, 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:

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 likely benefits, as discussed next:

  • Smaller codebase: Each service is small, 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.

主站蜘蛛池模板: 襄汾县| 林芝县| 江华| 朝阳市| 仙居县| 安泽县| 罗甸县| 沙洋县| 手游| 新化县| 会昌县| 额济纳旗| 双柏县| 靖江市| 曲麻莱县| 黄平县| 周至县| 安达市| 平塘县| 乳源| 洪洞县| 遂昌县| 宜州市| 红桥区| 合肥市| 牙克石市| 盐津县| 红原县| 贺兰县| 黄梅县| 郎溪县| 友谊县| 常熟市| 盐城市| 万山特区| 乳山市| 土默特右旗| 晋中市| 剑阁县| 纳雍县| 连云港市|