ASO-Saga: Adaptive Saga Orchestration with Parallel Execution and Batched Compensation for Distributed Transactions in Enterprise Microservices

Main Article Content

Amit Mishra

Abstract

In a microservice architecture‚ the Saga pattern is the most widely used way to achieve consistency between databases․ In standard sagas‚ steps are always completed one after the other‚ coordinated in the same way and rolled back one at a time in case of a failure․ However‚ each transaction is slow‚ and recovery time is proportional to the number of services․ In this paper‚ we propose ASO-Saga‚ an adaptive saga orchestration framework with three mechanisms․ First‚ independent steps are executed concurrently at the same part of the dependency graph‚ and second‚ the hybrid dispatcher executes compensable steps in a command and final non-compensable steps in an event․ Third‚ batched idempotent compensation cancels all completed steps in parallel using a small saga log․ A multi-process prototype using one database per service was compared to sequential orchestration and event choreography in an e-commerce order saga․ With 1 to 25 virtual users‚ an increase of 15% to 32% in throughput and a decrease of 18% to 27% in median latency was achieved with ASO-Saga․ The baseline recovery time went from 3․5 ms to 23․5 ms with 2 to 8 services․ ASO-Saga also kept the recovery time below 4․1 ms (83% faster)․ When the message loss was between 0․5 and 2%‚ ASO-Saga and orchestration kept every failed saga consistent‚ while choreography failed in 9% to 27% of cases․ An ablation study shows that two optimizations from ASO-Saga are parallel execution and batched compensation․ One trade-off is that failure at one level in parallel execution requires an additional compensation for the sibling step․ This thus leads to improvements in saga performance while preserving orchestration consistency guarantees․

Article Details

Section
Articles