OrderSaga is a distributed transaction orchestration system designed to solve the consistency problem in microservices. It implements the Choreography-based Saga Pattern to ensure that multi-service operations (Order -> Inventory -> Payment) are either 100% completed or gracefully rolled back using compensating transactions.
Launch the entire cluster in 2 steps:
# 1. Start Infrastructure (RabbitMQ + Postgres)
docker-compose up -d
# 2. Start Services (Order, Inventory, Payment, UI)
npm install && npm run devDetailed Setup: See GETTING_STARTED.md.
Monitoring transactions as they flow through the RabbitMQ bus.
Decoupled microservices communicating via an asynchronous event bus.
Visualizing the automated undo logic when a payment step fails.
Deep Dive: See ARCHITECTURE.md for Decision Logs and HLD.
- ⚡ Choreography-based Saga: Decentralized transaction state management.
- 🔄 Automatic Rollbacks: Built-in compensation logic for failed payments.

- 📦 Idempotent Consumers: Safe message redelivery without data duplication.
- 📊 Transaction Telemetry: Real-time observability of event status.
Understanding how a user click propagates through the distributed system:
- Command: User initiates order (creates
PENDINGrecord). - Notification:
ORDER_CREATEDevent published to RabbitMQ. - Reservation: Inventory service marks stock as
RESERVED. - Charge: Payment service attempts credit card auth.
- Completion: On success, order marks as
CONFIRMED. On failure, triggers compensation.
| Document | Description |
|---|---|
| System Architecture | Deep dive into Saga vs Orchestration and LLD. |
| Getting Started | Step-by-step setup and env configuration. |
| Failure Scenarios | Resilience testing and chaos engineering results. |
| Interview Q&A | Executive summary and system design pitch. |
| Component | Technology | Role |
|---|---|---|
| Messaging | RabbitMQ | Asynchronous Event Bus. |
| Services | Node.js / TS | Core Microservices logic. |
| Database | PostgreSQL | Distributed Persistent State. |
| Interface | Next.js 14 | Transaction Monitoring UI. |
Harshan Aiyappa
Senior Full-Stack Hybrid Engineer
GitHub Profile
This project is licensed under the MIT License - see the LICENSE file for details.