Saga Client: Server
POST /api/orders
1. Executive Summary The SAGA pattern is a failure-management pattern that helps maintain data consistency across microservices without using distributed transactions (e.g., two-phase commit). In a client-server context, the SAGA pattern defines how a client request triggers a sequence of local transactions across multiple servers, with compensating transactions to undo changes if a step fails. This report analyzes the roles, communication models, coordination strategies, and implementation considerations for SAGA-based client-server systems. 2. Introduction Traditional ACID transactions assume a single database and short-lived locks. In modern microservice architectures, a single client operation (e.g., placing an order) may span multiple independent servers (e.g., Order Service, Payment Service, Inventory Service). The SAGA pattern ensures that either all steps complete successfully or that partial failures are compensated. saga client server
"userId": 123, "items": ["productId": 456, "quantity": 2], "paymentMethod": "credit_card" POST /api/orders 1