Orchestrating Microservices Using LlamaIndex Workflows
Key Takeaways
The video demonstrates how to use LlamaIndex Workflows to orchestrate microservices in an e-commerce system, leveraging Docker, Apache Kafka, and event-driven communication to manage payments, orders, and stock updates.
Full Transcript
Hi everyone, Cleia here from Llama Index and today we're going to talk about how to use Lama index workflows with microservices. As we know microservices are a specific type of architecture which instead of having uh all the services and all the dependencies of your application in one big monolith. break down that monolith into single containerized services that are able to um that are able to do a very specific job. For example, in um e-commerce um you know e-commerce environment which is the uh example that we're going to that we're going to dive into today with llama index workflows. Um, we have a micros service that for example handles the front end and and the authentication. Uh, one that handles payments, one that handles orders and one for example that updates the stock meaning the available items that we have in our stock. So in order to um follow up in order to follow with this demo um I uh advise you to look for this uh GitHub repository which will be uh which we'll be looking into uh today like following along with the following along with the readme. So as you can see uh this is a docker based uh this is a docker based I would say demo uh in the quick start you just need to uh clone the repository and just run docker compose app minusd and go to localhost 8000 and as you can see here we have an explanation of how the application is structured as I as I was saying earlier we have a front end and authentication payment processing orders, stock management and then we have posris, CFKA and so keeper as you can see posris is basically the database that keeps track of payments orders and stock and cafka instead is the event-driven communication between microservices streaming orders to the payments order and stock processing services and getting back the status of the processing operations and zookeeper and zookeeper is basically just doing cafka management uh we're not super interested in the stock of front end authentication which is basically a go web server but what we're interesting in is how we're handling workflows how we're using workflows to handle uh handle the processing basically because we're using workflows for payments orders and managing our stock and how are we using this workflows so we detect first of all we detect an event in CFKA this event triggers the start of a workflow and the first step of a workflow is basically data processing sync. So we take the data, we take the row data of the event which is passed in as row JSON data and we extract the structure data order, payment, stock, item, whatever it is. And so after that what we do is we take the structure data and we build a query with the structured data to update a database being it inserting an order or a payment or updating the available number of a specific stock item. After that we end the workflow and the workflow will restitute the status of the operation. So the operation succeeded the operation did not succeed and we send this operation details back to Kafka. So as you can see here we have as we said front end that sense the order as JSON data the payments the order and the stalker subscribed all to one Kafka topic which is orders each of which of this uh services through a workflow the workflow that we just detailed sends a payment creates an order update yeah the stock of the an item in the stock and once they're done they produce uh a they produce success detail operation like an operation detail with the type of the operation for example payment the success false true like it's successful or not and the ID of the order that we processed and each of these operation types operation statuses get basically written to one partition per service. So the payments right to the partition zero, the status right to partition one and the for sorry the orders right to partition one and the stop rights to partition two. All of this operation status get streamed back to the front end which will tell us uh since there might be some as as we know like on small scale services there might be some disturbances there might be some errors and it will tell us what went good what went well and what did not. Okay. So we can run this docker compose app minus d. So this is obvious this will obviously uh kick off uh pulling images like cafka poseper if you don't have them already installed and it will kick off the build of spec of the specific images for the services that we have the main service and all the other services because they are build based and not image based but with me I already did that so it won't pull the images it will directly start the containers so as you can see Here it started containers. Everything should be working fine. As you can see here, all my containers are up. All my services are up and running. So I can now go to localhost localhost 8000. I am not I am not I would say uh logged in. So I would go to register and create a user. So now just to have it in mind. So my username, my password and I will sign in. That's great. Now we have different things we can do. We can buy. As you can see this is very a very simple demo. So we are going to use Monopoly dollars and we are going to buy our cozy socks. and what I do now is that I place my order. All of these uh details when I place my order will be processed through this pipeline. Okay, so order ID amount will go through each of the workflows. uh obviously in parallel. So since we have Kafka, each of these is triggered each of the workflows is triggered when one order is published on the orders topic. So these workflows run in parallel. So they're not sequential. They publish the data to the POSSQL database and they publish the status of their operation status to each of the partitions of the Kafka topic or status which will read read back which will be read back by the front end. And now as we can see we had uh failures we had failed failures in updating uh the order failure in placing the order failure in the payment and failure in updating the stock. This might happen because obviously this is like as I said mocks a um a small scale e-commerce shop. So there might be disturbances in the uh communication and and and stuff like this. But it might happen also that you have everything green and so you will have basically everything gets and that's almost that's basically everything. If you have uh if you want to try this out you can just uh go to github.com/astrobbert/workloss microservices and you can clone this repository and just run it with docker and you can also take a better look at the code. So, thank you all for following along and hope to see you in the next video.
Original Description
What if you could orchestrate your entire microservices setup using LlamaIndex Workflows? In this demo, Clelia shows how to spin up and connect an event-driven e-commerce system powered by LlamaIndex Workflows, Docker, and Apache Kafka with minimal overhead.
🖥️ Try it yourself: https://github.com/AstraBert/workflows-microservices
📚 Learn more: https://developers.llamaindex.ai/python/workflows/?utm_source=youtube&utm_medium=li_channel
#LlamaIndex #Microservices #Kafka #Docker
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from LlamaIndex · LlamaIndex · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
LlamaIndex Virtual Meetup (May 4th, 2023)
LlamaIndex
LlamaIndex + MongoDB Workshop/Fireside Chat
LlamaIndex
Discover LlamaIndex: Ask Complex Queries over Multiple Documents
LlamaIndex
Discover LlamaIndex: Document Management
LlamaIndex
Discover LlamaIndex: Joint Text to SQL and Semantic Search
LlamaIndex
Discover LlamaIndex: JSON Query Engine
LlamaIndex
LlamaIndex Webinar: Active Retrieval Augmented Generation
LlamaIndex
LlamaIndex Webinar: Demonstrate-Search-Predict (DSP) with Omar Khattab
LlamaIndex
LlamaIndex Sessions: Practical challenges of building a Legal Chatbot over your PDFs
LlamaIndex
LlamaIndex Webinar: Graph Databases, Knowledge Graphs, and RAG with Wey (NebulaGraph)
LlamaIndex
LlamaIndex Webinar: Community Project Showcase (07/07/2023)
LlamaIndex
LlamaIndex Webinar: LLMs for Investment Research (with Didier Lopes, co-founder/CEO at OpenBB)
LlamaIndex
Discover LlamaIndex: Bottoms-Up Development With LLMs (Part 1, LLMs and Prompts)
LlamaIndex
Discover LlamaIndex: Bottoms-Up Development With LLMs (Part 2, Documents and Metadata)
LlamaIndex
Discover LlamaIndex: Key Components to build QA Systems
LlamaIndex
Discover LlamaIndex: Bottoms-Up Development with LLMs (Part 3, Evaluation)
LlamaIndex
LlamaIndex Webinar: From Prompt to Schema Engineering with Pydantic (with @jxnlco)
LlamaIndex
Discover LlamaIndex: Bottoms-Up Development with LLMs (Part 4, Embeddings)
LlamaIndex
Discover LlamaIndex: Custom Retrievers + Hybrid Search
LlamaIndex
LlamaIndex Webinar: Document Metadata and Local Models for Better, Faster Retrieval
LlamaIndex
LlamaIndex Webinar: Build Personalized AI Characters with RealChar
LlamaIndex
LlamaIndex Webinar: Make RAG Production-Ready
LlamaIndex
LlamaIndex Workshop: Building RAG with Knowledge Graphs
LlamaIndex
Discover LlamaIndex: Introduction to Data Agents for Developers
LlamaIndex
LlamaIndex Webinar: Finetuning + RAG
LlamaIndex
Discover LlamaIndex: SEC Insights, End-to-End Guide
LlamaIndex
Discover LlamaIndex: Custom Tools for Data Agents
LlamaIndex
LlamaIndex Sessions: Building a Lending Criteria Chatbot in Production
LlamaIndex
Discover LlamaIndex: Bottoms-Up Development with LLMs (Part 5, Retrievers + Node Postprocessors)
LlamaIndex
LlamaIndex Webinar: How to Win a LLM Hackathon
LlamaIndex
LlamaIndex Webinar: LLM Challenges in Production (w/ Mayo Oshin, AI Jason, Dylan from Starmorph)
LlamaIndex
LlamaIndex Webinar: Agents Showcase!
LlamaIndex
LlamaIndex Webinar: Learn about DSPy
LlamaIndex
LlamaIndex Webinar: Time-based retrieval for RAG (with Timescale)
LlamaIndex
LlamaIndex Webinar: Build/Break/Test LLM Apps Showcase (co-hosted with TrueEra, Pinecone)
LlamaIndex
LlamaIndex Workshop: Evaluation-Driven Development (EDD)
LlamaIndex
LlamaIndex Webinar: Building LLM Apps for Production, Part 1 (co-hosted with Anyscale)
LlamaIndex
LlamaIndex Webinar: Learn about Fine-tuning + RAG (w/ Victoria Lin, author of RA-DIT)
LlamaIndex
LlamaIndex Webinar: What's next for AI after OpenAI Dev Day?
LlamaIndex
Introducing create-llama
LlamaIndex
LlamaIndex Webinar: PrivateGPT - Production RAG with Local Models
LlamaIndex
Multi-modal Retrieval Augmented Generation with LlamaIndex
LlamaIndex
LlamaIndex Webinar: LLaVa Deep Dive
LlamaIndex
A deep dive into Retrieval-Augmented Generation with Llamaindex
LlamaIndex
LlamaIndex Workshop: Multimodal + Advanced RAG Workhop with Gemini
LlamaIndex
LlamaIndex Webinar: Efficient Parallel Function Calling Agents with LLMCompiler
LlamaIndex
Introduction to Query Pipelines (Building Advanced RAG, Part 1)
LlamaIndex
LLMs for Advanced Question-Answering over Tabular/CSV/SQL Data (Building Advanced RAG, Part 2)
LlamaIndex
LlamaIndex Webinar: Advanced Tabular Data Understanding with LLMs
LlamaIndex
Ollama X LlamaIndex Multi-Modal
LlamaIndex
Build Agents from Scratch (Building Advanced RAG, Part 3)
LlamaIndex
LlamaIndex Webinar: Build No-Code RAG with Flowise
LlamaIndex
LlamaIndex Sessions: Practical Tips and Tricks for Productionizing RAG (feat. Sisil @ Jasper)
LlamaIndex
Introduction to LlamaIndex v0.10
LlamaIndex
Build SELF-DISCOVER from Scratch with LlamaIndex
LlamaIndex
Introducing LlamaCloud (and LlamaParse)
LlamaIndex
LlamaIndex Sessions: 12 RAG Pain Points and Solutions
LlamaIndex
LlamaIndex Webinar: RAG Beyond Basic Chatbots
LlamaIndex
A Comprehensive Cookbook for Claude 3
LlamaIndex
LlamaIndex Webinar: RAPTOR - Tree-Structured Indexing and Retrieval
LlamaIndex
More on: Systems Design Basics
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
Monolith vs Microservices: A Real-World Architectural Autopsy
Dev.to · Erwin Wilson Ceniza2
FOV in FPS Games: The Math Behind Field of View Settings
Dev.to · Alex Carter
How I Structured My Next.js 14 App Router Project — And Why It Scales
Dev.to · Mbanefo Emmanuel Ifechukwu
Let’s write a simple Lexer in Go
Medium · Programming
🎓
Tutor Explanation
DeepCamp AI