Microservice Transaction Orchestration via Persistent Tracking Log
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Maintaining state consistency in microservice architectures is challenging due to their distributed nature, leading to inconsistent states during transactions, where some microservices may succeed while others fail, resulting in incomplete or failed transactions.
Innovation Solution
An orchestration service tracks the state of transaction workflows by maintaining a persistent tracking log and initiating compensation actions to reverse successful actions in case of failures, ensuring atomic-like transaction execution and alerting administrators for manual intervention if necessary.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If microservices execute actions in a distributed architecture, then system scalability and flexibility are improved, but state consistency during transactions deteriorates
Solution Approach 1:
An orchestration service is introduced as an intermediary component that coordinates transactions across multiple microservices. The orchestration service maintains a tracking log and manages compensation actions to ensure state consistency, while microservices continue to operate independently and scalably.
Solution Approach 2:
The system performs preliminary actions by writing initial states to a tracking log before microservices execute their actions. This allows the orchestration service to track and manage transaction state in advance, enabling consistency maintenance even in distributed environments.
2Device complexity
If microservices execute actions independently, then system modularity is improved, but transaction completeness deteriorates
Solution Approach 1:
The orchestration service implements feedback mechanisms by monitoring the execution state of each microservice action through the tracking log. When inconsistencies or failures are detected, the system triggers compensation actions to restore transaction completeness, maintaining modular microservice architecture.
Solution Approach 2:
The system prepares compensation actions in advance for each microservice action. If a microservice fails to complete its action, the pre-prepared compensation action reverses the effect, ensuring transaction completeness while preserving microservice independence.
3Reliability
If compensation actions are initiated for failed transactions, then system reliability is improved, but processing time increases
Solution Approach 1:
Compensation actions are defined and prepared in advance alongside the original microservice actions. When a failure occurs, the system can immediately execute the pre-defined compensation action without delay, maintaining reliability while minimizing additional processing time.
Data Source
AI summary
Various examples are directed to systems and methods for orchestrating a first transaction workflow performed by a plurality of microservices. An orchestration service may write to a first tracking log a first log entry for a first action of the plurality of actions. The first tracking log may be stored at a persistent storage location that, for example, is accessible in the event that the orchestration service crashes. The first log entry may describe an initial state of the first action. The orchestration service may also write a second log entry for a second action of the plurality of actions to the first tracking log. The second log entry may describe an initial state of the second action. The orchestration service may determine that the first microservice successfully completed the first action and that the second microservice failed to complete the second action. The orchestration service may initiate a compensation action to reverse the first action.


