---
title: "Saga Pattern (Distributed Transactions) — Definition & Engineering Context"
description: "The Saga Pattern is a microservices design pattern for managing long-running distributed transactions across multiple services without using two-phase commit (2PC), coordinating rollback through compensating transactions."
canonical: https://erpstack.io/glossary/saga-pattern
markdown_url: https://erpstack.io/glossary/saga-pattern.md
publisher: ERPStack
---

# Saga Pattern (Distributed Transactions)

> **Definition:** The Saga Pattern is a microservices design pattern for managing long-running distributed transactions across multiple services without using two-phase commit (2PC), coordinating rollback through compensating transactions.

## In depth

In a microservices ERP, creating a purchase order might involve updating inventory, creating a billing record, and notifying a supplier API — across three separate services. If the supplier API call fails, the inventory reservation must be reversed. The Saga Pattern coordinates this using either a centralized orchestrator or a choreography of events, ensuring eventual consistency without distributed locking.

## How ERPStack applies this

We implement Saga orchestration using AWS Step Functions for complex multi-service ERP workflows, defining explicit compensating transactions for each step to guarantee clean rollback on partial failures.

## Related reading

- [Microservices Architecture](https://erpstack.io/glossary/microservices)
- [Event-Driven Architecture](https://erpstack.io/glossary/event-driven)
- [ACID Compliance](https://erpstack.io/glossary/acid-compliance)
