<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shalini Srivastava</title>
    <description>The latest articles on DEV Community by Shalini Srivastava (@shalini2410).</description>
    <link>https://dev.to/shalini2410</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3982109%2F694aeae1-076f-443b-9dcb-020d1eb842ed.png</url>
      <title>DEV Community: Shalini Srivastava</title>
      <link>https://dev.to/shalini2410</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shalini2410"/>
    <language>en</language>
    <item>
      <title>Build an AI Pipeline FastAPI + Kafka + Workers</title>
      <dc:creator>Shalini Srivastava</dc:creator>
      <pubDate>Tue, 16 Jun 2026 03:29:45 +0000</pubDate>
      <link>https://dev.to/shalini2410/build-an-ai-pipelinefastapi-kafka-workers-3g4o</link>
      <guid>https://dev.to/shalini2410/build-an-ai-pipelinefastapi-kafka-workers-3g4o</guid>
      <description>&lt;p&gt;Most AI demos work perfectly on a laptop.&lt;/p&gt;

&lt;p&gt;But production AI systems can become fragile when everything is handled inside one synchronous API call.&lt;/p&gt;

&lt;p&gt;A user sends a request.&lt;/p&gt;

&lt;p&gt;The API extracts text.&lt;/p&gt;

&lt;p&gt;The API chunks the content.&lt;/p&gt;

&lt;p&gt;The API generates embeddings.&lt;/p&gt;

&lt;p&gt;The API stores data.&lt;/p&gt;

&lt;p&gt;The API waits for everything to finish.&lt;/p&gt;

&lt;p&gt;This may look simple in a demo, but it quickly becomes a problem in real systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with one giant API call
&lt;/h2&gt;

&lt;p&gt;In many AI applications, the API is expected to do too much.&lt;/p&gt;

&lt;p&gt;For example, in a document processing or RAG pipeline, one request may trigger multiple heavy steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;text extraction&lt;/li&gt;
&lt;li&gt;chunking&lt;/li&gt;
&lt;li&gt;embedding generation&lt;/li&gt;
&lt;li&gt;indexing&lt;/li&gt;
&lt;li&gt;summarization&lt;/li&gt;
&lt;li&gt;database updates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If all of this happens inside one synchronous request, the API becomes slow and fragile.&lt;/p&gt;

&lt;p&gt;If one downstream step fails, the complete request may fail.&lt;/p&gt;

&lt;p&gt;If traffic increases suddenly, the API may become overloaded.&lt;/p&gt;

&lt;p&gt;This is why event-driven architecture becomes useful for AI workloads.&lt;/p&gt;

&lt;h2&gt;
  
  
  A better approach: API + Kafka + workers
&lt;/h2&gt;

&lt;p&gt;Instead of making the API do everything, we can split the workflow into smaller services.&lt;/p&gt;

&lt;p&gt;The API accepts the request and publishes an event.&lt;/p&gt;

&lt;p&gt;Background workers consume events and continue the processing asynchronously.&lt;/p&gt;

&lt;p&gt;A simple flow looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Request
   ↓
FastAPI
   ↓
Kafka / Redpanda Topic
   ↓
Python Worker
   ↓
Next Processing Stage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my practical demo, I am using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FastAPI&lt;/li&gt;
&lt;li&gt;Redpanda&lt;/li&gt;
&lt;li&gt;Python workers&lt;/li&gt;
&lt;li&gt;Docker Compose&lt;/li&gt;
&lt;li&gt;Kafka-compatible messaging&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Redpanda?
&lt;/h2&gt;

&lt;p&gt;Redpanda is Kafka-compatible, which makes it useful for local demos and event-driven architecture experiments.&lt;/p&gt;

&lt;p&gt;It allows us to work with Kafka-style topics, producers, and consumers while keeping the setup simple for development.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this architecture gives us
&lt;/h2&gt;

&lt;p&gt;This approach helps with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;decoupling services&lt;/li&gt;
&lt;li&gt;handling bursty workloads&lt;/li&gt;
&lt;li&gt;moving long-running tasks to background workers&lt;/li&gt;
&lt;li&gt;improving scalability&lt;/li&gt;
&lt;li&gt;isolating failures&lt;/li&gt;
&lt;li&gt;building production-style AI pipelines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This pattern is especially useful for AI systems involving:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;document processing&lt;/li&gt;
&lt;li&gt;chunking&lt;/li&gt;
&lt;li&gt;embeddings&lt;/li&gt;
&lt;li&gt;RAG indexing&lt;/li&gt;
&lt;li&gt;summarization&lt;/li&gt;
&lt;li&gt;long-running background jobs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Key architecture idea
&lt;/h2&gt;

&lt;p&gt;The API should not behave like a worker.&lt;/p&gt;

&lt;p&gt;The API should accept the request, publish an event, and return quickly.&lt;/p&gt;

&lt;p&gt;Workers should handle the heavy processing in the background.&lt;/p&gt;

