- Hands-On Microservices:Monitoring and Testing
- Dinesh Rajput
- 264字
- 2021-06-24 18:24:29
Context boundaries
A module is just a way of defining a context boundary. If you want to migrate your existing monolithic application to a microservice-based application, you first have to identify a hidden context within your current application. This means we have to define the context and draw explicit context boundaries. This helps us design a robust microservice-based application.
For example, a typical online book shopping portal can have an order and shipping module using the same entity product. The following diagram shows the context boundaries of this application:
As you can see in the preceding diagram, the distributed application is based on different bounded contexts. The preceding design is a modular application design, where every module runs an independent process as a service. This is a decentralized approach to application design.
Once you have defined context boundaries, you can then easily decompose your existing monolithic application into a microservice-based application, where each bounded context has one microservice. In the example shown in the previous diagram, we have divided our monolithic application into four bounded contexts, which means that there are four microservices: Order Service, Book Service, Shipping Service, and Customer Service.
We now have a separate product entity in the Order Service and the Shipping Service, which each have their respective repositories. This concept can be extended by defining explicit context boundaries for the Stock and Inventory modules and creating an independent microservice for each.
Let's have a look at two different decomposition approaches. A monolithic application can be decomposed based on either its business capability or its domain.
- 網(wǎng)絡(luò)云百問百答
- 黑客攻防實(shí)戰(zhàn)技術(shù)完全手冊:掃描、嗅探、入侵與防御
- Cisco OSPF命令與配置手冊
- 物聯(lián)網(wǎng)安全:理論、實(shí)踐與創(chuàng)新
- 5G承載網(wǎng)網(wǎng)絡(luò)規(guī)劃與組網(wǎng)設(shè)計(jì)
- 網(wǎng)絡(luò)故障現(xiàn)場處理實(shí)踐(第4版)
- Force.com Development Blueprints
- 面向云平臺的物聯(lián)網(wǎng)多源異構(gòu)信息融合方法
- 計(jì)算機(jī)網(wǎng)絡(luò)工程實(shí)用教程(第2版)
- 射頻通信系統(tǒng)
- INSTANT KineticJS Starter
- React Cookbook
- Getting Started with nopCommerce
- 從實(shí)踐中學(xué)習(xí)手機(jī)抓包與數(shù)據(jù)分析
- 異構(gòu)蜂窩網(wǎng)絡(luò)關(guān)鍵理論與技術(shù)