Microservice Synchronization via Event-Driven Choreography
Solution Overview
Problem
Conventional approaches for composing microservices to form transactions, such as the two-phase-commit pattern and saga patterns, often deprive individual microservices of their independence, especially when high variability is required, and do not allow for easy addition of new variants without changing backend code or frameworks.
Innovation Solution
A data-driven choreography of microservice sagas using a federated mutation approach based on a data query and manipulation schema and a message bus, where microservices publish their mutation parameters as part of a supergraph, and dependencies are resolved by listening for completion events, allowing for independent operation and addition of new microservices without an orchestrating service.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If conventional approaches (two-phase-commit or saga patterns with orchestration) are used to compose microservices, then transaction reliability is improved, but microservice independence deteriorates
Solution Approach 1:
Each microservice independently publishes its own completion events and handles its own state transitions without external orchestration. The microservices self-manage their transaction participation by listening for events from other services and autonomously determining their next actions based on event schemas, eliminating the need for a central orchestrator while maintaining transaction reliability.
Solution Approach 2:
The transaction logic is segmented and distributed across individual microservices rather than centralized. Each microservice maintains its own event subscription logic and state management, allowing independent deployment and modification of individual services while participating in coordinated transactions through published events.
2Reliability
If orchestration or choreography workflows are used to drive microservice composition, then transaction coordination is improved, but system complexity increases
Solution Approach 1:
An event schema registry acts as an intermediary that stores and validates event definitions without driving transaction flow. The registry provides a centralized interface for event schema management and validation, reducing complexity by separating event definition from event-driven logic implementation in individual microservices.
Solution Approach 2:
Microservices independently implement their own event listening and state transition logic based on published schemas, eliminating the need for complex orchestration workflows. Each service self-manages its participation in transactions by autonomously processing events it subscribes to and transitioning its state accordingly.
3Adaptability or versatility
If backend code or frameworks are changed to add new microservice variants, then adaptability is improved, but ease of manufacture deteriorates
Solution Approach 1:
The system dynamically adapts to new microservice variants through event schema registration rather than code changes. New services are integrated by publishing their event schemas to the registry and subscribing to relevant events, allowing flexible composition without modifying existing backend code or frameworks.
Solution Approach 2:
The event-driven architecture with schema registry provides a universal interface for all microservices regardless of their specific function or variant. All services interact through standardized event publishing and subscription mechanisms, enabling new variants to be added without changing the core system infrastructure or existing service code.
Data Source
AI summary
The disclosed system and methods are directed to a data-driven choreography of microservices sagas that enable the composition of microservices without depriving each individual microservice of its independence.