&lt;p&gt;That separation makes the system easier to scale, debug, and extend.&lt;/p&gt;

&lt;h2&gt;
  
  
  Video demo
&lt;/h2&gt;

&lt;p&gt;I created a practical video where I build this Kafka-based AI pipeline step by step using FastAPI, Redpanda, Docker Compose, and Python workers.&lt;/p&gt;

&lt;p&gt;Watch the video here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/c2ijN2KAWXw" rel="noopener noreferrer"&gt;https://youtu.be/c2ijN2KAWXw&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thought
&lt;/h2&gt;

&lt;p&gt;AI architecture is not only about calling an LLM.&lt;/p&gt;

&lt;p&gt;The real challenge is designing the system around the AI workload.&lt;/p&gt;

&lt;p&gt;For many production AI applications, especially those involving document processing, RAG, embeddings, or summarization, event-driven architecture can make the system much more resilient.&lt;/p&gt;

&lt;p&gt;This is the kind of foundation we need before building more advanced AI pipelines.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>python</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Build an AI Pipeline FastAPI + Kafka + Workers</title>
      <dc:creator>Shalini Srivastava</dc:creator>
      <pubDate>Tue, 16 Jun 2026 03:24:13 +0000</pubDate>
      <link>https://dev.to/shalini2410/build-an-ai-pipelinefastapi-kafka-workers-5ah0</link>
      <guid>https://dev.to/shalini2410/build-an-ai-pipelinefastapi-kafka-workers-5ah0</guid>
      <description>&lt;p&gt;Most AI demos work perfectly on a laptop.&lt;br&gt;
But production AI systems can become fragile when everything is handled inside one synchronous API call.&lt;br&gt;
A user sends a request.&lt;br&gt;
The API extracts text.&lt;br&gt;
The API chunks the content.&lt;br&gt;
The API generates embeddings.&lt;br&gt;
The API stores data.&lt;br&gt;
The API waits for everything to finish.&lt;br&gt;
This may look simple in a demo, but it quickly becomes a problem in real systems.&lt;br&gt;
The problem with one giant API call&lt;br&gt;
In many AI applications, the API is expected to do too much.&lt;br&gt;
For example, in a document processing or RAG pipeline, one request may trigger multiple heavy steps:&lt;br&gt;
text extraction&lt;br&gt;
chunking&lt;br&gt;
embedding generation&lt;br&gt;
indexing&lt;br&gt;
summarization&lt;br&gt;
database updates&lt;br&gt;
If all of this happens inside one synchronous request, the API becomes slow and fragile.&lt;br&gt;
If one downstream step fails, the complete request may fail.&lt;br&gt;
If traffic increases suddenly, the API may become overloaded.&lt;br&gt;
This is why event-driven architecture becomes useful for AI workloads.&lt;br&gt;
A better approach: API + Kafka + workers&lt;br&gt;
Instead of making the API do everything, we can split the workflow into smaller services.&lt;br&gt;
The API accepts the request and publishes an event.&lt;br&gt;
Background workers consume events and continue the processing asynchronously.&lt;br&gt;
A simple flow looks like this:&lt;br&gt;
User Request&lt;br&gt;
   ↓&lt;br&gt;
FastAPI&lt;br&gt;
   ↓&lt;br&gt;
Kafka / Redpanda Topic&lt;br&gt;
   ↓&lt;br&gt;
Python Worker&lt;br&gt;
   ↓&lt;br&gt;
Next Processing Stage&lt;br&gt;
In my practical demo, I am using:&lt;br&gt;
FastAPI&lt;br&gt;
Redpanda&lt;br&gt;
Python workers&lt;br&gt;
Docker Compose&lt;br&gt;
Kafka-compatible messaging&lt;br&gt;
Why Redpanda?&lt;br&gt;
Redpanda is Kafka-compatible, which makes it useful for local demos and event-driven architecture experiments.&lt;br&gt;
It allows us to work with Kafka-style topics, producers, and consumers while keeping the setup simple for development.&lt;br&gt;
What this architecture gives us&lt;br&gt;
This approach helps with:&lt;br&gt;
decoupling services&lt;br&gt;
handling bursty workloads&lt;br&gt;
moving long-running tasks to background workers&lt;br&gt;
improving scalability&lt;br&gt;
isolating failures&lt;br&gt;
building production-style AI pipelines&lt;br&gt;
This pattern is especially useful for AI systems involving:&lt;br&gt;
document processing&lt;br&gt;
chunking&lt;br&gt;
embeddings&lt;br&gt;
RAG indexing&lt;br&gt;
summarization&lt;br&gt;
long-running background jobs&lt;br&gt;
Key architecture idea&lt;br&gt;
The API should not behave like a worker.&lt;br&gt;
The API should accept the request, publish an event, and return quickly.&lt;br&gt;
Workers should handle the heavy processing in the background.&lt;br&gt;
That separation makes the system easier to scale, debug, and extend.&lt;br&gt;
Video demo&lt;br&gt;
I created a practical video where I build this Kafka-based AI pipeline step by step using FastAPI, Redpanda, Docker Compose, and Python workers.&lt;br&gt;
Watch the video here:&lt;br&gt;
&lt;a href="https://youtu.be/c2ijN2KAWXw" rel="noopener noreferrer"&gt;https://youtu.be/c2ijN2KAWXw&lt;/a&gt;&lt;br&gt;
Final thought&lt;br&gt;
AI architecture is not only about calling an LLM.&lt;br&gt;
The real challenge is designing the system around the AI workload.&lt;br&gt;
For many production AI applications, especially those involving document processing, RAG, embeddings, or summarization, event-driven architecture can make the system much more resilient.&lt;br&gt;
This is the kind of foundation we need before building more advanced AI pipelines.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>python</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>The "Demo vs. Production" Trap: Building a Scalable Kafka Pipeline for LLMs</title>
      <dc:creator>Shalini Srivastava</dc:creator>
      <pubDate>Sat, 13 Jun 2026 03:50:35 +0000</pubDate>
      <link>https://dev.to/shalini2410/the-demo-vs-production-trap-building-a-scalable-kafka-pipeline-for-llms-5eli</link>
      <guid>https://dev.to/shalini2410/the-demo-vs-production-trap-building-a-scalable-kafka-pipeline-for-llms-5eli</guid>
      <description>&lt;p&gt;Why synchronous API wrappers break under bursty AI traffic, and how to fix it using an event-driven architecture with Apache Kafka.&lt;/p&gt;

