- Cloud-Native Applications in Java
- Ajay Mahajan Munish Kumar Gupta Shyam Sundar
- 359字
- 2021-06-24 19:07:23
Capabilities for microservices coordination
This section lists the capabilities that the composite services require:
- State management: Often the state manager component is required to manage the output state of the services that it is coordinating. This state will need to be held in a persistent store that is immune to server-side state management (SSM) failure. Another SSM instance should be able to retrieve the state and start where it left off.
- Transaction control: Transaction boundaries are affected by microservices. Two separate function calls to two methods in a single transaction now become two separate service calls through a composite service. There are two approaches to handle this scenario.
- Distributed transactions: These support the two-phase commit protocol. They are not scalable, increase latency and deadlocking scenarios, and need expensive products and infrastructure to support them. They may not be supported over selected protocols, such as REST or messaging. The benefit of this style is that the system is always in a consistent state.
- Compensating transactions: Where the transaction control is functionally enforced by running functionally reverse transactions instead of trying to roll back to an earlier transaction. This is a more decoupled, and hence scalable, approach.
We would recommend compensating transactions over distributed transactions due to simplification in the technical product requirements.
- Post service call coordination: Atomic service calls can result in success, that is, when the constituent services have finished their work successfully; or a failure, when either of the coordination services has either not responded or failed in processing due to a technical or functional error. The composite service will need to get the response of the completed services and decide on the next step of action.
- Timeout handling: Initiate a timer when starting a microflow. If the services do not respond in a particular time from starting the microflow, then raise an event to send to the event bus.
- Configurability: Multiple instances of the SSM component will run to cater for various microflows. In each of the microflows, the service coordination, timer, and actions will differ. Hence, it is important to provide a framework that can have parameterized configuration of the timers, compensation transactions, and post-processing actions.
推薦閱讀
- 無(wú)線接入網(wǎng)同步性能測(cè)試技術(shù)
- 西門(mén)子工業(yè)網(wǎng)絡(luò)通信技術(shù)詳解
- LTE無(wú)線網(wǎng)絡(luò)優(yōu)化實(shí)踐
- 印制電路組件裝焊工藝與技術(shù)
- 半導(dǎo)體制造技術(shù)導(dǎo)論
- 開(kāi)關(guān)電源與LED照明的優(yōu)化設(shè)計(jì)應(yīng)用
- 走進(jìn)業(yè)余無(wú)線電
- 振動(dòng)信號(hào)的盲源分離技術(shù)及應(yīng)用
- iOS游戲框架Sprite Kit技術(shù)詳解
- 電子工藝與課程設(shè)計(jì)
- Premiere影視動(dòng)畫(huà)后期合成
- 6G需求與愿景(精裝版)
- 3D顯示技術(shù)
- 空間信號(hào)協(xié)同處理理論與技術(shù)
- 移動(dòng)互聯(lián)網(wǎng)概論 第2版