Choreography-Based Saga Architecture and Django Microservices Implementation
Choreography-Based Saga Architecture: Here's a detailed walkthrough: Steps in the Saga Step 1: Initiating the Saga (POST /orders) A client sends a POST request to the Order Service to create an order. The Order Service processes this request, creates an Order entity (aggregate), and publishes an Order Created event to the Order Events Channel . Step 2: Order Created Event The Order Created event flows through the Order Events Channel to notify interested services (e.g., Customer Service ) about the creation of the order. The event contains details about the order, such as its ID, total amount, and customer ID. Step 3: Reserve Credit (POST /customer) The Customer Service receives the Order Created event and attempts to reserve the required credit for the order. If the credit limit is sufficient: It updates the Customer entity (aggregate) to reserve the credi...