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

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.
主站蜘蛛池模板: 松桃| 瑞昌市| 乌海市| 铜山县| 青州市| 上饶市| 永和县| 扎赉特旗| 岑巩县| 资阳市| 丰顺县| 东宁县| 江孜县| 阳西县| 泊头市| 凭祥市| 大丰市| 广汉市| 灌南县| 张掖市| 建瓯市| 无锡市| 大邑县| 永和县| 邳州市| 婺源县| 偃师市| 仲巴县| 霸州市| 大同县| 涿鹿县| 河间市| 彰化市| 法库县| 青田县| 盐城市| 岑巩县| 泾源县| 营口市| 秦皇岛市| 呈贡县|