Design: Distributed Transaction Management using Saga Pattern
Design the saga orchestration and choreography mechanisms for distributed transactions. Out of scope: detailed microservice business logic, database schema design for individual services.
Functional Requirements
FR1: Support transactions that span multiple microservices or databases
FR2: Ensure data consistency across services without using distributed locks
FR3: Handle failures by compensating or undoing partial work
FR4: Allow concurrent transactions without blocking
FR5: Provide visibility into transaction status for monitoring
Non-Functional Requirements
NFR1: Must support at least 1000 concurrent distributed transactions
NFR2: End-to-end transaction latency should be under 2 seconds on average
NFR3: System availability target of 99.9% uptime
NFR4: Services are loosely coupled and communicate asynchronously
NFR5: No global distributed transaction coordinator allowed
