How semotpan/saga-orchestration works
Main Components
a. Microservices Layer:
• Reservation Service (Saga Orchestrator)
• Hotel Service
• Payment Service
b. Message Broker Layer:
• Apache Kafka
• Kafka Connect with Debezium
c. Data Layer:
• Individual PostgreSQL databases for each service
• Outbox tables for each service
Key Relationships to Highlight
a. Service Communication Flow:
• CDC flow from Outbox tables to Kafka via Debezium
• Saga orchestration flow from Reservation Service
b. Database Relationships:
• Each service connects to its dedicated database
• Outbox pattern implementation with CDC
Detailed Component Breakdown
For Reservation Service (Orchestrator):
[Reservation Service]
• API Layer (ReservationController)
• Saga Framework
• Saga Manager
• Saga State Machine
• Event Handlers
• Database
• Reservation Tables
• Saga State Tables
• Outbox Tables
For Hotel Service and Payment Service:
[Service]
• Domain Logic
• Event Handlers
• Database
• Domain Tables
• Outbox Tables
Implementation Details
a. Event Flow Patterns:
• Transactional Outbox pattern implementation
• CDC flows with Debezium
• Saga orchestration paths
b. State Management:
• Saga State Machine transitions
• Compensation paths
• Transaction boundaries
Technical Stack Indicators
• Java 21 & Spring Boot
• Apache Kafka
• Debezium
• PostgreSQL
• Docker containers
High-Level Architecture
• Services, databases, and Kafka
• Main communication paths
• Detail the reservation process
• Both happy and unhappy paths
• Compensation actions
Detailed Component Interaction
• Internal service components
• Outbox pattern implementation
• CDC flow with Debezium
Remember to:
• Version information
• Document all external dependencies
The eventual consistency model
This system design should clearly show how the project implements distributed transactions while maintaining data consistency across services through the Saga pattern.