&lt;p&gt;Most AI tutorials you see online follow a simple, clean path:&lt;br&gt;
&lt;code&gt;User ➔ API ➔ LLM ➔ Response&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It works perfectly in a local development environment. But if you try pushing that synchronous design straight into production under heavy, real-world traffic, things fall apart fast. &lt;/p&gt;

&lt;p&gt;Forcing long-running tasks like text extraction, chunking, embedding generation, and multi-step LLM orchestration into a single blocking HTTP request is a recipe for timeouts, resource exhaustion, and cascading backend failures.&lt;/p&gt;

&lt;p&gt;If your LLM provider introduces a 15-second latency spike or hits a rate limit, your entire worker thread pool sits idle, consuming memory while waiting for external network I/O to resolve. Upstream clients give up, and requests start dropping.&lt;/p&gt;
&lt;h2&gt;
  
  
  Shifting to an Event-Driven AI Pipeline
&lt;/h2&gt;

&lt;p&gt;To build enterprise-grade infrastructure that survives bursty workloads, you have to decouple the ingestion layer from your heavy processing services. This is where a durable event backbone like &lt;strong&gt;Apache Kafka&lt;/strong&gt; becomes crucial.&lt;/p&gt;

&lt;p&gt;By moving to an asynchronous architecture:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Immediate Ingestion:&lt;/strong&gt; Your API layer instantly accepts the payload, publishes an event, and returns an acknowledgment to the user. No blocking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backpressure Buffer:&lt;/strong&gt; Kafka acts as a shock absorber. If document extraction or vector database upserts slow down, events safely queue up in the log instead of crashing your servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fault Isolation:&lt;/strong&gt; If a downstream service fails, the data isn't lost. It sits securely in the log until the service recovers and resumes processing.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Full Architectural Breakdown &amp;amp; Walkthrough
&lt;/h2&gt;

&lt;p&gt;I put together a complete video breakdown detailing the exact mechanics of these production bottlenecks, the failure dynamics of brittle retry chains, and how to implement this decoupling step-by-step. &lt;/p&gt;
&lt;h2&gt;
  
  
  Complete Video Breakdowns &amp;amp; Implementation
&lt;/h2&gt;

&lt;p&gt;This is a growing weekly series where we transition from simple AI wrappers to robust, enterprise-grade backends. You can watch the full architectural breakdowns below:&lt;/p&gt;
&lt;h3&gt;
  
  
  Part 1: The "Demo vs. Production" Trap
&lt;/h3&gt;

&lt;p&gt;We break down the 5 major bottlenecks that bring synchronous AI systems to their knees and why a distributed commit log is the right foundation.&lt;br&gt;
  &lt;iframe src="https://www.youtube.com/embed/Wm6rA2sYEqk"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Part 2: Designing Multi-Stage Pipelines &amp;amp; The Claim Check Pattern
&lt;/h3&gt;

&lt;p&gt;We explore how to handle heavy 20MB+ files without choking Kafka, isolating faults, and scaling individual extraction and summarization consumer groups.&lt;br&gt;
  &lt;iframe src="https://www.youtube.com/embed/KjvbABpajUs"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;I've also open-sourced the reference documents and architectural layouts for this series. You can grab the reference materials over on GitHub: &lt;a href="https://github.com/Infodatamatrix/AI-reference-documents.git" rel="noopener noreferrer"&gt;AI Reference Documents &amp;amp; Code Repository&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>llm</category>
      <category>systemdesign</category>
    </item>
  </channel>
</rss>
