Orchestrating Microservices Using LlamaIndex Workflows
LlamaIndex·2025-10-13 17:01

Architecture and Workflow - Llama Index introduces a microservices architecture demo for e-commerce, breaking down a monolith into containerized services for specific jobs like front end, authentication, payments, orders, and stock management [1][2] - The demo uses Docker Compose for easy setup, requiring cloning the repository and running docker compose app -d [3] - The application structure includes front end, authentication, payment processing, orders, stock management, PostgreSQL for database, Kafka for event-driven communication, and Zookeeper for Kafka management [3] - Workflows are used for payments, orders, and stock management, triggered by events in Kafka, starting with data processing and syncing [3] - The workflow extracts structured data (order, payment, stock, item) from raw JSON data and builds a query to update the database [3] - The workflow ends by restituting the operation status (success or failure) and sending details back to Kafka [4] Data Flow and Communication - The front end sends orders as JSON data to a Kafka topic, which triggers workflows for payment, order creation, and stock update [4] - Each service (payments, orders, stock) subscribes to the orders topic and publishes operation statuses to separate partitions in the Kafka topic [4] - Payments write to partition zero, orders to partition one, and stock to partition two [5] - Operation statuses are streamed back to the front end, indicating success or failure of each operation [5] Demonstration and Potential Issues - The demo can be run locally by registering a user and placing an order, which triggers the described pipeline [7][8] - Failures in updating the order, placing the order, payment, and updating the stock may occur due to disturbances in communication [10]