How bayajidalam/saga-flow works
Main Components
a. Microservices (represent as rectangles):
• Order Service (Port 3000)
• Inventory Service
• Payment Service
• Notification Service
b. Message Broker:
• RabbitMQ (represent as a hexagon to distinguish it as the event bus)
• OrderCreated events
• InventoryUpdated events
• PaymentProcessed events
┌─ Services Layer ─────────────────────────┐
• ┌────────┐ ┌────────┐ ┌────────┐ │
• Order │ │Payment │ │Notif. │ │
• Service │ │Service │ │Service │ │
• ┘ └────────┘ └────────┘ │
• ▲ ▲ ▲ │
• ▼ ▼ ▼ │
• ┌─────── Message Broker ──────────┐ │
• RabbitMQ │ │
• ┘ │
• ┘
Event Flow Representation
• Order Service → RabbitMQ (OrderCreated)
• RabbitMQ → Inventory Service (OrderCreated)
• RabbitMQ → Payment Service (OrderCreated)
• Inventory Service → RabbitMQ (InventoryUpdated)
• RabbitMQ → Notification Service (InventoryUpdated)
• Payment Service → RabbitMQ (PaymentProcessed)
Additional Elements
Include:
• Port numbers where applicable (e.g., Order Service: 3000)
• Version/environment information
Technical Details to Note
Annotations showing:
• Node.js runtime for each service (indicated by package.json files)
• Docker Compose orchestration
• Event payload types (as notes)
Documentation Elements
Add:
• Title: "Microservices Choreography Architecture"
• Subtitle: "Event-Driven System with RabbitMQ"
• Version information
• Date of last update
Remember to:
• Use consistent spacing and alignment
• Critical interaction paths
• Failure scenarios or compensation events if applicable
• Document any assumptions made in the design