Saga Pattern
A design pattern for managing distributed transactions across multiple services by breaking them into a sequence of local transactions with compensating actions for rollback on failure.
In a microservices architecture, a single business operation often spans multiple services, each with its own database. Traditional ACID transactions cannot span service boundaries, so the saga pattern coordinates these distributed operations through a sequence of local transactions, each with a corresponding compensating action that undoes its effects if a later step fails.
There are two main saga implementations. Choreography-based sagas use events: each service publishes an event when its local transaction completes, and the next service reacts to that event. Orchestration-based sagas use a central coordinator that explicitly calls each service in sequence and handles compensation on failure.
For AI-powered workflows, sagas are relevant when an AI decision triggers a chain of actions. An AI-powered order system might reserve inventory, process payment, schedule shipping, and send confirmation. If payment fails, the saga's compensating actions automatically release the inventory reservation and cancel the shipping request, maintaining system consistency without a distributed transaction.
Related Terms
A/B Testing
A controlled experiment comparing two or more variants to determine which performs better on a defined metric, using statistical methods to ensure reliable results.
Feature Flag
A software mechanism that enables or disables features at runtime without deploying new code, used for gradual rollouts, A/B testing, and targeting specific user segments.
MLOps
The set of practices combining machine learning, DevOps, and data engineering to reliably deploy, monitor, and maintain ML models in production.
Model Serving
The infrastructure and systems that host trained ML models and handle inference requests in production, optimizing for latency, throughput, and cost.
Semantic Search
Search that understands the meaning and intent behind a query rather than just matching keywords, typically powered by embedding-based similarity comparison.
CI/CD (Continuous Integration / Continuous Deployment)
An automated software practice where code changes are continuously integrated into a shared repository, tested, and deployed to production, reducing manual intervention and accelerating delivery cycles.