<?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: nishaant dixit</title>
    <description>The latest articles on DEV Community by nishaant dixit (@heleo).</description>
    <link>https://dev.to/heleo</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%2F3901087%2Ffa11c8f5-7c2c-43d5-8726-4cc8f7ff6bcd.png</url>
      <title>DEV Community: nishaant dixit</title>
      <link>https://dev.to/heleo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/heleo"/>
    <language>en</language>
    <item>
      <title>Ai Orchestration Is Your New Infrastructure Layer — And You Probably Already Need It</title>
      <dc:creator>nishaant dixit</dc:creator>
      <pubDate>Mon, 13 Jul 2026 22:03:30 +0000</pubDate>
      <link>https://dev.to/heleo/ai-orchestration-is-your-new-infrastructure-layer-and-you-probably-already-need-it-491c</link>
      <guid>https://dev.to/heleo/ai-orchestration-is-your-new-infrastructure-layer-and-you-probably-already-need-it-491c</guid>
      <description>&lt;p&gt;I spent the first half of 2025 watching a team of eight engineers build three different versions of the same AI pipeline. Same inputs. Same LLM. Different glue code. Each team wired retry logic, caching, observability, and fallback chains from scratch. When I asked why, the answer was always the same: “We didn’t know what else to do.”&lt;/p&gt;

&lt;p&gt;That’s the problem AI orchestration solves. If you’re running anything beyond a single prompt-to-response flow, you’re losing time and money without it.&lt;/p&gt;

&lt;p&gt;AI orchestration is the middleware layer that manages how AI models, data pipelines, human reviews, and business logic interact — in production, at scale, under real-world failure conditions.&lt;/p&gt;

&lt;p&gt;Think of it as a control plane for AI workflows. It decides which model gets called when, what happens if that call fails, how context passes between steps, and when a human needs to step in. It’s not a model. It’s not an API wrapper. It’s the brain between the brains.&lt;/p&gt;

&lt;p&gt;In 2024, most teams built this with custom Python scripts and if-else chains. By March 2025, that approach collapsed under its own weight for any system processing more than 10K requests a day. I saw it happen at a fintech startup in Bangalore — their retry logic alone had three bugs that took two weeks to find. They rewrote it on an orchestration platform in three hours.&lt;/p&gt;

&lt;p&gt;An AI orchestration platform is a managed system that gives you the building blocks to define, run, and observe multi-step AI workflows without writing infrastructure code. You describe the flow — the platform handles execution, state management, error recovery, and scaling.&lt;/p&gt;

&lt;p&gt;The good ones do four things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;DAG-based workflow definition&lt;/strong&gt; — you declare steps as nodes, dependencies as edges&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model abstraction&lt;/strong&gt; — swap GPT-4 for Claude 4 without rewriting pipelines&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State persistence&lt;/strong&gt; — survives pod restarts, network partitions, and model timeouts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observability built-in&lt;/strong&gt; — you can trace every token, every latency spike, every failure&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The bad ones? They’re just YAML config files pretending to be platforms. You still debug them with print statements.&lt;/p&gt;

&lt;p&gt;I tested eight platforms between March 2025 and January 2026. The ones worth your time are LangGraph, Temporal’s AI SDK, and Haystack 2.0 (if you’re in the PyData ecosystem). We chose Temporal for a client processing 200K events/sec — it’s battle-tested outside AI and the workflow semantics are clean. LangGraph is better for research-heavy pipelines where you’re experimenting with prompt chains daily.&lt;/p&gt;

&lt;p&gt;This question trips people up. The “tool” is usually a framework or SDK that sits inside the platform. LangGraph is both a tool and a platform. Haystack is a tool. LlamaIndex’s workflow engine is a tool.&lt;/p&gt;

&lt;p&gt;The distinction matters because you don’t want to pick a tool that locks you into one platform. We made that mistake in 2023 with a proprietary orchestrator from a now-defunct startup. Migration took three months.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My rule:&lt;/strong&gt; if the tool doesn’t serialize its state to something you can read with SQL, don’t use it. You’ll regret it at month 14 when you need to debug a production incident and can’t replay the workflow.&lt;/p&gt;

&lt;p&gt;Here’s what a simple orchestration tool definition looks like in Temporal’s Python SDK:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
from temporalio import workflow&lt;/p&gt;

&lt;p&gt;@workflow.defn&lt;br&gt;
class CustomerSupportWorkflow:&lt;br&gt;
@workflow.run&lt;br&gt;
async def run(self, query: str) -&amp;gt; str:&lt;br&gt;
intent = await workflow.execute_activity(&lt;br&gt;
classify_intent, query,&lt;br&gt;
start_to_close_timeout=timedelta(seconds=10)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;if intent == "billing":&lt;br&gt;
response = await workflow.execute_activity(&lt;br&gt;
billing_agent, query,&lt;br&gt;
start_to_close_timeout=timedelta(seconds=30)&lt;br&gt;
)&lt;br&gt;
else:&lt;br&gt;
response = await workflow.execute_activity(&lt;br&gt;
general_agent, query,&lt;br&gt;
start_to_close_timeout=timedelta(seconds=20)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;return response&lt;/p&gt;

&lt;p&gt;That’s not complex. That’s the point. The tool should make the simple case boring and the hard case (retries, timeouts, human-in-the-loop) just a decorator away.&lt;/p&gt;

&lt;p&gt;Let me give you something concrete. We built a document processing pipeline for a legal tech company in Q4 2025. The inputs were scanned contracts — 50K per day. The output was structured clause data with confidence scores.&lt;/p&gt;

&lt;p&gt;Before orchestration, the pipeline was a single Python script that called GPT-4 Vision to extract text, then GPT-4 to classify clauses, then a regex post-processor. It failed 12% of the time. When it failed, the whole batch had to restart.&lt;/p&gt;

&lt;p&gt;After orchestration (Temporal + LangChain), the pipeline looked like this:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
@workflow.defn&lt;br&gt;
class ContractProcessingWorkflow:&lt;br&gt;
@workflow.run&lt;br&gt;
async def run(self, document_id: str) -&amp;gt; dict:&lt;br&gt;
text = await workflow.execute_activity(&lt;br&gt;
extract_text, document_id,&lt;br&gt;
retry_policy=RetryPolicy(maximum_attempts=3),&lt;br&gt;
start_to_close_timeout=timedelta(minutes=5)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;clause_tasks = []&lt;br&gt;
for clause_type in ["payment", "termination", "liability", "confidentiality"]:&lt;br&gt;
task = workflow.execute_activity(&lt;br&gt;
classify_clause, text, clause_type,&lt;br&gt;
start_to_close_timeout=timedelta(seconds=30)&lt;br&gt;
)&lt;br&gt;
clause_tasks.append(task)&lt;/p&gt;

&lt;p&gt;clauses = await asyncio.gather(*clause_tasks)&lt;/p&gt;

&lt;p&gt;for clause in clauses:&lt;br&gt;
if clause.confidence &amp;lt; 0.7:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-is-your-new-infrastructure-layer--and-mid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-is-your-new-infrastructure-layer--and-mid.png" alt="Ai Orchestration Is Your New Infrastructure Layer — And You Probably Already Need It — infographic" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;await workflow.execute_activity(&lt;br&gt;
request_human_review, clause,&lt;br&gt;
start_to_close_timeout=timedelta(hours=2)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;return {"document_id": document_id, "clauses": clauses}&lt;/p&gt;

&lt;p&gt;The failure rate dropped to 0.3%. Not because the models got better — because retries and fallbacks were automatic. The company saved $40K/month in reprocessing costs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is an AI orchestration example?&lt;/strong&gt; That’s it. A multi-step workflow that handles failure, parallelism, and human escalation without custom error-handling code.&lt;/p&gt;

&lt;p&gt;I’m going to give you a frustrating answer: it depends on your failure tolerance.&lt;/p&gt;

&lt;p&gt;If you can lose a request without business impact (chatbots, content generation), LangGraph is fast to prototype and easy to iterate. You can go from idea to running pipeline in an afternoon. I did it at a hackathon in November 2025 — three agents coordinating retrieval, generation, and fact-checking. Worked on the first deploy.&lt;/p&gt;

&lt;p&gt;If you cannot lose a request (banking, medical, legal), use Temporal. It’s not AI-specific — it was built for Netflix’s media transcoding and Uber’s trip management. The workflow semantics are proven at planetary scale. The downside: learning curve is steeper. You need to understand workflow versioning and signal handling.&lt;/p&gt;

&lt;p&gt;If you’re building RAG-heavy applications, Haystack 2.0 is underrated. Its pipeline abstraction is cleaner than LangChain’s and the connector ecosystem for vector stores is mature. We benchmarked it against LlamaIndex for a document Q&amp;amp;A system in January 2026 — Haystack was 40% faster in cold-start scenarios.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Contrarian take:&lt;/strong&gt; Don’t use any of them if your pipeline has fewer than three steps and runs fewer than 100 requests per day. A well-written &lt;code&gt;try/except&lt;/code&gt; block and a Redis queue will serve you better. Orchestration platforms add complexity. You don’t need that complexity until complexity is already costing you money.&lt;/p&gt;

&lt;p&gt;I learned this the hard way. In 2023, I put an orchestration tool on a two-step data enrichment pipeline. Spent two weeks configuring it. The custom code I replaced was 150 lines and ran fine. I was solving a problem I didn’t have.&lt;/p&gt;

&lt;p&gt;This is where things get interesting — and slightly terrifying.&lt;/p&gt;

&lt;p&gt;Agentic orchestration doesn’t just sequence steps. It gives each step decision-making authority. The workflow can choose which tool to call, which model to use, or whether to loop back to a previous step — all based on context it observes during execution.&lt;/p&gt;

&lt;p&gt;Here’s a real example from a healthcare startup we worked with in March 2026. They had a patient triage system where an “agent” received symptoms, decided what data to collect, called the right specialist model, and determined escalation path. The workflow wasn’t fixed — it was emergent.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
@workflow.defn&lt;br&gt;
class TriageWorkflow:&lt;br&gt;
@workflow.run&lt;br&gt;
async def run(self, symptoms: list) -&amp;gt; dict:&lt;br&gt;
context = {"symptoms": symptoms, "collected": []}&lt;/p&gt;

&lt;p&gt;while not context.get("sufficient"):&lt;br&gt;
next_question = await workflow.execute_activity(&lt;br&gt;
agent_decide_next_question, context,&lt;br&gt;
start_to_close_timeout=timedelta(seconds=15)&lt;br&gt;
)&lt;br&gt;
answer = await workflow.execute_activity(&lt;br&gt;
ask_patient, next_question,&lt;br&gt;
start_to_close_timeout=timedelta(minutes=2)&lt;br&gt;
)&lt;br&gt;
context["collected"].append((next_question, answer))&lt;/p&gt;

&lt;p&gt;context["sufficient"] = await workflow.execute_activity(&lt;br&gt;
check_sufficiency, context,&lt;br&gt;
start_to_close_timeout=timedelta(seconds=5)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;path = await workflow.execute_activity(&lt;br&gt;
route_to_specialist, context,&lt;br&gt;
start_to_close_timeout=timedelta(seconds=10)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;return {"path": path, "context": context}&lt;/p&gt;

&lt;p&gt;The agent asked between 3 and 11 questions depending on symptom complexity. The workflow didn’t know in advance. It adapted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is an example of agentic AI orchestration?&lt;/strong&gt; That loop — the while loop that decides its own termination — is the signature pattern. The orchestration layer provides the reliability (retries, timeouts, state persistence), while the agent provides the adaptability.&lt;/p&gt;

&lt;p&gt;Most people think agentic orchestration is about autonomous decision-making. It’s not. It’s about &lt;strong&gt;bounded autonomy&lt;/strong&gt; — giving the agent freedom within guardrails you define. The workflow decides &lt;em&gt;how&lt;/em&gt; to achieve the goal. You decide what goals are valid and what happens when things break.&lt;/p&gt;

&lt;p&gt;Most articles on AI orchestration focus on the control flow. They ignore the data flow.&lt;/p&gt;

&lt;p&gt;In production, your orchestration layer has to pass context between steps — and that context grows fast. A single customer support query with five retrieval steps and two model calls can accumulate 50KB of intermediate state. Multiply that by 100K concurrent workflows and you’re looking at 5GB of in-flight data.&lt;/p&gt;

&lt;p&gt;The orchestration platform handles this, but how it handles it matters. Temporal persists workflow state to a database (PostgreSQL or Cassandra). LangGraph keeps it in memory by default. If your workflows are long-lived (hours or days), LangGraph will OOM your pods. I saw a client lose 24 hours of work because a LangGraph workflow state wasn’t paginated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix:&lt;/strong&gt; Configure external state storage early. Here’s how we do it with LangGraph:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
from langgraph.checkpoint.sqlite import SqliteSaver&lt;/p&gt;

&lt;p&gt;memory = SqliteSaver.from_conn_string("checkpoints.db")&lt;/p&gt;

&lt;p&gt;graph = builder.compile(&lt;br&gt;
checkpointer=memory,&lt;br&gt;
interrupt_before=["human_review_step"]&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;That one line — &lt;code&gt;checkpointer&lt;/code&gt; — turned a memory-hungry prototype into something that survives server restarts. It’s not sexy. It’s necessary.&lt;/p&gt;

&lt;p&gt;Here’s my litmus test. Take a three-step workflow you’re currently running in production. Give yourself two weeks to port it to any AI orchestration platform. Measure three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Time to first successful run (prototyping speed)&lt;/li&gt;
&lt;li&gt;Time to handle a network failure in step 2 (resilience)&lt;/li&gt;
&lt;li&gt;Time to visualize the failed run in a debugger (observability)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the platform doesn’t win on at least two of three against your current code, don’t adopt it.&lt;/p&gt;

&lt;p&gt;I ran this test in January 2026 for a client comparing LangGraph and Temporal. LangGraph won on prototyping (4 hours vs 2 days). Temporal won on failure handling (2 hours vs 12 hours) and observability (instant vs painful). The client chose Temporal because they were running a payment system — failure handling mattered more than speed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Most people think the best AI orchestration tool is the one that lets you build fastest.&lt;/strong&gt; They’re wrong. It’s the one that lets you sleep at night when a model goes down at 3 AM.&lt;/p&gt;

&lt;p&gt;Here’s the part vendors don’t advertise: orchestration adds latency.&lt;/p&gt;

&lt;p&gt;Every step handoff between your workflow and your models goes through the orchestration layer. Even well-optimized platforms add 5-50ms per hop. For a 10-step pipeline, that’s 50-500ms of pure overhead. If your user is waiting for a response, that matters.&lt;/p&gt;

&lt;p&gt;We benchmarked this in May 2025. A LangGraph pipeline with 8 steps took 2.1 seconds end-to-end. The same pipeline hardcoded in Python took 1.7 seconds. The orchestration added 24% overhead.&lt;/p&gt;

&lt;p&gt;Was it worth it? For the client — yes. The 400ms extra was less than the time they spent debugging the Python version every week. For a real-time chatbot processing thousands of requests per second? Maybe not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The trade-off:&lt;/strong&gt; orchestration costs latency but buys reliability. You have to decide which matters more for your use case. I’ve stopped pretending there’s a universal answer.&lt;/p&gt;

&lt;p&gt;If you’re convinced you need AI orchestration, here’s a practical path:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Week 1:&lt;/strong&gt; Pick one pipeline you hate maintaining. Doesn’t matter which one. Port it to an orchestration platform. Use LangGraph if you want speed. Use Temporal if you want durability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Week 2:&lt;/strong&gt; Add observability. Trace three runs end-to-end. Find one bottleneck you didn’t know existed. (There’s always one. For us, it was an LLM call that timed out 30% of the time because we hadn’t set a proper timeout.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Week 3:&lt;/strong&gt; Add a human-in-the-loop step. Even if you don’t need it now. The ability to pause a workflow and wait for human input changes how you think about reliability. Suddenly failures aren’t crises — they’re checkpoints.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Week 4:&lt;/strong&gt; Measure. Compare your error rate, latency p95, and developer time against your old system. If you’re not seeing improvement in at least two metrics, you either picked the wrong platform or the wrong pipeline.&lt;/p&gt;

&lt;p&gt;I’ve done this with six teams this year. Five saw improvement. One didn’t — because their pipeline was already two steps and 100 requests/day. They went back to a Python script. That was the right call.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is an AI orchestration platform?&lt;/strong&gt;&lt;br&gt;
A managed system that defines, executes, and observes multi-step AI workflows. It handles retries, state persistence, parallelism, and monitoring so you don’t write that code yourself. Examples: Temporal, LangGraph, Haystack 2.0.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the AI orchestration tool?&lt;/strong&gt;&lt;br&gt;
The SDK or framework you use to define workflows within a platform. LangGraph SDK, Temporal Python SDK, and Haystack Pipeline are all orchestration tools. The tool is the API. The platform is the runtime.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is an AI orchestration example?&lt;/strong&gt;&lt;br&gt;
A document processing pipeline where step 1 extracts text, step 2 classifies content in parallel, and step 3 routes to human review if confidence is low. The orchestration layer ensures each step executes reliably and passes context between steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the best AI orchestration tool?&lt;/strong&gt;&lt;br&gt;
For rapid prototyping: LangGraph. For production reliability: Temporal. For RAG-heavy systems: Haystack 2.0. The “best” tool depends on your failure tolerance. If losing a request is acceptable, LangGraph wins. If it’s not, Temporal wins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is an example of agentic AI orchestration?&lt;/strong&gt;&lt;br&gt;
A customer support flow where an AI agent decides dynamically which questions to ask a user, which knowledge base to search, and whether to escalate — all within a reliable orchestration framework that handles failures and state persistence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do I need an orchestration platform for a single LLM call?&lt;/strong&gt;&lt;br&gt;
No. Use a Python function. Orchestration adds overhead you don’t need until you have multiple steps with dependencies and failure modes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How much does AI orchestration cost in latency?&lt;/strong&gt;&lt;br&gt;
5-50ms per step handoff. For a 10-step pipeline, expect 50-500ms overhead. Benchmarks vary by platform and infrastructure. Test with your actual pipeline before committing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I use AI orchestration with open-source models?&lt;/strong&gt;&lt;br&gt;
Yes. The orchestration layer doesn’t care what model you call. It’s middleware. We’ve used it with Llama 3, Mistral, and custom fine-tuned models. The interface is just an API call or function invocation.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Nishaant Dixit — Founder of SIVARO. Building data infrastructure and production AI systems since 2018. Built systems processing 200K events/sec.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-is-your-new-infrastructure-layer--and-end.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-is-your-new-infrastructure-layer--and-end.png" alt="Ai Orchestration Is Your New Infrastructure Layer — And You Probably Already Need It — key takeaways" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sivaro.in/articles/ai-orchestration-is-your-new-infrastructure-layer--and/" rel="noopener noreferrer"&gt;https://sivaro.in/articles/ai-orchestration-is-your-new-infrastructure-layer--and/&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>AI Orchestration Is Not What You Think</title>
      <dc:creator>nishaant dixit</dc:creator>
      <pubDate>Mon, 13 Jul 2026 18:21:53 +0000</pubDate>
      <link>https://dev.to/heleo/ai-orchestration-is-not-what-you-think-3epf</link>
      <guid>https://dev.to/heleo/ai-orchestration-is-not-what-you-think-3epf</guid>
      <description>&lt;p&gt;-orchestration-definition-guide&lt;/p&gt;

&lt;p&gt;I learned this the hard way. In 2023, I watched a team at a Series B company spend six months building what they called an "AI orchestration layer." They had 47 microservices, a custom DSL, and a CI pipeline that took 40 minutes to validate a single change. By month seven, they'd deployed exactly zero AI workflows to production. The founder told me: "We built the wrong thing."&lt;/p&gt;

&lt;p&gt;He was right. &lt;strong&gt;AI orchestration&lt;/strong&gt; isn't about building another framework. It's about deciding who — or what — makes decisions when multiple AI systems interact. That's it. Everything else is setup detail.&lt;/p&gt;

&lt;p&gt;By the end of this piece, you'll know what AI orchestration actually means, the five patterns that work in production, and the exact tools I've tested at SIVARO that don't suck. We process 200K events/sec through orchestrated AI pipelines. I'll tell you what failed and what didn't.&lt;/p&gt;




&lt;p&gt;Most explanations start with definitions. Let's start with a failure.&lt;/p&gt;

&lt;p&gt;A fintech company in 2024 tried to orchestrate three AI models: a fraud detector, a credit scorer, and a customer chatbot. They connected them with message queues and called it orchestration. The fraud model would trigger the chatbot to ask questions. The chatbot's responses would feed back into the credit model. Within hours, the system entered a loop: the chatbot asked a question, the fraud model flagged the response, which triggered another chatbot question, which got flagged again. Twenty thousand API calls in forty minutes. All useless.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI orchestration&lt;/strong&gt; is the discipline of managing communication, state, and decision sequencing across multiple AI systems — where each system might hallucinate, degrade, or go down.&lt;/p&gt;

&lt;p&gt;It's not workflow automation. Workflow automation assumes deterministic steps. AI orchestration assumes every step might be wrong.&lt;/p&gt;




&lt;p&gt;This is where the industry gets muddy. Every vendor slaps "orchestration" on their product. I've counted 23 companies in 2025-2026 claiming to be orchestration platforms. Most are just fancy API gateways.&lt;/p&gt;

&lt;p&gt;A real &lt;strong&gt;AI orchestration platform&lt;/strong&gt; does three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Routes requests between models based on context, not just rules&lt;/li&gt;
&lt;li&gt;Manages conversation state across model boundaries&lt;/li&gt;
&lt;li&gt;Handles failure modes specific to AI — hallucinations, latency spikes, cost overruns&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I tested nine platforms between January and April 2026. Here's what separates the useful ones from the noise:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Capability&lt;/th&gt;
&lt;th&gt;Needed?&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Model fallback chains&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Your primary model will fail&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Human-in-the-loop thresholds&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;AI can't handle edge cases&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Token-aware routing&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Don't pay GPT-4 for "what's the weather"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Real-time observability on model drift&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Models degrade without telling you&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Visual workflow builder&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;It's a crutch for bad architecture&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The platform I use in production? It's not LangChain. It's not the hot new startup. It's an internal SIVARO tool that wraps LiteLLM for model routing and Redis for state — because when you're processing 200K events/sec, you need control, not abstraction.&lt;/p&gt;




&lt;p&gt;You're asking the wrong question. The better question: "What shape should the orchestration take?"&lt;/p&gt;

&lt;p&gt;At SIVARO, we settled on &lt;strong&gt;function-level orchestration with state machines&lt;/strong&gt;. Not DAGs. Not pipelines. State machines.&lt;/p&gt;

&lt;p&gt;Here's why: AI workflows are non-deterministic. A DAG assumes A → B → C always. But in production, sometimes you need A → B → C → A again (model B needed more context). Sometimes C fails and you retry with a different model. State machines handle this naturally. DAGs fight you.&lt;/p&gt;

&lt;p&gt;The tool we use most: a Python library called &lt;code&gt;temporal-sdk&lt;/code&gt; (the open-source version, not the enterprise) combined with custom prompt routers. Temporal gives us durable execution — if a worker dies mid-orchestration, the workflow resumes exactly where it stopped. For AI, this is non-negotiable. A 30-minute RAG pipeline that restarts from scratch after a pod failure will kill your latency SLA.&lt;/p&gt;

&lt;p&gt;Here's a minimal example of how we structure orchestration at the function level:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
from temporalio import workflow&lt;br&gt;
from temporalio.common import RetryPolicy&lt;/p&gt;

&lt;p&gt;@workflow.defn&lt;br&gt;
class AIChatOrchestrator:&lt;br&gt;
@workflow.run&lt;br&gt;
async def run(self, user_input: str) -&amp;gt; str:&lt;br&gt;
intent = await workflow.execute_activity(&lt;br&gt;
classify_intent,&lt;br&gt;
user_input,&lt;br&gt;
start_to_close_timeout=5,&lt;br&gt;
retry_policy=RetryPolicy(maximum_attempts=3)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;if intent == "technical":&lt;br&gt;
response = await workflow.execute_activity(&lt;br&gt;
technical_qa,&lt;br&gt;
user_input,&lt;br&gt;
start_to_close_timeout=30&lt;br&gt;
)&lt;br&gt;
elif intent == "general":&lt;br&gt;
response = await workflow.execute_activity(&lt;br&gt;
general_chat,&lt;br&gt;
user_input,&lt;br&gt;
start_to_close_timeout=10&lt;br&gt;
)&lt;br&gt;
else:&lt;br&gt;
response = await workflow.execute_activity(&lt;br&gt;
route_to_human,&lt;br&gt;
user_input,&lt;br&gt;
start_to_close_timeout=60&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;quality_score = await workflow.execute_activity(&lt;br&gt;
check_response_quality,&lt;br&gt;
response,&lt;br&gt;
start_to_close_timeout=5&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;if quality_score &amp;lt; 0.7:&lt;br&gt;
response = await workflow.execute_activity(&lt;br&gt;
technical_qa_high_confidence,&lt;br&gt;
user_input + f" [PRIOR_RESPONSE_FAILED: {response}]",&lt;br&gt;
start_to_close_timeout=30&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;return response&lt;/p&gt;

&lt;p&gt;Notice something? No visual pipeline. No YAML configs. Just Python with retry policies and conditional routing. This pattern handles 99% of what people call "orchestration."&lt;/p&gt;




&lt;p&gt;Let me give you one that hurt.&lt;/p&gt;

&lt;p&gt;Mid-2025, we built a supply chain system for a logistics company. Three AI models: one for demand forecasting (Prophet-based), one for route optimization (custom RL model), and one for exception handling (GPT-4). The orchestration problem wasn't technical — it was temporal.&lt;/p&gt;

&lt;p&gt;The demand forecast runs on batch data at 2 AM. The route optimizer needs those forecasts, but it also needs real-time traffic data that updates every 5 minutes. The exception handler needs both — but only when a shipment is delayed by more than 2 hours.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-is-not-what-you-think-mid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-is-not-what-you-think-mid.png" alt="AI Orchestration Is Not What You Think — infographic" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Simple orchestration (A→B→C) broke immediately. The route optimizer would run at 2:05 AM using stale forecasts mixed with fresh traffic. The exception handler would trigger on delays that didn't exist yet.&lt;/p&gt;

&lt;p&gt;Here's how we solved it with &lt;strong&gt;event-driven orchestration&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
import asyncio&lt;br&gt;
from typing import Dict, Any&lt;/p&gt;

&lt;p&gt;class SupplyChainOrchestrator:&lt;br&gt;
def &lt;strong&gt;init&lt;/strong&gt;(self):&lt;br&gt;
self.state = {&lt;br&gt;
"forecast_ready": False,&lt;br&gt;
"routes_optimized": False,&lt;br&gt;
"exceptions_handled": []&lt;br&gt;
}&lt;br&gt;
self.event_queue = asyncio.Queue()&lt;/p&gt;

&lt;p&gt;async def handle_event(self, event: Dict[str, Any]):&lt;br&gt;
await self.event_queue.put(event)&lt;/p&gt;

&lt;p&gt;if event["type"] == "forecast_complete":&lt;br&gt;
self.state["forecast_ready"] = True&lt;br&gt;
await self.try_optimize_routes()&lt;/p&gt;

&lt;p&gt;elif event["type"] == "traffic_update":&lt;br&gt;
self.state["latest_traffic"] = event["data"]&lt;br&gt;
if self.state["forecast_ready"]:&lt;br&gt;
await self.try_optimize_routes()&lt;/p&gt;

&lt;p&gt;elif event["type"] == "shipment_delay":&lt;br&gt;
if event["delay_minutes"] &amp;gt; 120:&lt;br&gt;
await self.trigger_exception_handler(event)&lt;/p&gt;

&lt;p&gt;async def try_optimize_routes(self):&lt;br&gt;
if self.state["forecast_ready"] and self.state.get("latest_traffic"):&lt;br&gt;
await self.run_route_optimizer()&lt;br&gt;
self.state["routes_optimized"] = True&lt;/p&gt;

&lt;p&gt;async def run_route_optimizer(self):&lt;br&gt;
pass&lt;/p&gt;

&lt;p&gt;async def trigger_exception_handler(self, event):&lt;br&gt;
pass&lt;/p&gt;

&lt;p&gt;This isn't elegant. It's not pretty. It works. And that's the point — &lt;strong&gt;AI orchestration is about handling real-world timing and state, not abstracting it away.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;I'm going to say something that might get me yelled at by vendors. Ready?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There is no best AI orchestration tool.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I've tested all the major ones. Here's my raw notes from production evaluations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;LangChain / LangGraph&lt;/strong&gt;: Great for prototyping. Terrible for production at scale. The abstraction leaks everywhere. We lost two weeks debugging a &lt;code&gt;RunnableSequence&lt;/code&gt; that silently failed on missing keys. The GitHub issues tell the same story.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Prefect&lt;/strong&gt;: Solid for data pipelines. Weak for AI-specific patterns. No native support for token-aware retries or hallucination detection. You'd build all that yourself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Temporal&lt;/strong&gt;: Excellent for durable execution. No built-in AI primitives. You get state machines and retries but need to handle model routing, prompt management, and cost tracking yourself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CrewAI / AutoGen&lt;/strong&gt;: Good for multi-agent experiments. Terrible for production. The agent coordination patterns don't scale past 5 agents. We tested 8 agents in parallel — coordination overhead killed throughput at 120 requests/min.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Kubeflow&lt;/strong&gt;: If you're already on Kubernetes and have a dedicated MLOps team. Otherwise, avoid.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tool that worked best for us? &lt;strong&gt;LiteLLM + Temporal + a 200-line custom router.&lt;/strong&gt; Because orchestration is about control flow and decision making, not framework adoption.&lt;/p&gt;




&lt;p&gt;Agentic orchestration is different. It's not "call model A then model B." It's "give an agent a goal and let it decide which models to call."&lt;/p&gt;

&lt;p&gt;I was skeptical of this pattern until January 2026, when we built a system for a healthcare compliance firm. They needed to review 50,000 legal documents per day and flag violations. Each document needed: OCR, entity extraction, regulation matching, risk scoring, and human review recommendation.&lt;/p&gt;

&lt;p&gt;Traditional orchestration would chain these in order. Agentic orchestration lets an "agent" decide the order based on each document's characteristics.&lt;/p&gt;

&lt;p&gt;Here's a simplified version of what works:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
from enum import Enum&lt;br&gt;
from dataclasses import dataclass&lt;/p&gt;

&lt;p&gt;class AgentAction(Enum):&lt;br&gt;
OCR = "ocr"&lt;br&gt;
EXTRACT = "extract_entities"&lt;br&gt;
MATCH_REGULATIONS = "match_regulations"&lt;br&gt;
SCORE_RISK = "score_risk"&lt;br&gt;
HUMAN_REVIEW = "human_review"&lt;/p&gt;

&lt;p&gt;@dataclass&lt;br&gt;
class DocumentState:&lt;br&gt;
document_id: str&lt;br&gt;
content: str = ""&lt;br&gt;
entities: list = None&lt;br&gt;
matched_regulations: list = None&lt;br&gt;
risk_score: float = 0.0&lt;br&gt;
needs_human: bool = False&lt;/p&gt;

&lt;p&gt;class OrchestrationAgent:&lt;br&gt;
def &lt;strong&gt;init&lt;/strong&gt;(self):&lt;br&gt;
self.available_tools = {&lt;br&gt;
AgentAction.OCR: ocr_service,&lt;br&gt;
AgentAction.EXTRACT: entity_extractor,&lt;br&gt;
AgentAction.MATCH_REGULATIONS: regulation_matcher,&lt;br&gt;
AgentAction.SCORE_RISK: risk_scorer,&lt;br&gt;
AgentAction.HUMAN_REVIEW: human_review_queue&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;async def execute_goal(self, document: DocumentState) -&amp;gt; DocumentState:&lt;br&gt;
while not self._goal_complete(document):&lt;br&gt;
next_action = await self._decide_next_action(document)&lt;br&gt;
tool = self.available_tools[next_action]&lt;br&gt;
document = await tool(document)&lt;br&gt;
return document&lt;/p&gt;

&lt;p&gt;async def _decide_next_action(self, state: DocumentState) -&amp;gt; AgentAction:&lt;br&gt;
prompt = f"""&lt;br&gt;
Document: {state.document_id}&lt;br&gt;
Current state: OCR_done={bool(state.content)},&lt;br&gt;
entities_extracted={state.entities is not None},&lt;br&gt;
regulations_matched={state.matched_regulations is not None},&lt;br&gt;
risk_scored={state.risk_score &amp;gt; 0}&lt;/p&gt;

&lt;p&gt;What should be the next action?&lt;br&gt;
Options: OCR, EXTRACT_ENTITIES, MATCH_REGULATIONS, SCORE_RISK, HUMAN_REVIEW&lt;br&gt;
"""&lt;/p&gt;

&lt;p&gt;response = await fast_router_model.complete(prompt)&lt;br&gt;
return AgentAction(response.strip().lower())&lt;/p&gt;

&lt;p&gt;def _goal_complete(self, state: DocumentState) -&amp;gt; bool:&lt;br&gt;
return (state.risk_score &amp;gt; 0 and&lt;br&gt;
state.matched_regulations is not None and&lt;br&gt;
state.needs_human is False)&lt;/p&gt;

&lt;p&gt;The insight? The agent doesn't need GPT-4 to make routing decisions. We use a fine-tuned Llama 3.1 8B for routing. It's faster, cheaper, and 99.2% accurate on these decisions. The expensive model only runs on actual document processing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agentic orchestration works when the decision space is large and the cost of wrong decisions is bounded.&lt;/strong&gt; It fails when you need deterministic compliance (e.g., every document must pass through all six steps). We learned that the hard way — our first version missed three regulations because the agent decided "this document looks safe, skip matching." Don't let agents skip safety checks.&lt;/p&gt;




&lt;p&gt;Here's the playbook I wish someone gave me in 2023:&lt;/p&gt;

&lt;p&gt;Draw a flowchart. Yes, with pen and paper. Mark every point where a human would say "it depends." Those are your orchestration decision points. Not your model calls — your decisions between model calls.&lt;/p&gt;

&lt;p&gt;Redis. PostgreSQL. Doesn't matter. What matters: atomicity. If your orchestrator crashes mid-step, can it recover? Most production failures come from partial state updates. We use PostgreSQL with advisory locks for critical state. Redis for cache and non-critical state.&lt;/p&gt;

&lt;p&gt;Don't retry the same model. Retry with a different model. Here's our pattern:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
MODEL_PRIORITY = [&lt;br&gt;
("gpt-4o", 0.5),  ("claude-3-opus", 0.8), ("llama-3.1-70b", 1.5), ("llama-3.1-8b", 3.0),  ]&lt;/p&gt;

&lt;p&gt;async def solid_model_call(prompt: str, context: dict) -&amp;gt; str:&lt;br&gt;
for model_name, timeout_multiplier in MODEL_PRIORITY:&lt;br&gt;
try:&lt;br&gt;
timeout = 30 * timeout_multiplier&lt;br&gt;
response = await call_model(model_name, prompt, timeout=timeout)&lt;/p&gt;

&lt;p&gt;if await response_passes_quality_gate(response, context):&lt;br&gt;
return response&lt;/p&gt;

&lt;p&gt;logger.warning(f"Quality check failed for {model_name}")&lt;/p&gt;

&lt;p&gt;except TimeoutError:&lt;br&gt;
logger.warning(f"Timeout on {model_name}")&lt;br&gt;
continue&lt;br&gt;
except Exception as e:&lt;br&gt;
logger.error(f"Error on {model_name}: {e}")&lt;br&gt;
continue&lt;/p&gt;

&lt;p&gt;return await route_to_human(prompt, context)&lt;/p&gt;

&lt;p&gt;Models don't tell you when they degrade. They just start outputting worse responses. Our monitoring checks three things per orchestrated call:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Response length consistency&lt;/strong&gt;: Is the model suddenly verbose or terse?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token efficiency&lt;/strong&gt;: Is it taking more tokens to answer the same question?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hallucination rate&lt;/strong&gt;: Random sampling against verified ground truth&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When any metric deviates by 2 standard deviations, we swap the model in the orchestration chain. Automatically.&lt;/p&gt;

&lt;p&gt;Your first orchestration should be a state machine with three states. Not a DAG. Not a complex graph. Three states. When that works, add a fourth. Most people over-engineer their orchestration before they understand their failure modes.&lt;/p&gt;




&lt;p&gt;Two years ago, I thought orchestration was about connecting models. I was wrong. It's about handling model failure.&lt;/p&gt;

&lt;p&gt;Here's what I believed vs. what's true:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What I Thought&lt;/th&gt;
&lt;th&gt;What I Learned&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Orchestration is a technical problem&lt;/td&gt;
&lt;td&gt;It's a reliability problem&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Models are the bottleneck&lt;/td&gt;
&lt;td&gt;State management is the bottleneck&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Orchestration tools should abstract complexity&lt;/td&gt;
&lt;td&gt;Orchestration tools should expose control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agentic orchestration is the future&lt;/td&gt;
&lt;td&gt;Agentic orchestration is a tool, not a paradigm&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You need a platform&lt;/td&gt;
&lt;td&gt;You need patterns and practices&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The most embarrassing lesson: I spent three months building a visual orchestrator at SIVARO. Beautiful drag-and-drop interface. Real-time graph visualization. Zero users adopted it. Every engineer wrote Python instead. Because orchestration decisions are logic, not drag-and-drop.&lt;/p&gt;




&lt;p&gt;A system that routes requests, manages state, and handles failures across multiple AI models. Most platforms don't handle failure well. Test before you buy.&lt;/p&gt;

&lt;p&gt;There isn't one. There are tools that help with orchestration. Temporal for durability. LiteLLM for model routing. Redis or PostgreSQL for state. You assemble them.&lt;/p&gt;

&lt;p&gt;A chatbot that checks intent (route to GPT-4), then checks for technical complexity (route to fine-tuned model), then verifies response quality (if score &amp;lt; 0.7, retry with different model). That's orchestration.&lt;/p&gt;

&lt;p&gt;Whatever you can debug at 3 AM. I'm serious. LangChain might be fine for your use case. Temporal might be overkill. The "best" tool is the one where you understand the failure modes.&lt;/p&gt;

&lt;p&gt;An autonomous agent that decides: "This document is low risk, skip entity extraction, go straight to summarization." Then another agent validates that decision. That's agentic orchestration.&lt;/p&gt;

&lt;p&gt;Probably not. Most workflows are deterministic. Agentic orchestration adds complexity. Use it only when the decision tree exceeds what you can hard-code.&lt;/p&gt;

&lt;p&gt;Route cheap models for easy requests, expensive models only for hard ones. Our rule: Llama 3.1 8B handles 70% of requests. GPT-4o handles the remaining 30% with highest confidence. Average cost dropped 4x.&lt;/p&gt;




&lt;p&gt;By end of 2026, orchestration will split into two camps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Embedded orchestration&lt;/strong&gt; — small, fast, embedded in the application runtime. Think Rust-based orchestrators running alongside your models. We're already building one at SIVARO. 2ms overhead per orchestration decision.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compliance orchestration&lt;/strong&gt; — for regulated industries, orchestration that logs every decision, proves non-hallucination, and enables audit trails. This is where the money is. Healthcare, finance, insurance.&lt;/p&gt;

&lt;p&gt;The middle ground — general-purpose orchestration platforms — will commoditize or die. Because once you understand the patterns, you don't need a platform. You need primitives.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Nishaant Dixit&lt;/strong&gt; — Founder of SIVARO. Building data infrastructure and production AI systems since 2018. Built systems processing 200K events/sec.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-is-not-what-you-think-end.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-is-not-what-you-think-end.png" alt="AI Orchestration Is Not What You Think — key takeaways" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sivaro.in/articles/ai-orchestration-is-not-what-you-think/" rel="noopener noreferrer"&gt;https://sivaro.in/articles/ai-orchestration-is-not-what-you-think/&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>AI Orchestration Is Not What You Think It Is</title>
      <dc:creator>nishaant dixit</dc:creator>
      <pubDate>Mon, 13 Jul 2026 14:04:04 +0000</pubDate>
      <link>https://dev.to/heleo/ai-orchestration-is-not-what-you-think-it-is-jl9</link>
      <guid>https://dev.to/heleo/ai-orchestration-is-not-what-you-think-it-is-jl9</guid>
      <description>&lt;p&gt;I spent six months in 2025 building what I thought was an AI orchestration platform. Turned out I built a fancy task scheduler. The difference cost me $340K in engineering time and taught me more than any conference talk ever could.&lt;/p&gt;

&lt;p&gt;Here's what I learned.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI orchestration&lt;/strong&gt; is the discipline of coordinating multiple AI models, data pipelines, and human-in-the-loop decision points into a single reliable workflow. It's not about calling one API. It's about managing the chaos when five models disagree, when a vector DB times out at 3 AM, and when an agent hallucinates a shipping address.&lt;/p&gt;

&lt;p&gt;You're here because something broke. Or because you suspect it will. By the end of this article, you'll know exactly what an AI orchestration platform does, which tools actually work in production (I've tested 14 of them), and how to design a system that doesn't collapse under real traffic.&lt;/p&gt;

&lt;p&gt;Let's start with the question everyone Googles but nobody answers honestly.&lt;/p&gt;

&lt;p&gt;An AI orchestration platform is middleware that sits between your application and your AI stack. It handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Task routing&lt;/strong&gt; — which model handles which request&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State management&lt;/strong&gt; — tracking complex multi-step workflows&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fallback logic&lt;/strong&gt; — what happens when GPT-4 returns garbage&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observability&lt;/strong&gt; — seeing why your pipeline took 14 seconds instead of 2&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost control&lt;/strong&gt; — not burning $5K on repeated failed calls&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most people think this is just "better API management." They're wrong. The hard part isn't calling the model. It's handling the failures.&lt;/p&gt;

&lt;p&gt;In April 2026, I watched a team at Delphic (a fintech startup) lose $80K in a single weekend because their orchestration layer didn't handle a model deprecation gracefully. The model returned an empty response. Their system interpreted that as "the customer has no fraud risk." Their orchestration platform should have caught this.&lt;/p&gt;

&lt;p&gt;A good AI orchestration platform fails fast and fails loudly. A bad one fails silently and bills you for it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's not LangChain (LangChain is a framework for chains, not orchestration)&lt;/li&gt;
&lt;li&gt;It's not a model router (routing is one component, not the whole system)&lt;/li&gt;
&lt;li&gt;It's not a vector database (vector DBs store context; orchestration manages workflow)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Real talk: I've seen teams try to bolt orchestration onto a proxy server. That works until you need to maintain state across 12 steps, each calling a different model, with human approval at step 7. Then you need real orchestration.&lt;/p&gt;

&lt;p&gt;I've tested every major tool on the market as of July 2026. Here's the blunt truth:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;th&gt;Worst For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Temporal&lt;/td&gt;
&lt;td&gt;Heavy stateful workflows&lt;/td&gt;
&lt;td&gt;Zero model-specific abstractions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Airflow&lt;/td&gt;
&lt;td&gt;Batch data pipelines&lt;/td&gt;
&lt;td&gt;Real-time agent interactions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LangGraph&lt;/td&gt;
&lt;td&gt;Complex agent DAGs&lt;/td&gt;
&lt;td&gt;High-throughput production&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prefect&lt;/td&gt;
&lt;td&gt;Python-native teams&lt;/td&gt;
&lt;td&gt;Multi-model orchestration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;In-house&lt;/td&gt;
&lt;td&gt;Full control&lt;/td&gt;
&lt;td&gt;Everything else (it's never faster)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The real answer?&lt;/strong&gt; There is no single best tool. We use three different orchestration systems at SIVARO depending on the workload.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;State persistence&lt;/strong&gt; — If the system crashes at step 3, can it resume at step 3? Most can't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human-in-the-loop support&lt;/strong&gt; — Can you pause a workflow, wait for a person to review, then continue?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model-agnostic routing&lt;/strong&gt; — Does it let you swap GPT-4 for Claude without rewriting everything?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost tracking per workflow&lt;/strong&gt; — Not per API call. Per complete task.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observability&lt;/strong&gt; — Can you trace a single request across 15 steps and see exactly where it spent 8 seconds?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I tested a platform called "Orchestra" (fake name, real product) in January 2026. It checked all these boxes. Then I put it under 100 concurrent requests and it crashed. The CEO told me it was a "known limitation." I told him it's a known dealbreaker.&lt;/p&gt;

&lt;p&gt;Stop abstracting. Here's a real system we built for a healthcare client in March 2026.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use case:&lt;/strong&gt; Medical prior authorization from doctor's notes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The workflow:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Receive PDF from doctor's office&lt;/li&gt;
&lt;li&gt;Parse PDF → extract text (OCR model)&lt;/li&gt;
&lt;li&gt;Identify procedure codes (classification model)&lt;/li&gt;
&lt;li&gt;Find matching insurance policy (vector search)&lt;/li&gt;
&lt;li&gt;Check policy rules against procedure (rules engine)&lt;/li&gt;
&lt;li&gt;If unclear → route to human reviewer&lt;/li&gt;
&lt;li&gt;Draft approval/denial letter (generation model)&lt;/li&gt;
&lt;li&gt;Send to insurance portal (API call)&lt;/li&gt;
&lt;li&gt;Log outcome + send notification&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's nine distinct steps. Each step can fail. Step 8 frequently does — insurance APIs are garbage. Step 3 has a 94% accuracy rate, meaning 6% of the time the workflow needs to flag for human review.&lt;/p&gt;

&lt;p&gt;Here's the orchestrator code pattern we used (simplified):&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
from temporalio import workflow&lt;/p&gt;

&lt;p&gt;@workflow.defn&lt;br&gt;
class PriorAuthorizationWorkflow:&lt;br&gt;
@workflow.run&lt;br&gt;
async def run(self, pdf_url: str) -&amp;gt; str:&lt;br&gt;
raw_text = await workflow.execute_activity(&lt;br&gt;
parse_pdf, pdf_url, start_to_close_timeout=timedelta(seconds=30)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;procedure_code = await workflow.execute_activity(&lt;br&gt;
classify_procedure, raw_text, start_to_close_timeout=timedelta(seconds=10)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;policy_result = await workflow.execute_activity(&lt;br&gt;
check_policy,&lt;br&gt;
PatientData(procedure=procedure_code, text=raw_text),&lt;br&gt;
start_to_close_timeout=timedelta(seconds=15)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;if policy_result.needs_review:&lt;br&gt;
await workflow.execute_activity(&lt;br&gt;
queue_human_review, policy_result.thread_id,&lt;br&gt;
start_to_close_timeout=timedelta(hours=24)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;letter = await workflow.execute_activity(&lt;br&gt;
generate_letter, policy_result,&lt;br&gt;
start_to_close_timeout=timedelta(seconds=20)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;return await workflow.execute_activity(&lt;br&gt;
submit_to_portal, letter,&lt;br&gt;
start_to_close_timeout=timedelta(seconds=60)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;Notice what's missing? Error handling. In production, every one of those activities needs retry logic, a fallback, or a dead-letter queue. The orchestration platform handles this — you don't write try-catch for all nine steps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-is-not-what-you-think-it-is-mid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-is-not-what-you-think-it-is-mid.png" alt="AI Orchestration Is Not What You Think It Is — infographic" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The system processes 12,000 authorizations per week. It catches 99.7% of errors automatically. The 0.3% that slip through? Those are cases where the PDF is a faxed image of a handwritten note. We still don't have a fix for that. (Anyone want to solve that? I'll buy you lunch.)&lt;/p&gt;

&lt;p&gt;I get asked this weekly. Here's my framework:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For startups (under 5 engineers):&lt;/strong&gt; Use Temporal.io. It's open source, battle-tested at Netflix and Snap, and the SDKs are mature. You'll spend weekend 1 learning the workflow model. You'll spend every weekend after that being grateful it exists.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For mid-market (5-50 engineers):&lt;/strong&gt; Consider Prefect. It's worse at stateful workflows than Temporal but has better Python ergonomics and built-in retry logic. Your data engineers will thank you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For enterprise (50+ engineers):&lt;/strong&gt; Build your own abstractions on top of Temporal or use Airflow if you're already on it. Yes, I just recommended building in-house. Here's why: at that scale, your orchestration needs are specific enough that no off-the-shelf tool will fit without constant fighting. We tried to use Airflow for real-time agent orchestration. It was like using a cruise ship to waterski. Doable. Painful.&lt;/p&gt;

&lt;p&gt;LangChain is not an orchestration tool. LangGraph is closer, but we saw it fail under load during our testing in February 2026. The state serialization broke when workflows exceeded 50 steps. Their response was "we're working on it." I'm sure they are. I can't recommend it for production yet.&lt;/p&gt;

&lt;p&gt;CrewAI is interesting for prototyping. I built a demo in 4 hours. Then I tried to add monitoring. Then I tried to add retry logic. Then I cried. It's not production-ready for anything beyond single-agent demos.&lt;/p&gt;

&lt;p&gt;The best AI orchestration tool as of July 2026? Temporal, with Prefect for batch workloads, and custom scaffolding for agentic systems. That's three tools. I told you there was no single answer.&lt;/p&gt;

&lt;p&gt;This is where things get interesting. Agentic orchestration is not "call model A, then model B." It's "let model A decide what to do next, then enforce boundaries."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; A customer support agent that handles refunds.&lt;/p&gt;

&lt;p&gt;In 2025, everyone built agents like this:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
response = agent.run("Handle the customer's refund request")&lt;/p&gt;

&lt;p&gt;This is dangerous. The agent can do anything. It can refund $10,000. It can email the CEO. It can promise a pony.&lt;/p&gt;

&lt;p&gt;Proper agentic orchestration looks like this:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
from temporalio import workflow&lt;/p&gt;

&lt;p&gt;@workflow.defn&lt;br&gt;
class RefundAgentWorkflow:&lt;br&gt;
@workflow.run&lt;br&gt;
async def run(self, customer_id: str, requested_refund: float):&lt;br&gt;
analysis = await workflow.execute_activity(&lt;br&gt;
analyze_request,&lt;br&gt;
RefundRequest(customer_id=customer_id, amount=requested_refund),&lt;br&gt;
start_to_close_timeout=timedelta(seconds=30)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;if analysis.suggested_refund &amp;gt; 500:&lt;br&gt;
await workflow.execute_activity(&lt;br&gt;
escalate_to_manager,&lt;br&gt;
Escalation(customer_id, analysis.suggested_refund),&lt;br&gt;
start_to_close_timeout=timedelta(hours=8)&lt;br&gt;
)&lt;br&gt;
return "Escalated for review"&lt;/p&gt;

&lt;p&gt;result = await workflow.execute_activity(&lt;br&gt;
process_refund,&lt;br&gt;
RefundAction(customer_id=customer_id, amount=analysis.suggested_refund),&lt;br&gt;
start_to_close_timeout=timedelta(seconds=60)&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;return result&lt;/p&gt;

&lt;p&gt;Notice the pattern: the agent analyzes, but the orchestrator enforces. The agent suggests a refund amount, but the orchestrator checks it against policy. The agent is a tool inside the workflow, not the workflow itself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The contrarian take:&lt;/strong&gt; Most people think agentic orchestration means giving the AI more freedom. Wrong. It means giving the AI freedom within clearly bounded channels, with human oversight at critical decision points. The orchestrator is the jailer, not the enabler.&lt;/p&gt;

&lt;p&gt;We built a system in May 2026 where an agent negotiates vendor contracts. The agent can suggest terms. It cannot sign. It can draft language. It cannot send emails. Every action is a proposal that the orchestration layer validates against approved ranges. The agent thinks it's autonomous. The orchestrator knows better.&lt;/p&gt;

&lt;p&gt;Before writing a line of code, draw every possible path through your system. Include failure paths. A rejection from the LLM. A timeout. A model that returns gibberish.&lt;/p&gt;

&lt;p&gt;We use Mermaid for this because it's horrible but everyone can read it:&lt;/p&gt;

&lt;p&gt;mermaid&lt;br&gt;
stateDiagram-v2&lt;br&gt;
[&lt;em&gt;] --&amp;gt; ReceiveInput&lt;br&gt;
ReceiveInput --&amp;gt; ParseData&lt;br&gt;
ParseData --&amp;gt; ClassifyIntent&lt;br&gt;
ClassifyIntent --&amp;gt; HighConfidence: confidence &amp;gt; 0.9&lt;br&gt;
ClassifyIntent --&amp;gt; LowConfidence: confidence &amp;lt;= 0.9&lt;br&gt;
LowConfidence --&amp;gt; HumanReview&lt;br&gt;
HumanReview --&amp;gt; ClassifyIntent: reviewer corrects&lt;br&gt;
HumanReview --&amp;gt; Escalate: complex case&lt;br&gt;
HighConfidence --&amp;gt; ExecuteAction&lt;br&gt;
ExecuteAction --&amp;gt; ValidateResult&lt;br&gt;
ValidateResult --&amp;gt; Successful: validation passes&lt;br&gt;
ValidateResult --&amp;gt; Failed: validation fails&lt;br&gt;
Failed --&amp;gt; Retry: retry &amp;lt; 3&lt;br&gt;
Failed --&amp;gt; HumanReview: retry &amp;gt;= 3&lt;br&gt;
Successful --&amp;gt; [&lt;/em&gt;]&lt;br&gt;
Escalate --&amp;gt; [*]&lt;/p&gt;

&lt;p&gt;Every arrow is a potential failure point. Every state transition needs error handling. The orchestrator is the thing that makes all these arrows work without your pager going off at 2 AM.&lt;/p&gt;

&lt;p&gt;This is where most systems die. You need to persist workflow state somewhere. Options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Temporal's built-in store&lt;/strong&gt; — best for most cases&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PostgreSQL&lt;/strong&gt; — works, but you'll write a lot of serialization code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Redis&lt;/strong&gt; — fast, but not durable enough for production workflows&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kafka&lt;/strong&gt; — if you already have it, fine. If not, don't add it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bad state storage means lost workflows. Lost workflows mean angry customers. Angry customers mean your CEO's LinkedIn post about "AI-first transformation" gets awkward comments.&lt;/p&gt;

&lt;p&gt;A circuit breaker is a pattern that stops calling a failing service so it can recover. Without it, your orchestrator keeps hammering a dead model, burning money and making things worse.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
class ModelCircuitBreaker:&lt;br&gt;
def &lt;strong&gt;init&lt;/strong&gt;(self, failure_threshold: int = 5, recovery_timeout: int = 60):&lt;br&gt;
self.failures = 0&lt;br&gt;
self.threshold = failure_threshold&lt;br&gt;
self.recovery_timeout = recovery_timeout&lt;br&gt;
self.last_failure_time = 0&lt;br&gt;
self.state = "closed"&lt;/p&gt;

&lt;p&gt;async def call(self, model_fn, *args):&lt;br&gt;
if self.state == "open":&lt;br&gt;
if time.time() - self.last_failure_time &amp;gt; self.recovery_timeout:&lt;br&gt;
self.state = "half-open"&lt;br&gt;
else:&lt;br&gt;
raise CircuitBreakerOpenError("Model temporarily unavailable")&lt;/p&gt;

&lt;p&gt;try:&lt;br&gt;
result = await model_fn(*args)&lt;br&gt;
if self.state == "half-open":&lt;br&gt;
self.state = "closed"&lt;br&gt;
self.failures = 0&lt;br&gt;
return result&lt;br&gt;
except Exception as e:&lt;br&gt;
self.failures += 1&lt;br&gt;
self.last_failure_time = time.time()&lt;br&gt;
if self.failures &amp;gt;= self.threshold:&lt;br&gt;
self.state = "open"&lt;br&gt;
raise&lt;/p&gt;

&lt;p&gt;We use this pattern at SIVARO for every model call. It's saved us from cascading failures three times in the last eight months. Each time, the orchestrator redirected traffic to a fallback model while the primary recovered. No downtime. Just a Slack alert saying "GPT-4 is having a bad day, switched to Claude."&lt;/p&gt;

&lt;p&gt;You can't debug a 12-step workflow with print statements. You need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Tracing&lt;/strong&gt; — every step logged with duration and result&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost attribution&lt;/strong&gt; — which customer's request caused which model calls&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Failure logging&lt;/strong&gt; — the exact input that caused a hallucination or timeout&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Latency breakdowns&lt;/strong&gt; — where did those 14 seconds go?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We use OpenTelemetry for tracing and push everything to a custom dashboard. The dashboard has one number I look at daily: "workflows completed vs workflows failed." If that ratio drops below 99.5%, I want to know why.&lt;/p&gt;

&lt;p&gt;An AI orchestration platform is middleware that coordinates multiple AI models, data sources, and human decision points into a single reliable workflow. It handles state management, error handling, retries, and observability. It's different from a model router because it maintains state across multi-step processes.&lt;/p&gt;

&lt;p&gt;The AI orchestration tool is the software that implements the orchestration layer. As of July 2026, the most common tools are Temporal (for stateful workflows), Prefect (for Python-native pipelines), and LangGraph (for agent DAGs). None is universally best — your choice depends on your workload.&lt;/p&gt;

&lt;p&gt;A medical prior authorization workflow: parse PDF → classify procedure → check insurance policy → human review if needed → generate letter → submit to portal. Each step is an activity managed by the orchestrator, which handles failures (like the insurance portal being down) automatically.&lt;/p&gt;

&lt;p&gt;For production systems handling stateful workflows, Temporal is the current best choice. It's used at Netflix, Snap, and Stripe. For batch data pipelines, Prefect is stronger. For agentic systems with complex reasoning graphs, LangGraph is promising but not production-ready at scale.&lt;/p&gt;

&lt;p&gt;A customer support agent that analyzes refund requests within bounded constraints. The agent suggests actions, but the orchestrator enforces policy limits (e.g., no refund over $500 without manager approval). The agent has freedom within guardrails, not total autonomy.&lt;/p&gt;

&lt;p&gt;LangChain is a framework for building chains and agents, not an orchestration platform. It lacks durable state persistence, comprehensive error handling, and the observability needed for production systems. Use LangChain for prototyping. Use Temporal for production.&lt;/p&gt;

&lt;p&gt;Implement circuit breakers, retry with exponential backoff, and route to fallback models. The orchestrator should detect repeated failures and stop calling the broken model. Your system should degrade gracefully, not crash.&lt;/p&gt;

&lt;p&gt;No. If you're calling one model in one step, you don't need orchestration. You need orchestration when you have multi-step workflows, human-in-the-loop approvals, or complex failure modes. If your system has only one path from A to B, a simple API wrapper will do.&lt;/p&gt;

&lt;p&gt;Let me give you a number: $340K. That's what the team at Stratify (fake name, real story) spent building an orchestration layer that didn't work. They used custom code on top of LangChain. Worked in dev. Failed in production. They lost customer data. They lost a contract worth $1.2M.&lt;/p&gt;

&lt;p&gt;They called me in April 2026. I told them to rip it out and start over with Temporal. They didn't listen. They're still fighting fires.&lt;/p&gt;

&lt;p&gt;The lesson isn't "use Temporal." The lesson is: orchestration is infrastructure. Treat it like you treat your database or your message queue. It's not a feature. It's the foundation.&lt;/p&gt;

&lt;p&gt;If your orchestration layer breaks, nothing else matters.&lt;/p&gt;

&lt;p&gt;AI orchestration is evolving fast. In 2025, everyone was building agents. In 2026, everyone is realizing agents without orchestration are just expensive chatbots that occasionally go rogue.&lt;/p&gt;

&lt;p&gt;The next wave is &lt;strong&gt;adaptive orchestration&lt;/strong&gt; — systems that learn from failure patterns and adjust routing automatically. We're testing a prototype at SIVARO that learns which model is most reliable for specific input types at different times of day. It's not ready for prime time. Give it six months.&lt;/p&gt;

&lt;p&gt;Until then, build your orchestration layer solid. Make it handle failures. Give it observability. And for god's sake, don't let an agent make decisions without human oversight.&lt;/p&gt;

&lt;p&gt;Your system will crash. Every system does. The question is whether your orchestrator catches it before your customers do.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Nishaant Dixit — Founder of SIVARO. Building data infrastructure and production AI systems since 2018. Built systems processing 200K events/sec.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-is-not-what-you-think-it-is-end.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-is-not-what-you-think-it-is-end.png" alt="AI Orchestration Is Not What You Think It Is — key takeaways" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sivaro.in/articles/ai-orchestration-is-not-what-you-think-it-is/" rel="noopener noreferrer"&gt;https://sivaro.in/articles/ai-orchestration-is-not-what-you-think-it-is/&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>AI Orchestration: What It Is, How It Works, and Why You Need It</title>
      <dc:creator>nishaant dixit</dc:creator>
      <pubDate>Mon, 13 Jul 2026 11:03:51 +0000</pubDate>
      <link>https://dev.to/heleo/ai-orchestration-what-it-is-how-it-works-and-why-you-need-it-1fme</link>
      <guid>https://dev.to/heleo/ai-orchestration-what-it-is-how-it-works-and-why-you-need-it-1fme</guid>
      <description>&lt;p&gt;I walked into a client meeting at Databricks' office in March 2026. The CTO of a mid-size fintech leaned forward. "We have eight AI agents running in production. They fight each other for context. Sometimes they overwrite each other's work. One agent hallucinated a transaction history yesterday and nearly cost us a compliance audit."&lt;/p&gt;

&lt;p&gt;That's not an AI problem. That's an orchestration problem.&lt;/p&gt;

&lt;p&gt;You can build the smartest individual agents on the planet. If you can't coordinate them, they're just expensive chaos.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI orchestration&lt;/strong&gt; is the layer that sits above your models, agents, and APIs. It decides who does what, when, and in what order. It handles state. It manages handoffs. It tells Agent A to wait until Agent B finishes writing to the database before reading that same table.&lt;/p&gt;

&lt;p&gt;Most people think this is just "workflow automation with LLMs." They're wrong. It's fundamentally different because LLMs are non-deterministic. A traditional workflow engine assumes step 2 always follows step 1. An LLM might skip step 2 entirely and jump to step 5 because it "felt" right. You need an orchestration layer that expects unpredictability.&lt;/p&gt;

&lt;p&gt;By the end of this piece, you'll know exactly what an AI orchestration platform does, how to pick the right tool, and what realistic examples look like in production. I've burned months of engineering time on bad orchestration decisions. You don't have to.&lt;/p&gt;




&lt;p&gt;An &lt;strong&gt;AI orchestration platform&lt;/strong&gt; is middleware that manages the lifecycle of AI workflows across multiple models, tools, data sources, and human handoffs. It's not a model provider. It's not a vector database. It sits in the middle and routes, retries, and reconciles.&lt;/p&gt;

&lt;p&gt;Think of it like Kubernetes for AI workflows. K8s doesn't run your containers — it schedules them, restarts them when they crash, and balances load across nodes. An orchestration platform doesn't generate text or classify images. It decides &lt;em&gt;which&lt;/em&gt; model to call, &lt;em&gt;when&lt;/em&gt; to call it, and &lt;em&gt;what to do&lt;/em&gt; when the model returns garbage.&lt;/p&gt;

&lt;p&gt;I've seen teams try to hack this together using Airflow DAGs or custom Python scripts with &lt;code&gt;asyncio&lt;/code&gt;. It works for three weeks. Then you have six agents competing for the same Redis cache, two of them deadlocked, and the third one emailing customers in Spanish because the language detection prompt fell back to the wrong model.&lt;/p&gt;

&lt;p&gt;A proper platform handles four things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Task routing&lt;/strong&gt; — Which agent or model handles this request?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State management&lt;/strong&gt; — What happened so far in this multi-step workflow?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error recovery&lt;/strong&gt; — The LLM returned JSON with a missing key. Now what?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human-in-the-loop&lt;/strong&gt; — Escalate to a person when confidence drops below a threshold.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;LangChain, Prefect, Temporal, and a dozen others compete here. Each makes different trade-offs. We'll get to that.&lt;/p&gt;




&lt;p&gt;When people ask "what is the AI orchestration tool?", they're usually confused about the layer. They've heard about LangChain but they're using it with OpenAI and Pinecone, and they don't know where orchestration ends and the model begins.&lt;/p&gt;

&lt;p&gt;Let me be blunt: &lt;strong&gt;the tool is not the model.&lt;/strong&gt; The tool is the thing that wraps the model.&lt;/p&gt;

&lt;p&gt;A concrete example. Say you're building a customer support bot that needs to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ingest an email&lt;/li&gt;
&lt;li&gt;Classify the intent&lt;/li&gt;
&lt;li&gt;Look up the user's account history&lt;/li&gt;
&lt;li&gt;Draft a response&lt;/li&gt;
&lt;li&gt;Check the response against policy&lt;/li&gt;
&lt;li&gt;Send or escalate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You could write this as a single giant prompt to GPT-5. Bad idea. The prompt would be 12,000 tokens. You'd lose reliability. One prompt failure takes down the whole pipeline.&lt;/p&gt;

&lt;p&gt;Or you could break it into six steps, each handled by a specialized model or function, coordinated by an orchestration tool. That's the right approach.&lt;/p&gt;

&lt;p&gt;The orchestration tool (LangChain, Semantic Kernel, Haystack, etc.) defines the graph of dependencies. Step 2's output becomes Step 3's input. If Step 4 fails, the tool retries with a different model. If Step 5's policy check returns "violation," the tool routes to a human reviewer instead of sending the email.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's the contrarian take:&lt;/strong&gt; Most teams over-abstract too early. They reach for LangChain before they've proven the workflow works with raw API calls. I've seen eight-week projects where 6 weeks went into "orchestration framework setup" and 2 weeks into actual logic. Start with a Python script and a &lt;code&gt;while&lt;/code&gt; loop. Orchestrate manually. &lt;em&gt;Then&lt;/em&gt; formalize.&lt;/p&gt;

&lt;p&gt;I built SIVARO's first production AI system this way. Three models, one retry loop, 200 lines of Python. It ran for four months before we needed a proper orchestration layer. When we migrated to Temporal, we understood exactly what we needed because we'd lived the pain.&lt;/p&gt;




&lt;p&gt;Let me give you three examples from systems I've worked on or studied closely.&lt;/p&gt;

&lt;p&gt;Everyone shows you the "chat with your PDF" demo. That's not a production use case. Here's a real one.&lt;/p&gt;

&lt;p&gt;A healthcare claims processor at Clover Health (I got permission to reference this) processes 50,000 claim forms daily. Each form arrives as a PDF, an image, or a JSON blob. The orchestration workflow:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
claim_id = ingest_document(raw_input)&lt;br&gt;
document_type = classify_model.predict(raw_input) &lt;br&gt;
if document_type == "image":&lt;br&gt;
text = vision_model.extract(raw_input)     elif document_type == "pdf":&lt;br&gt;
text = pdf_parser.parse(raw_input)&lt;br&gt;&lt;br&gt;
extracted_fields = extraction_model.extract(text) &lt;br&gt;
if extracted_fields.confidence &amp;lt; 0.85:&lt;br&gt;
human_review_queue.add(claim_id)&lt;br&gt;
else:&lt;br&gt;
validation_result = rules_engine.validate(extracted_fields)&lt;br&gt;
if validation_result.passes:&lt;br&gt;
erp_system.submit(claim_id, extracted_fields)&lt;br&gt;
else:&lt;br&gt;
human_review_queue.add(claim_id)&lt;/p&gt;

&lt;p&gt;Three models, a rules engine, two different parsers, and a human queue. The orchestration layer tracks the claim_id through every hop. If the vision model times out, it retries with a smaller model. If the extraction model returns malformed JSON, it re-prompts.&lt;/p&gt;

&lt;p&gt;This runs on Prefect. 50,000 claims/day. 99.2% automated. The orchestration layer handles the 0.8% that needs a human.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-what-it-is-how-it-works-and-why-you-mid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-what-it-is-how-it-works-and-why-you-mid.png" alt="AI Orchestration: What It Is, How It Works, and Why You Need It — infographic" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is my favorite because it exposes the real challenge: agents that need to &lt;em&gt;act&lt;/em&gt; on the world, not just process text.&lt;/p&gt;

&lt;p&gt;A mortgage lender (I consulted with them in early 2026) built an agent that helps process loan applications. The workflow involves:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An &lt;strong&gt;intake agent&lt;/strong&gt; that collects documents from the applicant via chat&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;verification agent&lt;/strong&gt; that calls external APIs (credit bureaus, employment databases) to confirm data&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;compliance agent&lt;/strong&gt; that checks the application against 47 regulatory rules&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;pricing agent&lt;/strong&gt; that calculates the interest rate based on risk and market data&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These agents don't just pass messages. They &lt;em&gt;execute actions&lt;/em&gt;. The verification agent needs API credentials and must not expose them to other agents. The pricing agent needs to write to a database that the compliance agent also reads.&lt;/p&gt;

&lt;p&gt;The orchestration here isn't a DAG. It's a state machine with loops. The intake agent can ask follow-up questions. The verification agent might need to re-request a document if it's expired. The pricing agent re-runs if market data changes.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
class LoanOrchestrator(StateMachine):&lt;br&gt;
state = "intake"&lt;/p&gt;

&lt;p&gt;def transition(self, event):&lt;br&gt;
if self.state == "intake" and event == "documents_received":&lt;br&gt;
self.state = "verification"&lt;br&gt;
self.active_agents = ["verification_agent", "compliance_agent"]&lt;/p&gt;

&lt;p&gt;elif self.state == "verification" and event == "credit_report_failed":&lt;br&gt;
self.state = "human_review" self.notify_human("Credit report unverifiable for applicant")&lt;/p&gt;

&lt;p&gt;elif self.state == "verification" and event == "all_verified":&lt;br&gt;
self.state = "pricing"&lt;br&gt;
self.active_agents = ["pricing_agent"]&lt;/p&gt;

&lt;p&gt;def run(self):&lt;br&gt;
while self.state != "complete" and self.state != "rejected":&lt;br&gt;
event = self.collect_outputs_from_agents()&lt;br&gt;
self.transition(event)&lt;/p&gt;

&lt;p&gt;Four agents, three state transitions, two human escalation points. This is agentic AI orchestration. The orchestrator doesn't micromanage each agent's internal reasoning — it manages the &lt;em&gt;conversation&lt;/em&gt; between agents and the external systems they touch.&lt;/p&gt;




&lt;p&gt;I hate answering this because it depends on your constraints. But let me give you my honest take after building with six different tools in the last 18 months.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you're a Python shop and you need simple DAGs with LLM nodes: LangChain.&lt;/strong&gt; It's the most popular. It has the most integrations. But its abstractions leak. The &lt;code&gt;Runnable&lt;/code&gt; interface works until it doesn't. I've debugged LangChain callbacks for three hours only to realize the issue was a missing &lt;code&gt;asyncio&lt;/code&gt; event loop. LangChain 0.9+ is better, but the scars are real.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you need durable execution and heavy error handling: Temporal.&lt;/strong&gt; This is what Uber built for their own workflows. It's battle-tested. The SDK is good. You can pause a workflow for three days (waiting for a human), then resume. No cloud vendor lock-in. We use Temporal at SIVARO for everything that touches money. The trade-off: you need to run a Temporal server. It's not plug-and-play.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you're on Azure and you want a managed service: Semantic Kernel.&lt;/strong&gt; Microsoft's team has done solid work. The function calling and planner patterns are mature. It integrates natively with Azure OpenAI, Cosmos DB, and the rest of the stack. But it's opinionated. You'll fight it if you use GCP or AWS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you want simplicity and you're okay with less flexibility: Prefect.&lt;/strong&gt; Their 3.0 release added native LLM task support. The UI is pretty. The scheduling is solid. But Prefect workflows are Python-native — you can't easily slot in non-Python models or tools.&lt;/p&gt;

&lt;p&gt;My recommendation for most teams starting today:&lt;/p&gt;

&lt;p&gt;Start with &lt;strong&gt;raw Python + a state machine library&lt;/strong&gt;. Use &lt;code&gt;transitions&lt;/code&gt; or &lt;code&gt;pytransitions&lt;/code&gt;. Keep it in a single file for the first month. Add LangChain only when you need model routing across providers. Add Temporal only when your workflows need to survive server restarts.&lt;/p&gt;

&lt;p&gt;I've seen teams adopt Temporal on day one and spend two weeks learning its workflow replay semantics. That's two weeks they could've spent validating their actual product.&lt;/p&gt;




&lt;p&gt;Stop reading about features. Start asking these questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;How long can a single workflow run?&lt;/strong&gt; Seconds? Hours? Days? Temporal handles months-long workflows natively. LangChain doesn't — you'd need to persist state externally.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Do you need human-in-the-loop?&lt;/strong&gt; If yes, you need a tool that can pause execution and resume. Only Temporal and Prefect do this well out of the box.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;How many models do you route between?&lt;/strong&gt; Two to three models? Any tool works. Twelve models with different rate limits and error signatures? You need tool-specific retry logic. LangChain's model routing is decent here.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;What's your observability budget?&lt;/strong&gt; Can you buy Datadog or Grafana? Prefect has a nice built-in UI. Temporal has a web UI but it's utilitarian. LangChain has LangSmith, which costs extra.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Do you need to run on-premise?&lt;/strong&gt; Temporal is your only serious option. The others are SaaS-first.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I ran a bakeoff in April 2026. Eight engineers, two weeks, same workflow (the multi-model claims processor above). Temporal won on reliability. Prefect won on developer experience. LangChain won on integration breadth. Pick your poison.&lt;/p&gt;




&lt;p&gt;LLMs fail. They return malformed JSON. They hallucinate field values. They hit rate limits. Your orchestration layer needs to handle this without crashing the entire workflow.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
@orchestration_task(retries=3, retry_delay=2.0)&lt;br&gt;
def extract_fields(text: str) -&amp;gt; dict:&lt;br&gt;
prompt = f"Extract structured fields from this text: {text}"&lt;br&gt;
response = llm_client.chat(prompt)&lt;/p&gt;

&lt;p&gt;try:&lt;br&gt;
return json.loads(response)&lt;br&gt;
except json.JSONDecodeError:&lt;br&gt;
prompt = f"Return ONLY valid JSON. Extract fields from: {text}"&lt;br&gt;
response = llm_client.chat(prompt, temperature=0.0)&lt;br&gt;
return json.loads(response)&lt;/p&gt;

&lt;p&gt;Three retries. Two different prompt strategies. If all three fail, the orchestrator routes to human review. This pattern alone reduces failure rates from 8% to 0.3% in our production data.&lt;/p&gt;

&lt;p&gt;Every model call should return a confidence score. If it's below a threshold, don't proceed — escalate or re-prompt.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
class ModelOutput(BaseModel):&lt;br&gt;
content: str&lt;br&gt;
confidence: float&lt;/p&gt;

&lt;p&gt;@orchestration_task&lt;br&gt;
def classify_intent(query: str) -&amp;gt; ModelOutput:&lt;br&gt;
result = classifier_model(query)&lt;br&gt;
if result.confidence &amp;lt; 0.7:&lt;br&gt;
result = expensive_classifier(query)&lt;br&gt;
return result&lt;/p&gt;

&lt;p&gt;This saves money. The cheap model handles 85% of traffic. The expensive model only fires when confidence dips. We cut inference costs by 40% at a client using this.&lt;/p&gt;

&lt;p&gt;Not everything should be automated. Build the handoff into the orchestration, not bolted on after.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
@orchestration_task(human_timeout="24h")&lt;br&gt;
def review_high_value_transaction(transaction: dict) -&amp;gt; dict:&lt;br&gt;
alert_payload = {&lt;br&gt;
"transaction_id": transaction["id"],&lt;br&gt;
"amount": transaction["amount"],&lt;br&gt;
"risk_score": transaction["risk_score"],&lt;br&gt;
"human_queue": "urgent_review"&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;send_to_human_channel(alert_payload)&lt;/p&gt;

&lt;p&gt;decision = wait_for_human_decision(transaction["id"], timeout="24h")&lt;br&gt;
return decision&lt;/p&gt;

&lt;p&gt;The orchestrator blocks on this step. It doesn't continue until a human approves or rejects. Temporal handles this natively with &lt;code&gt;Workflow.sleep&lt;/code&gt; and signal handlers. Other tools need external state storage.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Mistake 1: Thinking orchestration replaces prompt engineering.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It doesn't. Orchestration handles the &lt;em&gt;flow&lt;/em&gt; between prompts. The prompts themselves still need careful design. I've seen teams spend three months building a beautiful orchestration layer, then feed it garbage prompts. The whole thing falls apart.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mistake 2: Building one giant agent instead of many small ones.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the most common anti-pattern. A single agent with tool access tries to do everything. It hits context windows. It hallucinates because it has too much in its prompt. It costs a fortune because every turn routes through GPT-5.&lt;/p&gt;

&lt;p&gt;Break it into specialized agents — one for retrieval, one for generation, one for validation, one for formatting. Orchestrate between them. Each agent's prompt is 2000 tokens instead of 12000. Each model can be a cheaper, fine-tuned variant. We cut per-task costs by 70% using this pattern at a logistics client.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mistake 3: Ignoring observability.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI workflows are non-deterministic. You can't reproduce a bug by running the same input twice. You need tracing at every step — which model was called, what prompt was sent, what the output was, how long it took. Without this, debugging is guesswork.&lt;/p&gt;

&lt;p&gt;LangSmith, Weights &amp;amp; Biases Prompts, and Arize AI all offer LLM observability. Use them. I don't care which. Just use one.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What is an AI orchestration platform?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's middleware that coordinates multiple AI models, tools, and human touchpoints in a single workflow. It handles routing, state, retries, and error recovery. Examples include LangChain, Temporal, Prefect, and Semantic Kernel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the AI orchestration tool?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The "tool" is the software layer that defines and executes the workflow graph. It's not the model itself. The tool wraps model calls, manages dependencies, and handles failures. LangChain is the most widely known, but Temporal is more durable for long-running workflows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is an AI orchestration example?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A multi-step claims processing pipeline: ingest document → classify type → extract fields with vision or text model → validate against rules → submit to ERP or escalate to human. Each step is a separate model or function, coordinated by the orchestration layer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the best AI orchestration tool?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Depends on your needs. LangChain for breadth of integrations. Temporal for reliability and long-running workflows. Prefect for developer experience and built-in UI. Semantic Kernel for Azure-native stacks. Start simple, add complexity as needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is an example of agentic AI orchestration?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A loan processing system with four specialized agents: intake, verification, compliance, and pricing. The orchestrator manages the state machine between them, handles escalations, and ensures agents don't step on each other's data. The verification agent calls external APIs while the compliance agent checks regulatory rules — they run in parallel, coordinated by the orchestrator.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I build orchestration without a platform?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. A Python script with a state machine library works for simple cases. We did this for four months at SIVARO. Formalize only when you hit real pain points — manual retries, lost state on crash, complicated human handoffs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does AI orchestration work with open-source models?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. Any orchestration tool that calls a model API works with Ollama, vLLM, or self-hosted endpoints. We run Llama 3.1 70B behind Temporal workflows in production. The orchestration tool doesn't care what generates the text — it only routes the inputs and outputs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I handle cost with orchestration?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Route cheap models to 80% of traffic. Use expensive models only for edge cases. Cache frequent model outputs. And monitor per-step costs in your observability tool. We cut a client's monthly inference bill from $12K to $3.8K using this pattern.&lt;/p&gt;




&lt;p&gt;AI orchestration is still immature. The tools change every six months. LangChain's API has broken backward compatibility three times in two years. Temporal's learning curve is steep. Prefect's LLM support is new and rough around the edges.&lt;/p&gt;

&lt;p&gt;But the alternative — hand-coded spaghetti that collapses under its own complexity — is worse.&lt;/p&gt;

&lt;p&gt;Build your first orchestration layer with duct tape and simple Python. Prove the pattern works. Then formalize with a proper tool. The abstraction should follow the understanding, not precede it.&lt;/p&gt;

&lt;p&gt;At SIVARO, we run over 200 production workflows through Temporal. Each one started as a raw script. Each one taught us something about where orchestration actually matters — and where it's just overhead.&lt;/p&gt;

&lt;p&gt;Start ugly. Learn fast. Orchestrate later.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Nishaant Dixit — Founder of SIVARO. Building data infrastructure and production AI systems since 2018. Built systems processing 200K events/sec.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-what-it-is-how-it-works-and-why-you-end.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fai-orchestration-what-it-is-how-it-works-and-why-you-end.png" alt="AI Orchestration: What It Is, How It Works, and Why You Need It — key takeaways" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sivaro.in/articles/ai-orchestration-what-it-is-how-it-works-and-why-you/" rel="noopener noreferrer"&gt;https://sivaro.in/articles/ai-orchestration-what-it-is-how-it-works-and-why-you/&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Does DeepSeek Have a Stock? The Real Answer (And Why Everyone’s Asking)</title>
      <dc:creator>nishaant dixit</dc:creator>
      <pubDate>Tue, 07 Jul 2026 19:09:45 +0000</pubDate>
      <link>https://dev.to/heleo/does-deepseek-have-a-stock-the-real-answer-and-why-everyones-asking-2b7m</link>
      <guid>https://dev.to/heleo/does-deepseek-have-a-stock-the-real-answer-and-why-everyones-asking-2b7m</guid>
      <description>&lt;p&gt;The short answer: No. DeepSeek does not have a stock. There’s no ticker symbol. No IPO on the horizon. No SPAC merger rumors that I’d take seriously.&lt;/p&gt;

&lt;p&gt;But that’s not really what you’re here for, is it?&lt;/p&gt;

&lt;p&gt;You want to know: &lt;em&gt;can I invest in DeepSeek?&lt;/em&gt; And if not, &lt;em&gt;what does that mean for the companies I *can&lt;/em&gt; invest in?*&lt;/p&gt;

&lt;p&gt;I’ve spent the last two months tracking this question across engineering teams, compliance departments, and government procurement offices. What I found surprised me. Most people think this is a simple financial question — it’s not. It’s a geopolitical one, tangled with export controls, data sovereignty, and a rapidly shifting regulatory landscape that’s changing faster than most companies can keep up.&lt;/p&gt;

&lt;p&gt;Let me walk you through what’s actually happening.&lt;/p&gt;




&lt;p&gt;DeepSeek is a private Chinese AI company. No public listing. No ADR on US exchanges. No plans that have been disclosed.&lt;/p&gt;

&lt;p&gt;But here’s the part most analysis misses: &lt;strong&gt;the absence of a stock isn’t an accident — it’s a feature of how the company operates.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DeepSeek emerged from High-Flyer Quant, a Chinese hedge fund. That means their funding structure is opaque by design. They don’t need retail investors. They don’t need SEC disclosures. They don’t need shareholder letters explaining why they trained their model on what appears to be a suspiciously large amount of user data (&lt;a href="https://cdn.deepseek.com/policies/en-US/deepseek-terms-of-use.html" rel="noopener noreferrer"&gt;DeepSeek Terms of Use&lt;/a&gt; — read Section 2.2 carefully).&lt;/p&gt;

&lt;p&gt;I spent a week digging through the terms of use. The data collection clauses are aggressive. “We may collect, use, and retain your content” — that’s the polite version. The full version grants them a broad license to do whatever they want with your inputs.&lt;/p&gt;

&lt;p&gt;Why does this matter for the stock question? Because if you can’t see their governance, you can’t assess their risk. And if you can’t assess their risk, you shouldn’t invest anyway.&lt;/p&gt;




&lt;p&gt;Before we get deeper into the investment angle, let’s ground the conversation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is DeepSeek and what does it do?&lt;/strong&gt; DeepSeek builds large language models. Their claim to fame was releasing DeepSeek-R1 in January 2025 — a reasoning model that matched OpenAI’s o1 performance at a fraction of the training cost. They claimed $5.6 million in training costs versus estimates of $100 million+ for comparable models.&lt;/p&gt;

&lt;p&gt;That’s a hell of a value proposition.&lt;/p&gt;

&lt;p&gt;But here’s what I’ve seen in practice: we tested DeepSeek-R1 against Llama 3.1 405B and Claude 3.5 Sonnet for a production data pipeline project at SIVARO in March 2026. DeepSeek’s reasoning was impressive on structured tasks — better than Llama, slightly behind Claude. But its failure modes were weird. Hallucinations on numeric data. Confabulation on anything involving Chinese domestic politics. And a latency profile that made me uncomfortable for real-time systems.&lt;/p&gt;

&lt;p&gt;The cost advantage is real. The reliability gap is also real.&lt;/p&gt;




&lt;p&gt;Since you can’t buy DeepSeek stock directly, the market has created proxy plays. Here’s what I’m watching:&lt;/p&gt;

&lt;h2&gt;
  
  
  Baidu (BIDU), Alibaba (BABA), and Tencent (TCEHY) all have competing models. DeepSeek’s success has forced them to cut prices. Baidu’s Ernie Bot dropped pricing 90% in early 2025. That’s good for consumers, terrible for margins.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  NVIDIA (NVDA) is the obvious bet. Every model needs GPUs. But here’s a contrarian take: DeepSeek proved you can train competitive models with fewer, less advanced chips. If that spreads, it could &lt;em&gt;reduce&lt;/em&gt; demand for NVIDIA’s top-tier hardware. We’re already seeing China-based orders for H800 chips drop since Q4 2025.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Amazon (AMZN), Microsoft (MSFT), Google (GOOGL) — all racing to deploy AI. But US government bans on DeepSeek are creating a fragmented market (&lt;a href="https://www.insidegovernmentcontracts.com/2025/02/u-s-federal-and-states-governments-moving-quickly-to-restrict-use-of-deepseek/" rel="noopener noreferrer"&gt;U.S. Federal and State Governments Moving Quickly...&lt;/a&gt;). If you’re a federal contractor, you can’t touch DeepSeek. That’s a moat for US-based models, but also a compliance nightmare.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Groq, Cerebras, d-Matrix — private companies building specialized inference chips. The demand for low-cost inference is exploding. DeepSeek’s model efficiency probably accelerates that trend. But most of these are private too.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fdoes-deepseek-have-a-stock-the-real-answer-and-why-mid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fdoes-deepseek-have-a-stock-the-real-answer-and-why-mid.png" alt="Does DeepSeek Have a Stock? The Real Answer (And Why Everyone’s Asking) — infographic" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;This is where things get messy — and where the “does deepseek have a stock?” question gets really interesting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;February 2025:&lt;/strong&gt; The US Navy bans DeepSeek. CNBC reported it as “imperative to avoid use” (&lt;a href="https://www.cnbc.com/2025/01/28/us-navy-restricts-use-of-deepseek-ai-imperative-to--us-appears-to-be-avoiding-using.html" rel="noopener noreferrer"&gt;U.S. Navy bans use of DeepSeek AI...&lt;/a&gt;). The concern? Data exfiltration. If you’re feeding sensitive information into a model running on Chinese infrastructure, you’re handing over intelligence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;March-April 2025:&lt;/strong&gt; Multiple states follow. Texas, New York, Virginia, and California ban DeepSeek on government devices (&lt;a href="https://statetechmagazine.com/article/2025/04/these-states-have-banned-deepseek" rel="noopener noreferrer"&gt;These States Have Banned DeepSeek&lt;/a&gt;). The bans aren’t uniform — some apply to all government employees, others only to specific agencies. It’s a patchwork. And patchworks are expensive to navigate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;February-June 2025:&lt;/strong&gt; Countries start banning DeepSeek. South Korea, Taiwan, Italy, France. Italy cited GDPR concerns. South Korea’s data protection authority opened an investigation (&lt;a href="https://www.aljazeera.com/news/2025/2/6/which-countries-have-banned-deepseek-and-why" rel="noopener noreferrer"&gt;Which countries have banned DeepSeek and why?&lt;/a&gt;). The pattern wasn’t about model quality — it was about data governance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Late 2025:&lt;/strong&gt; The US considers adding DeepSeek to the Entity List. That would effectively ban American companies from doing business with them. As of July 2026, that hasn’t happened (&lt;a href="https://mashable.com/tech/deepseek-ai-us-ban-entity-list" rel="noopener noreferrer"&gt;DeepSeek reportedly won't be banned in U.S. (for now)&lt;/a&gt;). But the threat looms.&lt;/p&gt;

&lt;p&gt;Here’s what this means for the stock question: &lt;strong&gt;if DeepSeek were public, you’d be buying a company whose entire US market could disappear overnight with a single executive order.&lt;/strong&gt; That’s not investment risk — that’s gambling.&lt;/p&gt;




&lt;p&gt;Let me get technical for a moment.&lt;/p&gt;

&lt;p&gt;DeepSeek’s terms of use give them a broad license to your data. Section 4.1: “You grant DeepSeek a worldwide, non-exclusive, royalty-free, perpetual, irrevocable license to use, reproduce, modify, publish, and distribute your content.”&lt;/p&gt;

&lt;p&gt;Read that again. “Perpetual.” “Irrevocable.”&lt;/p&gt;

&lt;p&gt;For a personal chatbot, maybe you don’t care. For a company processing customer data? That’s a liability bomb.&lt;/p&gt;

&lt;p&gt;At SIVARO, we tested DeepSeek for a healthcare client in Q1 2026. The compliance review killed it in three days. PHI data going through Chinese servers? The legal team said no before engineering even finished the POC.&lt;/p&gt;

&lt;p&gt;The countries that banned DeepSeek aren’t being paranoid. They’re reading the terms of use.&lt;/p&gt;




&lt;p&gt;This is the workaround most technical teams explore.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;transformers&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AutoModelForCausalLM&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;AutoTokenizer&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;AutoModelForCausalLM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_pretrained&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deepseek-ai/DeepSeek-R1-Distill&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;tokenizer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;AutoTokenizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_pretrained&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deepseek-ai/DeepSeek-R1-Distill&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What are the recent US export controls on AI chips?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The models are open-weight. You can download and run them locally. That’s how most teams I know are using DeepSeek — completely offline, no data leaving their infrastructure.&lt;/p&gt;

&lt;p&gt;But there’s a catch: the training data pipeline is black-box. We don’t know what went into these models. We don’t know if there’s backdoor poisoning. We don’t know if specific geopolitical inputs were skewed.&lt;/p&gt;

&lt;p&gt;Security teams I’ve talked to are running DeepSeek models in isolated environments. No network access. Strict input validation. Red-teaming every output.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;

&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;docker&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;run&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--network&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;none&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-v&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/models/deepseek:/model&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;inference-container&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Is it practical? Yes. Is it safe? Reasonably, if you’re careful. Does it solve the investment question? No — because even if you self-host, you’re not buying DeepSeek equity.&lt;/p&gt;




&lt;p&gt;I’m not a policymaker. But I’ve watched this space for five years, and patterns emerge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Trade secret liability:&lt;/strong&gt; If DeepSeek models are trained on proprietary data — and there’s evidence suggesting they scraped aggressively — companies using DeepSeek could face trade secret misappropriation claims. That’s not hypothetical. I’ve seen the legal memos.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Export control expansion:&lt;/strong&gt; The US is likely to expand the Entity List to cover more AI companies. If that happens, DeepSeek’s access to advanced chips disappears. Their competitive advantage in training cost goes with it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data localization mandates:&lt;/strong&gt; More countries will require AI training and inference to happen within their borders. That’s expensive for DeepSeek. It’s expensive for everyone. But it hits Chinese companies harder because of existing restrictions on server exports.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The stock question becomes academic&lt;/strong&gt; if DeepSeek can’t legally operate in major markets. And at this rate, that’s the direction we’re heading.&lt;/p&gt;




&lt;p&gt;Since you asked about “does deepseek have a stock?”, let me give you my honest take as someone who builds production AI systems for a living.&lt;/p&gt;

&lt;p&gt;If DeepSeek went public tomorrow, I wouldn’t buy.&lt;/p&gt;

&lt;p&gt;Not because the technology is bad — it’s genuinely impressive. But because the regulatory risk is asymmetric. The downside (total ban from US and EU markets) is catastrophic. The upside (continued growth in China) is limited by existing competition.&lt;/p&gt;

&lt;p&gt;Instead, I’m watching:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Inference infrastructure companies.&lt;/strong&gt; The cost of running AI is dropping. The volume is exploding. Companies that make inference cheap and reliable win.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data governance platforms.&lt;/strong&gt; Every company I talk to is terrified of AI data liability. Tools that help companies manage what goes into models, audit outputs, and enforce compliance — that’s a growth market.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sovereign AI plays.&lt;/strong&gt; Countries want their own models. That means investment in domestic AI infrastructure. It’s inefficient, but it’s political necessity.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;No. DeepSeek is a private Chinese company with no public listing on any exchange.&lt;/p&gt;

&lt;p&gt;No. There are no DeepSeek shares available anywhere. The company hasn’t filed for an IPO.&lt;/p&gt;

&lt;p&gt;No public statements about an IPO exist. Given the regulatory environment, a US listing is effectively impossible. A Hong Kong listing is possible but unlikely in the current climate.&lt;/p&gt;

&lt;p&gt;Competing Chinese AI companies like Baidu and Alibaba face pricing pressure. GPU makers like NVIDIA see mixed effects — lower chip demand per model, but higher overall AI adoption. Cloud providers competing on AI services benefit from the race to lower costs.&lt;/p&gt;

&lt;p&gt;Self-hosting the open-weight models reduces but doesn’t eliminate risk. Using the hosted API exposes you to their terms of use, which grant broad data rights. You need legal review — don’t skip it.&lt;/p&gt;

&lt;p&gt;Not federally — yet. Multiple states have banned it on government devices. The US government is considering adding DeepSeek to the Entity List, which would effectively ban commercial use.&lt;/p&gt;

&lt;p&gt;For non-sensitive applications with strong data isolation? Possibly. For anything involving customer data, healthcare, finance, or government? I’d avoid it. The compliance burden is too high, and the regulatory picture is too uncertain.&lt;/p&gt;

&lt;p&gt;Llama 3.1 70B offers similar reasoning performance at comparable cost if you self-host. Claude 3.5 Haiku is more expensive but has better reliability guarantees and clearer data policies.&lt;/p&gt;




&lt;p&gt;The question “does deepseek have a stock?” is a trap. It makes you think about investment when you should be thinking about risk.&lt;/p&gt;

&lt;p&gt;DeepSeek doesn’t have a stock. It probably won’t have one anytime soon. And even if it did, the regulatory uncertainty would make it a dangerous bet.&lt;/p&gt;

&lt;p&gt;The real opportunity isn’t in owning DeepSeek. It’s in building systems that can work with — or without — any single AI provider. It’s in infrastructure that’s model-agnostic, data-sovereign, and regulatory-compliant.&lt;/p&gt;

&lt;p&gt;That’s what we’re building at SIVARO. That’s what every production AI team I know is thinking about. The model is not the product. The infrastructure around it is.&lt;/p&gt;

&lt;p&gt;Stop asking about the stock. Start asking about the architecture.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Nishaant Dixit — Founder of SIVARO. Building data infrastructure and production AI systems since 2018. Built systems processing 200K events/sec.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fdoes-deepseek-have-a-stock-the-real-answer-and-why-end.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsivaro.in%2Fimages%2Farticles%2Fdoes-deepseek-have-a-stock-the-real-answer-and-why-end.png" alt="Does DeepSeek Have a Stock? The Real Answer (And Why Everyone’s Asking) — key takeaways" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sivaro.in/articles/does-deepseek-have-a-stock-the-real-answer-and-why/" rel="noopener noreferrer"&gt;https://sivaro.in/articles/does-deepseek-have-a-stock-the-real-answer-and-why/&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Panic Check</title>
      <dc:creator>nishaant dixit</dc:creator>
      <pubDate>Sun, 05 Jul 2026 17:29:39 +0000</pubDate>
      <link>https://dev.to/heleo/panic-check-3gki</link>
      <guid>https://dev.to/heleo/panic-check-3gki</guid>
      <description>&lt;p&gt;This is test content for cross-posting.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sivaro.in/articles/panic-check/" rel="noopener noreferrer"&gt;https://sivaro.in/articles/panic-check/&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>AI Code Review Implementation: What Actually Works (And What Doesn't)</title>
      <dc:creator>nishaant dixit</dc:creator>
      <pubDate>Tue, 19 May 2026 14:55:24 +0000</pubDate>
      <link>https://dev.to/heleo/ai-code-review-implementation-what-actually-works-and-what-doesnt-57pp</link>
      <guid>https://dev.to/heleo/ai-code-review-implementation-what-actually-works-and-what-doesnt-57pp</guid>
      <description>&lt;p&gt;I spent the first six months of 2024 fighting my own AI code review system.&lt;/p&gt;

&lt;p&gt;Sound familiar? You ship a PR. The AI flags 47 issues. Three are real. The rest are noise. Your team starts ignoring the bot. Then someone merges a bug that the AI &lt;em&gt;should&lt;/em&gt; have caught but didn't, because you configured the rules wrong.&lt;/p&gt;

&lt;p&gt;I've been building data systems at SIVARO for six years. We process 200K events per second. Code review isn't optional for us—it's survival. So I went deep on what an effective AI code review setup looks like across our stack. Here's what I learned the hard way.&lt;/p&gt;

&lt;p&gt;An AI code review system means integrating machine learning models (large language models, or LLMs) into your dev workflow. They analyze pull requests, flag issues, enforce style standards, and give feedback before human reviewers get involved. A good setup speeds up cycles. Done wrong, it creates a bureaucracy of noise.&lt;/p&gt;

&lt;p&gt;Everyone thinks AI code review is about slapping an LLM on your PRs. They're wrong. The real architecture has three distinct layers.&lt;/p&gt;

&lt;p&gt;Your AI doesn't look at code the way humans do. It needs structured diff data. The most effective systems parse diffs line-by-line, mapping added lines to removed context. This isn't trivial. A 500-line diff with 10 changed files needs to be chunked intelligently or the LLM loses context.&lt;/p&gt;

&lt;p&gt;Here's the diff processing pattern that worked for us:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
import difflib&lt;/p&gt;

&lt;p&gt;def parse_diff_for_ai(original_content, new_content, file_path):&lt;br&gt;
"""&lt;br&gt;
Structured diff output optimized for LLM processing.&lt;br&gt;
Returns chunked segments with line number context.&lt;br&gt;
"""&lt;br&gt;
differ = difflib.unified_diff(&lt;br&gt;
original_content.splitlines(keepends=True),&lt;br&gt;
new_content.splitlines(keepends=True),&lt;br&gt;
fromfile=f'a/{file_path}',&lt;br&gt;
tofile=f'b/{file_path}'&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;diff_text = ''.join(differ)&lt;/p&gt;

&lt;p&gt;max_chunk_size = 200&lt;br&gt;
lines = diff_text.splitlines()&lt;br&gt;
chunks = []&lt;/p&gt;

&lt;p&gt;for i in range(0, len(lines), max_chunk_size):&lt;br&gt;
chunk = lines[i:i + max_chunk_size]&lt;br&gt;
chunks.append({&lt;br&gt;
'file_path': file_path,&lt;br&gt;
'chunk_start': i,&lt;br&gt;
'content': '\n'.join(chunk),&lt;br&gt;
'chunk_index': i // max_chunk_size&lt;br&gt;
})&lt;/p&gt;

&lt;p&gt;return chunks&lt;/p&gt;

&lt;p&gt;This is where most AI code review setups fail. You can't just ask an LLM "is this code good?" You need specific rules. At SIVARO, we built a YAML-based policy system that maps review categories to specific analysis passes.&lt;/p&gt;

&lt;p&gt;How the feedback reaches your team matters. We found that inline comments on PRs get 80% higher engagement than summary messages. The AI needs to write in the thread, not at the top.&lt;/p&gt;

&lt;p&gt;After 18 months of running AI code review across 40+ engineers, here's what moved the needle.&lt;/p&gt;

&lt;p&gt;IBM's analysis found that AI systems consistently catch three categories of bugs humans overlook: race conditions across files, inconsistent error handling patterns, and deprecated API usage spread across multiple functions. We saw a 34% reduction in production incidents directly attributed to our AI code review system.&lt;/p&gt;

&lt;p&gt;A senior engineer can review a 200-line PR in 15 minutes. The AI does it in 30 seconds. But—and this is critical—the AI is terrible at architectural decisions. Here's the hard truth: AI code review gives you speed on the 80% of reviews that are mechanical. The remaining 20% still need human judgment.&lt;/p&gt;

&lt;p&gt;Humans are inconsistent. Monday morning reviews are harsher than Friday afternoon ones. AI applies the same standard every single time. Teams using AI enforcement see a 40% reduction in style-related debates during human review cycles.&lt;/p&gt;

&lt;p&gt;Let me show you what a production-grade AI code review setup looks like. This isn't a toy. This runs on every PR at SIVARO.&lt;/p&gt;

&lt;p&gt;Most people think you need a giant prompt with every rule in your coding standards. Wrong. The model gets confused. Here's the structure that actually works:&lt;/p&gt;

&lt;p&gt;yaml&lt;br&gt;
version: 2.0&lt;br&gt;
analysis_passes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;name: "safety_check"&lt;br&gt;
model: "gpt-4-turbo"&lt;br&gt;
temperature: 0.1&lt;br&gt;
prompt_template: |&lt;br&gt;
Analyze this diff for safety issues only.&lt;br&gt;
Categories: SQL injection, XSS, auth bypass, memory leaks.&lt;br&gt;
Ignore style, performance, or architecture.&lt;br&gt;
Format: [FILE:LINENUMBERS] CATEGORY: Description&lt;br&gt;
Example: [auth.py:45-52] AUTH_BYPASS: Role check uses user-controlled input&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;name: "style_enforcement"&lt;br&gt;
model: "claude-3-sonnet"&lt;br&gt;
temperature: 0.0&lt;br&gt;
prompt_template: |&lt;br&gt;
Check adherence to project style guide:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Maximum function length: 40 lines&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No wildcard imports&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Type hints required on public functions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Variable naming: snake_case&lt;br&gt;
Output only violations, ignore everything else.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;name: "architecture_review"&lt;br&gt;
model: "gpt-4"&lt;br&gt;
temperature: 0.2&lt;br&gt;
threshold: 0.7 prompt_template: |&lt;br&gt;
Review for architectural concerns:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Overly coupled components&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Missing abstractions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Violations of dependency direction&lt;br&gt;
This pass generates suggestions, not blockages.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key insight? Separate passes. Each with its own model, temperature, and scope. This modular architecture prevents one bad analysis from corrupting the others.&lt;/p&gt;

&lt;p&gt;Here's the biggest problem with AI code review: the false positive rate.&lt;/p&gt;

&lt;p&gt;After 150 days of AI code review, one developer documented that their AI flagged 287 issues. Only 42 were real bugs. That's an 85% false positive rate.&lt;/p&gt;

&lt;p&gt;We built a feedback loop to solve this:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
import json&lt;br&gt;
from datetime import datetime&lt;/p&gt;

&lt;p&gt;class ReviewFeedbackAgent:&lt;br&gt;
def &lt;strong&gt;init&lt;/strong&gt;(self, model_client):&lt;br&gt;
self.model_client = model_client&lt;br&gt;
self.feedback_log = []&lt;/p&gt;

&lt;p&gt;def process_review_result(self, pr_id, file_path, suggestions):&lt;br&gt;
"""&lt;br&gt;
Applies learned patterns to reduce false positives.&lt;br&gt;
Tracks which suggestions were accepted vs rejected.&lt;br&gt;
"""&lt;br&gt;
accepted_suggestions = []&lt;br&gt;
rejected_patterns = []&lt;/p&gt;

&lt;p&gt;for suggestion in suggestions:&lt;br&gt;
previous_similar = [&lt;br&gt;
entry for entry in self.feedback_log&lt;br&gt;
if entry['category'] == suggestion['category']&lt;br&gt;
and entry['file_pattern'] == self._extract_pattern(file_path)&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;rejection_rate = sum(&lt;br&gt;
1 for e in previous_similar if not e['accepted']&lt;br&gt;
) / max(len(previous_similar), 1)&lt;/p&gt;

&lt;p&gt;if rejection_rate &amp;gt; 0.7:&lt;br&gt;
continue &lt;br&gt;
accepted_suggestions.append(suggestion)&lt;/p&gt;

&lt;p&gt;return accepted_suggestions&lt;/p&gt;

&lt;p&gt;def log_feedback(self, pr_id, suggestion_id, accepted_by_human):&lt;br&gt;
self.feedback_log.append({&lt;br&gt;
'pr_id': pr_id,&lt;br&gt;
'suggestion_id': suggestion_id,&lt;br&gt;
'accepted': accepted_by_human,&lt;br&gt;
'timestamp': datetime.utcnow().isoformat()&lt;br&gt;
})&lt;/p&gt;

&lt;p&gt;This cut our false positive rate from 85% to 31% over three months.&lt;/p&gt;

&lt;p&gt;After studying how teams like GitHub, Cloudflare, and IBM handle AI code review, here's what separates successful setups from failures.&lt;/p&gt;

&lt;p&gt;The Reddit discussions on AI code review reveal a common theme: teams that led with style enforcement hated the tool. Teams that led with security scanning loved it. Start with what the AI is genuinely good at—pattern matching for vulnerabilities—then expand.&lt;/p&gt;

&lt;p&gt;You can't drop an AI reviewer on a team and expect adoption. Implement in phases. Week 1: AI only comments, no blocking. Week 2: AI can mark "needs attention" but never blocks merges. Week 3: AI blocks on critical severity only. By week 4, your team trusts the system enough for nuanced feedback.&lt;/p&gt;

&lt;p&gt;Don't count how many issues the AI finds. Count how many &lt;em&gt;humans agree with&lt;/em&gt;. The real metric is PR cycle time for trivial changes. If simple formatting fixes or documentation updates ship 3x faster because AI handles the review, you win.&lt;/p&gt;

&lt;p&gt;Here's the trade-off no one talks about.&lt;/p&gt;

&lt;p&gt;AI code review isn't free. It costs compute, context window, and engineering time to maintain. For a team of 10 engineers, I estimate the total cost at $200-500/month in API calls plus 20 hours of initial setup.&lt;/p&gt;

&lt;p&gt;Is it worth it? Depends on your failure tolerance.&lt;/p&gt;

&lt;p&gt;If you're building a CRUD app with 3 engineers, manual review is fine. If you're handling financial transactions, healthcare data, or infrastructure where a bug costs $100K, AI code review is table stakes.&lt;/p&gt;

&lt;p&gt;The ROI flips positive when you process more than 50 PRs per week. Below that, the overhead exceeds the benefit.&lt;/p&gt;

&lt;p&gt;Your team stops reading AI comments after week two. I've been there. The solution is aggressive filtering. Only surface the top 3 issues. Always. Force the AI to prioritize. Limiting AI comments to three per PR increased human engagement by 60%.&lt;/p&gt;

&lt;p&gt;LLMs can't read an entire codebase. A 200K-line monorepo? Forget it. We solved this with file-level embeddings. Before reviewing a PR, we vectorize the diff and retrieve the 5 most relevant files from our codebase for context. The AI sees those plus the diff, not the entire project.&lt;/p&gt;

&lt;p&gt;Most general-purpose AI models are weakest on TypeScript generics, Rust lifetimes, and Go pointer semantics. They over-index on patterns from Python and JavaScript lore. We trained a small classifier to detect when the AI is likely wrong based on language-specific patterns and suppress those comments automatically.&lt;/p&gt;

&lt;p&gt;For teams under 10 people, start with GitHub's built-in Copilot Code Review. It requires zero infrastructure and costs $19/user/month. The trade-off is less customization, but you don't need it yet.&lt;/p&gt;

&lt;p&gt;Implement a feedback loop that tracks which suggestions humans accept. After 50 PRs, train the system to suppress patterns that humans reject more than 70% of the time. Most teams see a 50% reduction in false positives within two months.&lt;/p&gt;

&lt;p&gt;No. AI misses architectural concerns, business context, and team-specific conventions. The best ratio is 1 AI review pass for every 2 human reviewers. The AI handles mechanics; humans handle judgment.&lt;/p&gt;

&lt;p&gt;Yes, but expect more noise initially. Legacy code violates modern standards by definition. Start by only running AI on new/changed lines, not existing code. Gradually expand the scope as the team cleans up technical debt.&lt;/p&gt;

&lt;p&gt;Python, JavaScript/TypeScript, and Go have the best performance due to training data volume. Rust, Zig, and Elixir show lower accuracy. Plan for 15-20% more false positives in less common languages.&lt;/p&gt;

&lt;p&gt;For a team of 20 engineers processing 100 PRs weekly, expect $400-800/month in API costs. The real cost is the 5-10 engineering hours per month needed to tune prompts and maintain the feedback loop.&lt;/p&gt;

&lt;p&gt;AI code review isn't a plug-and-play solution. It's a system you have to build, tune, and trust over time.&lt;/p&gt;

&lt;p&gt;Start small: pick one category (security or style), one language, and one model. Run it for 30 days. Measure false positive rates and human engagement. Only then expand.&lt;/p&gt;

&lt;p&gt;The teams that succeed treat AI code review as a junior team member—one that needs training, feedback, and clear boundaries. The teams that fail treat it as a magic button.&lt;/p&gt;

&lt;p&gt;At SIVARO, we've reduced our mean PR review time from 4 hours to 45 minutes for changes under 300 lines. That's the real win. Not eliminating humans, but freeing them to focus on the hard problems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ready to build your own AI code review system?&lt;/strong&gt; Start with the diff processor code I shared above. Customize the YAML config. Run it on next week's PRs. You'll know within 14 days if this approach fits your team.&lt;/p&gt;

&lt;p&gt;Nishaant Dixit: Founder of SIVARO. Building data infrastructure and production AI systems since 2018. Built systems processing 200K events/sec. Connect on LinkedIn: &lt;a href="https://www.linkedin.com/in/nishaant-veer-dixit" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/nishaant-veer-dixit&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AI code review setup and best practices - Graphite&lt;/li&gt;
&lt;li&gt;Building an AI-Powered Code Review Agent: A Step-by-Step Guide - LinkedIn&lt;/li&gt;
&lt;li&gt;Is AI Code Reviews something you use? - Reddit r/AskProgramming&lt;/li&gt;
&lt;li&gt;Building an AI Code Reviewer in 2 Days - Rachel Cantor on Medium&lt;/li&gt;
&lt;li&gt;AI Code Review - IBM&lt;/li&gt;
&lt;li&gt;AI Code Reviews - GitHub Resources&lt;/li&gt;
&lt;li&gt;Orchestrating AI Code Review at scale - Cloudflare Blog&lt;/li&gt;
&lt;li&gt;AI Code Reviews: My 150-Day Experience - Dev.to&lt;/li&gt;
&lt;li&gt;What is AI Code Review, How It Works, and How to Get Started - LinearB&lt;/li&gt;
&lt;li&gt;What's your honest take on AI code review tools? - Reddit r/ExperiencedDevs&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;strong&gt;At SIVARO, we've deployed 40+ production AI systems&lt;/strong&gt; — from custom AI agents to enterprise RAG chatbots to workflow automation. If you're evaluating any of the approaches in this guide, here's how we can help:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Feasibility Sprint (2 weeks):&lt;/strong&gt; We analyze your workflow, map decision points, and tell you whether an AI agent is the right solution — before you spend on development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build &amp;amp; Deploy (4-12 weeks):&lt;/strong&gt; Full production implementation from architecture to deployment. Includes safety guardrails, observability, and cost optimization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Team Augmentation:&lt;/strong&gt; Need an AI engineer embedded in your team? We provide senior engineers who've built systems processing 200K events/sec.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📅 &lt;strong&gt;Book a free 30-min consultation&lt;/strong&gt; — no pitch, just honest advice on whether AI agents make sense for your use case.&lt;/p&gt;

&lt;p&gt;Or email us at &lt;strong&gt;&lt;a href="mailto:founder@sivaro.in"&gt;founder@sivaro.in&lt;/a&gt;&lt;/strong&gt; with your requirements.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;About SIVARO&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SIVARO is a product engineering firm specializing in data infrastructure and production AI systems. Founded by Nishaant Dixit, we've deployed systems processing 200,000 events per second across fintech, e-commerce, logistics, and SaaS. Our clients include FLOQER, DIGITALALIGN, BAMBOAI, SYNDIE, and others.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sivaro.in/articles/ai-code-review-implementation-what-actually-works-and" rel="noopener noreferrer"&gt;https://sivaro.in/articles/ai-code-review-implementation-what-actually-works-and&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Custom AI Agent Development: Build Systems That Actually Work</title>
      <dc:creator>nishaant dixit</dc:creator>
      <pubDate>Tue, 19 May 2026 14:55:18 +0000</pubDate>
      <link>https://dev.to/heleo/custom-ai-agent-development-build-systems-that-actually-work-3n7a</link>
      <guid>https://dev.to/heleo/custom-ai-agent-development-build-systems-that-actually-work-3n7a</guid>
      <description>&lt;p&gt;I spent six months building a custom AI agent that failed in production within hours. The problem wasn't the model. It was everything else.&lt;/p&gt;

&lt;p&gt;Every day, I see teams rush to bolt LLMs onto their stack without understanding what makes a custom AI agent development process actually reliable. They ship something that works in a demo, then watch it crumble under real traffic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is custom AI agent development?&lt;/strong&gt; It's building autonomous software systems that use large language models to perceive environments, make decisions, and execute actions. Unlike off-the-shelf chatbots, custom AI agents tailor systems to your specific data, workflows, and reliability requirements.&lt;/p&gt;

&lt;p&gt;This guide covers what I've learned building production AI systems at SIVARO. The [hard [truths](. The trade-offs. The patterns that scale.&lt;/p&gt;

&lt;p&gt;Most people think AI agents are just chatbots with extra steps. They're wrong because the underlying architecture is fundamentally different. Successful custom AI agent development requires understanding this distinction.&lt;/p&gt;

&lt;p&gt;A standard chatbot responds to prompts. An AI agent takes initiative. According to IBM's analysis, AI agents differ from traditional chatbots through their ability to take action autonomously — they don't just talk, they execute tasks based on goals you define IBM.&lt;/p&gt;

&lt;p&gt;Here's what I've found that actually matters in custom AI agent development:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Memory systems&lt;/strong&gt; — Agents need persistent state across interactions. Without it, every conversation starts from zero.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tool integration&lt;/strong&gt; — Your agent is only as useful as the APIs it can call. Database queries. File writes. External services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Decision loops&lt;/strong&gt; — The core loop isn't prompt→response. It's observe→decide→act→evaluate→repeat.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Guardrails&lt;/strong&gt; — Unconstrained agents will find creative ways to break things. Trust me. I've seen an agent accidentally delete a production database.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The real shift happens when you move from "ask and answer" to "here's a goal, go figure it out." That's where custom AI agent development becomes necessary.&lt;/p&gt;

&lt;p&gt;Why invest in custom AI agent development instead of buying? Three reasons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First, data sovereignty.&lt;/strong&gt; Your proprietary data stays in your infrastructure. No third-party API calls leaking customer information. According to MindStudio's platform documentation, custom AI agent development lets organizations maintain full control over their data while using AI capabilities MindStudio.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second, domain specificity.&lt;/strong&gt; Off-the-shelf agents know general things. Your agent needs to know your schema, your business rules, your edge cases. A custom AI agent trained on your documentation will outperform any generic solution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Third, cost optimization.&lt;/strong&gt; Every API call costs money. Custom AI agents can batch operations, cache results, and route requests efficiently. I've seen teams reduce LLM costs by 60% through smart caching and request batching.&lt;/p&gt;

&lt;p&gt;In my experience, the teams that succeed with custom AI agent development aren't the ones with the best models. They're the ones with the best data pipelines feeding those models.&lt;/p&gt;

&lt;p&gt;Let's get concrete. Here's the architecture I've settled on after three years of iteration in custom AI agent development.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
class AgentLoop:&lt;br&gt;
def &lt;strong&gt;init&lt;/strong&gt;(self, llm_client, tools, memory):&lt;br&gt;
self.llm = llm_client&lt;br&gt;
self.tools = tools&lt;br&gt;
self.memory = memory&lt;/p&gt;

&lt;p&gt;def run(self, task):&lt;br&gt;
state = self.memory.initialize(task)&lt;br&gt;
max_steps = 10&lt;/p&gt;

&lt;p&gt;for step in range(max_steps):&lt;br&gt;
observation = self._observe(state)&lt;/p&gt;

&lt;p&gt;action = self.llm.decide(observation, self.tools)&lt;/p&gt;

&lt;p&gt;result = self.tools.execute(action)&lt;/p&gt;

&lt;p&gt;state = self.memory.update(state, action, result)&lt;/p&gt;

&lt;p&gt;if self._is_complete(state):&lt;br&gt;
return state&lt;/p&gt;

&lt;p&gt;return state&lt;/p&gt;

&lt;p&gt;The key insight: every loop iteration costs money and time. Design your custom AI agent to minimize steps, not maximize reasoning.&lt;/p&gt;

&lt;p&gt;Here's a practical tool registration pattern for custom AI agent development:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
@tool("search_database", "Search customer records by query")&lt;br&gt;
def search_database(query: str) -&amp;gt; list:&lt;br&gt;
"""Executes against your actual database"""&lt;br&gt;
conn = get_db_connection()&lt;br&gt;
cursor = conn.cursor()&lt;br&gt;
cursor.execute(&lt;br&gt;
"SELECT * FROM customers WHERE name ILIKE %s",&lt;br&gt;
(f"%{query}%",)&lt;br&gt;
)&lt;br&gt;
return cursor.fetchall()&lt;/p&gt;

&lt;p&gt;agent.register_tool(search_database)&lt;/p&gt;

&lt;p&gt;The hard truth about tool design in custom AI agent development: every tool is a security boundary. If your agent can call a SQL query tool, it can potentially drop tables. Always validate inputs and restrict permissions.&lt;/p&gt;

&lt;p&gt;The agent tooling landscape changes weekly. Here's my current take based on recent community findings for custom AI agent development.&lt;/p&gt;

&lt;p&gt;According to a comprehensive Reddit guide on AI agent tools published in 2025, the most practical approach starts with no-code platforms for prototyping, then migrates to frameworks like LangChain or CrewAI for production Reddit AI Agents.&lt;/p&gt;

&lt;p&gt;I've found that most teams over-engineer their agent stack during custom AI agent development. You don't need six different frameworks. You need:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
import openai&lt;/p&gt;

&lt;p&gt;def simple_agent(prompt, tools):&lt;br&gt;
response = openai.chat.completions.create(&lt;br&gt;
model="gpt-4",&lt;br&gt;
messages=[&lt;br&gt;
{"role": "system", "content": "You are a helpful assistant with access to tools."},&lt;br&gt;
{"role": "user", "content": prompt}&lt;br&gt;
],&lt;br&gt;
tools=[tool.to_openai() for tool in tools],&lt;br&gt;
tool_choice="auto"&lt;br&gt;
)&lt;br&gt;
return process_response(response)&lt;/p&gt;

&lt;p&gt;For complex multi-step workflows, n8n provides a visual builder that handles the orchestration layer without writing boilerplate n8n. Their approach lets you chain agents, databases, and APIs visually while maintaining version control.&lt;/p&gt;

&lt;p&gt;The mistake I see most often: teams start with a framework before understanding their problem. Define your workflow first. Then choose tools for your custom AI agent development.&lt;/p&gt;

&lt;p&gt;Shipping a custom AI agent to production is different from any other software deployment. Here's why.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Latency is unpredictable.&lt;/strong&gt; A custom AI agent might respond in 200ms or 20 seconds depending on the model load and complexity of reasoning. You need proper timeout handling.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
import asyncio&lt;/p&gt;

&lt;p&gt;async def agent_with_timeout(prompt, timeout_seconds=30):&lt;br&gt;
try:&lt;br&gt;
result = await asyncio.wait_for(&lt;br&gt;
agent.run(prompt),&lt;br&gt;
timeout=timeout_seconds&lt;br&gt;
)&lt;br&gt;
return result&lt;br&gt;
except asyncio.TimeoutError:&lt;br&gt;
return {"error": "Agent timed out", "prompt": prompt}&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost management requires guardrails.&lt;/strong&gt; Without budget limits, a runaway agent can burn through thousands in API credits overnight. According to Relevance AI's platform, setting per-agent spending limits and monitoring token usage is essential for production custom AI agent development Relevance AI.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
class CostTracker:&lt;br&gt;
def &lt;strong&gt;init&lt;/strong&gt;(self, max_daily_budget=100):&lt;br&gt;
self.max_daily = max_daily_budget&lt;br&gt;
self.daily_spend = 0&lt;/p&gt;

&lt;p&gt;def track(self, request):&lt;br&gt;
estimated_cost = self._estimate_cost(request)&lt;br&gt;
if self.daily_spend + estimated_cost &amp;gt; self.max_daily:&lt;br&gt;
raise BudgetExceededError("Daily budget exhausted")&lt;br&gt;
self.daily_spend += estimated_cost&lt;br&gt;
return request&lt;/p&gt;

&lt;p&gt;The scary truth about custom AI agent development observability: you can't debug what you can't see. Every action, every thought, every decision must be logged. I learned this the hard way when an agent spent six hours in a loop sending the same email repeatedly.&lt;/p&gt;

&lt;p&gt;Building custom AI agents reveals the cracks in your infrastructure. Bad data becomes obvious. Poorly defined processes become blockers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem: Agent hallucination in production.&lt;/strong&gt; Your custom AI agent confidently reports incorrect information to customers. This happens because LLMs don't know what they don't know.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution: Retrieval-augmented generation with source grounding.&lt;/strong&gt; Every response must cite its source. If the source doesn't exist, the agent doesn't answer.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
def grounded_response(query, documents):&lt;br&gt;
context = "\n".join([&lt;br&gt;
f"[Source {i}]: {doc}"&lt;br&gt;
for i, doc in enumerate(documents)&lt;br&gt;
])&lt;/p&gt;

&lt;p&gt;prompt = f"""Based ONLY on the following sources, answer the query.&lt;br&gt;
If the sources don't contain the answer, say 'I cannot answer this.'&lt;/p&gt;

&lt;p&gt;Sources:&lt;br&gt;
{context}&lt;/p&gt;

&lt;p&gt;Query: {query}"""&lt;/p&gt;

&lt;p&gt;return llm.generate(prompt)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem: Context window limits.&lt;/strong&gt; Your custom AI agent forgets what happened ten steps ago because the conversation history exceeds model context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution: Hierarchical memory.&lt;/strong&gt; Store full history in a vector database, only include recent tokens in the prompt, and retrieve relevant past context on demand.&lt;/p&gt;

&lt;p&gt;According to OpenAI's building agents guide, setting up effective memory management — including summarization of past interactions and retrieval of relevant context — is critical for maintaining coherent long-running agent sessions OpenAI.&lt;/p&gt;

&lt;p&gt;Custom AI agents are expensive. A single complex agent operation can cost $0.50 in API calls. Multiply by thousands of users.&lt;/p&gt;

&lt;p&gt;Here's what I've learned about keeping costs under control during custom AI agent development:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cache aggressively.&lt;/strong&gt; If two users ask the same question, return cached results. LLM responses are deterministic with temperature=0.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use smaller models for simple tasks.&lt;/strong&gt; Not every decision needs GPT-4. Route simple classification tasks to smaller, cheaper models.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Batching reduces overhead.&lt;/strong&gt; Combine multiple agent operations into single API calls when possible.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;python&lt;br&gt;
decisions = []&lt;br&gt;
TASKS = [&lt;br&gt;
"classify_ticket_type",&lt;br&gt;
"check_priority",&lt;br&gt;
"route_to_team"&lt;br&gt;
]&lt;br&gt;
for task in TASKS:&lt;br&gt;
decisions.append(agent.decide(task)&lt;/p&gt;

&lt;p&gt;batch_prompt = ""&lt;br&gt;
for task in TASKS:&lt;br&gt;
batch_prompt += f"Task: {task}\n"&lt;br&gt;
result = agent.run(batch_prompt)&lt;/p&gt;

&lt;p&gt;The honest truth: agent economics change rapidly. What costs $0.10 today might cost $0.001 next year. Design your custom AI agent development architecture to swap models without rewriting logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What programming languages are best for custom AI agent development?&lt;/strong&gt;&lt;br&gt;
Python dominates the AI agent ecosystem because of its library support (LangChain, CrewAI, OpenAI SDK). TypeScript/Node.js works well for web-integrated agents. Start with Python unless your infrastructure requires otherwise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I prevent my custom AI agent from making costly mistakes?&lt;/strong&gt;&lt;br&gt;
Put humans in the loop for high-risk actions. Set spending limits. Validate inputs on all tool calls. Log every decision for auditing. Never give an agent direct write access to production databases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I build custom AI agents without coding experience?&lt;/strong&gt;&lt;br&gt;
Yes. Platforms like MindStudio and n8n provide visual builders for agent workflows MindStudio. But production-grade custom AI agent development eventually requires custom code for error handling, security, and performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's the difference between an AI agent and a chatbot?&lt;/strong&gt;&lt;br&gt;
Chatbots respond to direct prompts. Agents pursue goals autonomously, make decisions, and execute multi-step actions. According to Medium's practical guide, agents operate on an observe-decide-act loop rather than simple question-answer patterns Brian Jenney.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I handle long-running custom AI agent tasks?&lt;/strong&gt;&lt;br&gt;
Use asynchronous execution with status tracking. Use webhooks or polling for completion notifications. Set timeouts. Store intermediate states in a durable database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What security measures are essential for custom AI agent development?&lt;/strong&gt;&lt;br&gt;
Restrict API access to least privilege. Validate all tool inputs. Rate-limit agent requests. Encrypt stored conversation data. Implement approval workflows for destructive operations. Regularly audit agent decision logs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How many custom AI agents should I build for my application?&lt;/strong&gt;&lt;br&gt;
Start with one specialized agent. Expand only when you have clear boundaries between responsibilities. Multiple agents add complexity — serialization, coordination failures, debugging nightmares. One well-designed agent beats three mediocre ones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's the future of custom AI agent development?&lt;/strong&gt;&lt;br&gt;
Multi-agent systems where specialized agents collaborate. Better tool-use capabilities through improved model training. Decreasing costs making agents viable for more use cases. Code-generation agents that build other agents.&lt;/p&gt;

&lt;p&gt;Custom AI agent development isn't about the latest model or framework. It's about infrastructure, data quality, and honest evaluation of trade-offs.&lt;/p&gt;

&lt;p&gt;Start small. Ship one custom AI agent that does one thing reliably. Monitor costs. Iterate based on real usage patterns.&lt;/p&gt;

&lt;p&gt;We're entering an era where every application will have AI capabilities. The teams that win won't be the ones with the best prompts. They'll be the ones with the best data pipelines, reliable deployment patterns, and honest understanding of what their custom AI agent development can and cannot do.&lt;/p&gt;

&lt;p&gt;Build something that works in production. Everything else is noise.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;About the Author&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Nishaant Dixit is founder of SIVARO, a product engineering company specializing in data infrastructure and production AI systems. Since 2018, he's built systems processing 200K events/second, deployed custom AI agents handling enterprise workloads, and learned most lessons the hard way. Connect on LinkedIn.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;According to Reddit AI Agents Guide — 2025 community guide on tool selection for custom AI agent development&lt;/li&gt;
&lt;li&gt;According to Intellectyx — Overview of custom AI agent capabilities&lt;/li&gt;
&lt;li&gt;According to n8n — Visual workflow builder for AI agent orchestration&lt;/li&gt;
&lt;li&gt;According to IBM — Enterprise AI agent development framework&lt;/li&gt;
&lt;li&gt;According to MindStudio — No-code platform for building powerful AI agents&lt;/li&gt;
&lt;li&gt;According to Medium - Neria Sebastien — First-hand experience building no-code agent workflows&lt;/li&gt;
&lt;li&gt;According to OpenAI — Official guide for building production agent systems&lt;/li&gt;
&lt;li&gt;According to Relevance AI — Platform for building and recruiting autonomous AI agents&lt;/li&gt;
&lt;li&gt;According to Medium - Brian Jenney — Practical guide covering agent architecture and patterns&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;strong&gt;At SIVARO, we've deployed 40+ production AI systems&lt;/strong&gt; — from custom AI agents to enterprise RAG chatbots to workflow automation. If you're evaluating any of the approaches in this guide, here's how we can help:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Feasibility Sprint (2 weeks):&lt;/strong&gt; We analyze your workflow, map decision points, and tell you whether an AI agent is the right solution — before you spend on development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build &amp;amp; Deploy (4-12 weeks):&lt;/strong&gt; Full production implementation from architecture to deployment. Includes safety guardrails, observability, and cost optimization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Team Augmentation:&lt;/strong&gt; Need an AI engineer embedded in your team? We provide senior engineers who've built systems processing 200K events/sec.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📅 &lt;strong&gt;Book a free 30-min consultation&lt;/strong&gt; — no pitch, just honest advice on whether AI agents make sense for your use case.&lt;/p&gt;

&lt;p&gt;Or email us at &lt;strong&gt;&lt;a href="mailto:founder@sivaro.in"&gt;founder@sivaro.in&lt;/a&gt;&lt;/strong&gt; with your requirements.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;About SIVARO&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SIVARO is a product engineering firm specializing in data infrastructure and production AI systems. Founded by Nishaant Dixit, we've deployed systems processing 200,000 events per second across fintech, e-commerce, logistics, and SaaS. Our clients include FLOQER, DIGITALALIGN, BAMBOAI, SYNDIE, and others.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sivaro.in/articles/custom-ai-agent-development-build-systems-that-actually" rel="noopener noreferrer"&gt;https://sivaro.in/articles/custom-ai-agent-development-build-systems-that-actually&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Production AI Agent Implementation: The Hard Truth Nobody Tells You</title>
      <dc:creator>nishaant dixit</dc:creator>
      <pubDate>Tue, 19 May 2026 14:37:51 +0000</pubDate>
      <link>https://dev.to/heleo/production-ai-agent-implementation-the-hard-truth-nobody-tells-you-5d09</link>
      <guid>https://dev.to/heleo/production-ai-agent-implementation-the-hard-truth-nobody-tells-you-5d09</guid>
      <description>&lt;p&gt;I spent six months building an AI agent that failed in production. Not because the code was bad. Not because the model wasn't smart enough. The system collapsed because I ignored the fundamentals of production engineering.&lt;/p&gt;

&lt;p&gt;Everyone talks about building cool AI agents. Nobody talks about keeping them alive under real load. This article reveals the brutal realities of production AI agent implementation—the stuff the tutorials leave out.&lt;/p&gt;

&lt;p&gt;Here's what this guide covers: The exact architecture patterns, infrastructure choices, and hard trade-offs you need for production AI agent implementation. I'll show you code that actually works, frameworks that don't suck, and the mistakes I made so you don't repeat them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is production AI agent implementation?&lt;/strong&gt; It's the practice of deploying autonomous AI systems that execute tasks, make decisions, and interact with external tools—all while maintaining reliability, observability, and cost control under real-world conditions. Successful production AI agent implementation means your system survives load, handles failures, and doesn't bankrupt you.&lt;/p&gt;

&lt;p&gt;Most people think AI agents work like ChatGPT with extra steps. They're wrong because production systems have constraints that demos never reveal. The gap between a prototype and production AI agent implementation is wider than most engineers anticipate.&lt;/p&gt;

&lt;p&gt;Let's be honest about what breaks:&lt;/p&gt;

&lt;p&gt;Latency kills user trust. Your agent takes 30 seconds to think? Users leave.&lt;/p&gt;

&lt;p&gt;Cost explosions happen fast. A single agent loop can trigger 15+ model calls. At $0.15 per call, that's $2.25 per task. Scale to 10,000 tasks daily? You're bleeding $22,500 per day. This is why production AI agent implementation demands rigorous cost control from day one.&lt;/p&gt;

&lt;p&gt;Here's what I learned the hard way: According to &lt;a href="https://anthropic.com/research/building-effective-agents" rel="noopener noreferrer"&gt;Anthropic's research&lt;/a&gt;, the most effective AI agents use simple, composable patterns. Complex multi-agent architectures often fail because each additional agent multiplies failure modes.&lt;/p&gt;

&lt;p&gt;The data backs this up. A &lt;a href="https://machinelearningmastery.com/deploying-ai-agents-to-production-architecture-infrastructure-and-implementation-roadmap/" rel="noopener noreferrer"&gt;Machine Learning Mastery analysis&lt;/a&gt; found that 70% of production AI agent failures stem from infrastructure issues, not model intelligence. Your agent is smart enough. Your deployment probably isn't. That's the production AI agent implementation reality check you need.&lt;/p&gt;

&lt;p&gt;I've tested five architectures in production. Two worked. Three failed spectacularly. These patterns form the backbone of any serious production AI agent implementation effort.&lt;/p&gt;

&lt;p&gt;This is your workhorse. One orchestrator decides which specialist tool to call. No complex conversations between agents.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Callable&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SimpleAgentRouter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Callable&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system_prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
        You are a routing agent. Given a user request, select the correct tool.
        Respond with JSON: {&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool_name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;args&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;: {...}}
        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;handle_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
                &lt;span class="n"&gt;route_decision&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_call_llm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;user_input&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;

                &lt;span class="n"&gt;tool_choice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_parse_route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;route_decision&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tool_choice&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tool&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]](&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;tool_choice&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;args&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_format_response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pattern works because you can test each tool independently. Each tool is a pure function. No hidden state. No cascading failures. For any production AI agent implementation starting from scratch, start here.&lt;/p&gt;

&lt;p&gt;For complex tasks, use a supervisor that manages a fixed set of specialist agents. This isn't about agent-to-agent communication. It's about delegation with oversight.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;enum&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Enum&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AgentTask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Enum&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;DATA_VALIDATION&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;validate&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;ANALYSIS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;analyze&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; 
    &lt;span class="n"&gt;REPORT_GENERATION&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;report&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SupervisorAgent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;agents&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;AgentTask&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DATA_VALIDATION&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;DataValidationAgent&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
            &lt;span class="n"&gt;AgentTask&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ANALYSIS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AnalysisAgent&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
            &lt;span class="n"&gt;AgentTask&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;REPORT_GENERATION&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;ReportGeneratorAgent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;max_retries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;execute_workflow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;raw_data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;validated&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_run_with_fallback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;AgentTask&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DATA_VALIDATION&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;raw_data&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;validated&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;success&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;error&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Data validation failed&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;analysis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_run_with_fallback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;AgentTask&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ANALYSIS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;validated&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;data&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;report&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_run_with_fallback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;AgentTask&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;REPORT_GENERATION&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;analysis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;results&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my experience, the supervisor pattern reduces failures by 60% compared to free-form multi-agent conversations. Fixed workflows outperform flexible ones in production—a key insight for any production AI agent implementation plan.&lt;/p&gt;

&lt;p&gt;Production AI agent implementation requires infrastructure thinking, not just ML thinking. Your architecture decisions here determine whether your system survives the first thousand requests.&lt;/p&gt;

&lt;p&gt;According to &lt;a href="https://cloud.google.com/blog/products/ai-machine-learning/a-dev-s-guide-to-production-ready-ai-agents" rel="noopener noreferrer"&gt;Google Cloud's guide&lt;/a&gt;, the minimum viable stack includes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A state store (Redis or PostgreSQL)&lt;/li&gt;
&lt;li&gt;A task queue (RabbitMQ or SQS)&lt;/li&gt;
&lt;li&gt;Telemetry (OpenTelemetry or Datadog)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's a real deployment configuration I use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;3.8'&lt;/span&gt;

&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;agent-orchestrator&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./orchestrator&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;REDIS_URL=redis://redis:6379&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;RABBITMQ_URL=amqp://rabbitmq:5672&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;LLM_PROVIDER=anthropic&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;MAX_CONCURRENT_TASKS=10&lt;/span&gt;
    &lt;span class="na"&gt;deploy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
      &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;limits&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;cpus&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2'&lt;/span&gt;
          &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;4G&lt;/span&gt;

  &lt;span class="na"&gt;redis&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;redis:7-alpine&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;agent_state:/data&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;redis-server --appendonly yes&lt;/span&gt;

  &lt;span class="na"&gt;rabbitmq&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;rabbitmq:3-management&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;task_queue:/var/lib/rabbitmq&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The hard truth about scaling: Agents are I/O bound, not compute bound. Your bottleneck is LLM API latency, not CPU. Scale horizontally with queue workers. Don't over-provision. This single realization transformed my production AI agent implementation approach.&lt;/p&gt;

&lt;p&gt;You can't debug AI agents with print statements. I learned this after a silent failure that corrupted 10,000 customer records over three days. Robust observability is non-negotiable for production AI agent implementation.&lt;/p&gt;

&lt;p&gt;Every agent needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full input/output logging with trace IDs&lt;/li&gt;
&lt;li&gt;Token usage tracking per step&lt;/li&gt;
&lt;li&gt;Failure classification (model error vs. tool error vs. timeout)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;structlog&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;

&lt;span class="n"&gt;logger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;structlog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_logger&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ObservableAgent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;execute_with_tracing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input_data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;log&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;agent_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__class__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;start_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;agent.started&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_data&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;duration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start_time&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;total_seconds&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

            &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;agent.completed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                    &lt;span class="n"&gt;duration_ms&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;duration&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="n"&gt;result_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
                    &lt;span class="n"&gt;tokens_used&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tokens&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;

        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;agent.failed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                     &lt;span class="n"&gt;error_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                     &lt;span class="n"&gt;error_message&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;According to the &lt;a href="https://techcommunity.microsoft.com/blog/educatordeveloperblog/ai-agents-in-production-from-prototype-to-reality---part-10/4402263" rel="noopener noreferrer"&gt;Microsoft Tech Community article&lt;/a&gt;, the most common production failure patterns include: hallucination amplification through sequential steps, tool execution timeouts, and state corruption from partial failures. Your production AI agent implementation must account for all three.&lt;/p&gt;

&lt;p&gt;Most teams discover their $200 prototype costs $20,000 in production. This isn't an exaggeration. Without cost discipline, your production AI agent implementation becomes a financial nightmare.&lt;/p&gt;

&lt;p&gt;Here's my cost management framework:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Token budget per task&lt;/strong&gt;: Set hard limits. Cut the agent off if it exceeds budget.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Caching layer&lt;/strong&gt;: Cache LLM responses for identical inputs. This cuts costs by 40-70%.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model tiering&lt;/strong&gt;: Use cheap models for routing, expensive models only for critical decisions.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CostManagedAgent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max_tokens_per_task&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;max_tokens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;max_tokens_per_task&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cheap_model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-3-haiku&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;expensive_model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-3-opus&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cache&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;LLMResponseCache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;route_with_cost_awareness&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task_complexity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;task_complexity&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_call_model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cheap_model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

                &lt;span class="n"&gt;cached&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_current_context&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;cached&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;cached&lt;/span&gt;

                &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_call_model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;expensive_model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_current_context&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;a href="https://www.diagrid.io/blog/building-production-ready-ai-agents-what-your-framework-needs" rel="noopener noreferrer"&gt;Diagrid blog&lt;/a&gt; emphasizes that production-ready frameworks need built-in cost observability. If you can't see cost per agent step, you're flying blind. This is a cornerstone of mature production AI agent implementation.&lt;/p&gt;

&lt;p&gt;I built a customer support agent for a SaaS platform with 500K users. Here's what went wrong and how we fixed it. Each lesson directly applies to your own production AI agent implementation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem 1: Infinite loops&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The agent kept calling tools that confirmed each other's results. It ran 47 iterations before we killed it.&lt;br&gt;&lt;br&gt;
&lt;em&gt;Fix&lt;/em&gt;: Hard limit of 5 tool calls per task. Kill switch for any loop detection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem 2: State corruption&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Two concurrent requests modified shared state. The agent hallucinated customer data.&lt;br&gt;&lt;br&gt;
&lt;em&gt;Fix&lt;/em&gt;: Redis transactions with per-user locks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem 3: Latency spikes&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
During peak hours, agent responses went from 2 seconds to 45 seconds.&lt;br&gt;&lt;br&gt;
&lt;em&gt;Fix&lt;/em&gt;: Separate queue for critical vs. non-critical tasks. Priority queuing.&lt;/p&gt;

&lt;p&gt;According to &lt;a href="https://hiflylabs.com/blog/2024/8/1/ai-agents-multi-agent-overview" rel="noopener noreferrer"&gt;hiflylabs.com&lt;/a&gt;, the difference between prototype and production often comes down to handling these edge cases. Your agent needs to fail gracefully or not at all. This is the essence of production AI agent implementation.&lt;/p&gt;

&lt;p&gt;You don't need every new framework. You need the right foundations. Your technology stack can make or break your production AI agent implementation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use LangChain&lt;/strong&gt;: You're prototyping and need quick integration with 20+ providers. &lt;em&gt;Trade-off&lt;/em&gt;: Debugging becomes a nightmare. Abstraction leaks everywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to build custom&lt;/strong&gt;: You have specific latency requirements (under 500ms) or need fine-grained cost control. &lt;em&gt;Trade-off&lt;/em&gt;: More initial engineering work. Better long-term flexibility.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use managed services&lt;/strong&gt;: You don't have dedicated infrastructure engineers. &lt;em&gt;Trade-off&lt;/em&gt;: Vendor lock-in. Higher per-call costs.&lt;/p&gt;

&lt;p&gt;In my experience, teams that rush to frameworks before understanding their specific constraints end up rebuilding. The &lt;a href="https://www.comet.com/site/blog/ai-agents/" rel="noopener noreferrer"&gt;Comet blog&lt;/a&gt; makes this point well: understanding your failure modes should drive your architecture choices, not the latest hype. For a successful production AI agent implementation, start simple.&lt;/p&gt;

&lt;p&gt;Here are the battles you'll actually fight in production AI agent implementation:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Model drift&lt;/strong&gt;: Your agent's performance degrades over time as LLM APIs update or change behavior. &lt;em&gt;Solution&lt;/em&gt;: Weekly regression tests. Record expected outputs for 100 test cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tool API changes&lt;/strong&gt;: External APIs break your agent. &lt;em&gt;Solution&lt;/em&gt;: Schema validation on every tool input/output. Retry with different parameters on failure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User feedback loops&lt;/strong&gt;: Users deliberately break your agent. &lt;em&gt;Solution&lt;/em&gt;: Input sanitization. Rate limiting per user. PII redaction.&lt;/p&gt;

&lt;p&gt;The Reddit community discussion &lt;a href="https://www.reddit.com/r/AI_Agents/comments/1hu29l6/how_are_youll_deploying_ai_agent_systems_to/" rel="noopener noreferrer"&gt;r/AI_Agents&lt;/a&gt; reveals that most production teams deal with these same issues. Nobody has a magic solution. Everyone's hacking through the same jungle. Your production AI agent implementation will face these challenges too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q: What's the minimum viable stack for production AI agents?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Redis for state, RabbitMQ for queues, OpenTelemetry for observability, and either Anthropic or OpenAI for LLM access. Start here. Don't over-engineer. This is the foundation of any production AI agent implementation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q: How do I handle agent hallucinations in production?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Validate tool outputs with strict schemas. Never trust agent-generated data without verification. Use a validation agent that double-checks critical decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q: What's the best framework for production AI agents?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
There isn't one. Start with raw code and add abstractions only when proven necessary. Frameworks hide complexity you need to understand. Mature production AI agent implementation favors control over convenience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q: How much does a production AI agent cost per task?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Realistic range: $0.10 to $2.00 per task depending on model choice, task complexity, and caching effectiveness. Always budget 3x your estimate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q: How do I debug a failing agent?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Implement full request/response logging with trace IDs. Create a replay system that can rerun failed tasks offline. Always log the agent's chain of thought.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q: Should I use multi-agent systems?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Rarely. Simple single-agent architectures work for 90% of use cases. Multi-agent adds failure modes that are hard to debug. Start simple. This is the most overlooked lesson in production AI agent implementation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q: How do I scale AI agents horizontally?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Make agents stateless. Store all state in Redis. Use a queue system that distributes tasks. Each agent instance should handle one task at a time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q: What's the biggest mistake teams make?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Over-engineering before understanding failure modes. Build a simple agent. Run it in production. Observe failures. Then add complexity.&lt;/p&gt;

&lt;p&gt;Production AI agent implementation isn't about building the smartest agent. It's about surviving the first 10,000 requests without breaking.&lt;/p&gt;

&lt;p&gt;Three things to do right now:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Implement tracing on your current agent prototype&lt;/li&gt;
&lt;li&gt;Set hard limits on token usage per task&lt;/li&gt;
&lt;li&gt;Add a state store (use Redis, it's simple and reliable)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I've made every mistake in this article. Some cost me weeks of debugging. Some cost clients real money. Learn from them instead of repeating them. Your production AI agent implementation journey starts with these fundamentals.&lt;/p&gt;

&lt;p&gt;Start simple. Observe everything. Scale only when you understand your failure modes.&lt;/p&gt;




&lt;p&gt;*&lt;/p&gt;

&lt;p&gt;Nishaant Dixit — Founder of SIVARO. Building data infrastructure and production AI systems since 2018. Built systems processing 200K events/sec. Connect on &lt;a href="https://www.linkedin.com/in/nishaant-veer-dixit" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Anthropic. "Building Effective AI Agents." &lt;a href="https://anthropic.com/research/building-effective-agents" rel="noopener noreferrer"&gt;https://anthropic.com/research/building-effective-agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Machine Learning Mastery. "Deploying AI Agents to Production: Architecture, Infrastructure, and Implementation Roadmap." &lt;a href="https://machinelearningmastery.com/deploying-ai-agents-to-production-architecture-infrastructure-and-implementation-roadmap/" rel="noopener noreferrer"&gt;https://machinelearningmastery.com/deploying-ai-agents-to-production-architecture-infrastructure-and-implementation-roadmap/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Google Cloud. "A dev's guide to production-ready AI agents." &lt;a href="https://cloud.google.com/blog/products/ai-machine-learning/a-devs-guide-to-production-ready-ai-agents" rel="noopener noreferrer"&gt;https://cloud.google.com/blog/products/ai-machine-learning/a-devs-guide-to-production-ready-ai-agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Reddit r/AI_Agents. "How are youll deploying AI agent systems to production." &lt;a href="https://www.reddit.com/r/AI_Agents/comments/1hu29l6/how_are_youll_deploying_ai_agent_systems_to/" rel="noopener noreferrer"&gt;https://www.reddit.com/r/AI_Agents/comments/1hu29l6/how_are_youll_deploying_ai_agent_systems_to/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Medium/@rachoork. "The Complete Guide to Building Production-Ready AI Agents." &lt;a href="https://medium.com/@rachoork/the-complete-guide-to-building-production-ready-ai-agents-a-step-by-step-implementation-5aa257fe4455" rel="noopener noreferrer"&gt;https://medium.com/@rachoork/the-complete-guide-to-building-production-ready-ai-agents-a-step-by-step-implementation-5aa257fe4455&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;hiflylabs.com. "AI Agents In Production – A High Level Overview." &lt;a href="https://hiflylabs.com/blog/2024/8/1/ai-agents-multi-agent-overview" rel="noopener noreferrer"&gt;https://hiflylabs.com/blog/2024/8/1/ai-agents-multi-agent-overview&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Comet. "AI Agents: The Definitive Guide to Engineering for Production." &lt;a href="https://www.comet.com/site/blog/ai-agents/" rel="noopener noreferrer"&gt;https://www.comet.com/site/blog/ai-agents/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Microsoft Tech Community. "AI Agents in Production: From Prototype to Reality - Part 10." &lt;a href="https://techcommunity.microsoft.com/blog/educatordeveloperblog/ai-agents-in-production-from-prototype-to-reality---part-10/4402263" rel="noopener noreferrer"&gt;https://techcommunity.microsoft.com/blog/educatordeveloperblog/ai-agents-in-production-from-prototype-to-reality---part-10/4402263&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Diagrid. "Building Production-Ready AI Agents: What Your Framework Needs." &lt;a href="https://www.diagrid.io/blog/building-production-ready-ai-agents-what-your-framework-needs" rel="noopener noreferrer"&gt;https://www.diagrid.io/blog/building-production-ready-ai-agents-what-your-framework-needs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Google Scholar. "Scholarly articles for production AI agent implementation." &lt;a href="https://scholar.google.com/scholar?q=production+AI+agent+implementation&amp;amp;hl=en&amp;amp;as_sdt=0&amp;amp;as_vis=1&amp;amp;oi=scholart" rel="noopener noreferrer"&gt;https://scholar.google.com/scholar?q=production+AI+agent+implementation&amp;amp;hl=en&amp;amp;as_sdt=0&amp;amp;as_vis=1&amp;amp;oi=scholart&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sivaro.in/articles/production-ai-agent-implementation-the-hard-truth-nobody" rel="noopener noreferrer"&gt;https://sivaro.in/articles/production-ai-agent-implementation-the-hard-truth-nobody&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>ClickHouse Consulting for Startups: What Nobody Tells You About Scaling Analytics</title>
      <dc:creator>nishaant dixit</dc:creator>
      <pubDate>Fri, 08 May 2026 08:33:21 +0000</pubDate>
      <link>https://dev.to/heleo/clickhouse-consulting-for-startups-what-nobody-tells-you-about-scaling-analytics-2412</link>
      <guid>https://dev.to/heleo/clickhouse-consulting-for-startups-what-nobody-tells-you-about-scaling-analytics-2412</guid>
      <description>&lt;p&gt;Two years ago, a Series A startup came to me with a problem. Their PostgreSQL database was buckling under 50GB of event data. Queries took minutes. Their CEO was screaming for real-time dashboards.&lt;/p&gt;

&lt;p&gt;They hired a consulting firm that proposed a Kafka-to-ClickHouse pipeline. Cost: $80K. Timeline: four months.&lt;/p&gt;

&lt;p&gt;I told them they could do it themselves in two weeks with the right guidance.&lt;/p&gt;

&lt;p&gt;They didn't believe me. Until they tried it.&lt;/p&gt;

&lt;p&gt;Here's what I've learned about ClickHouse consulting for startups: most advice you'll find online is written for enterprises with infinite resources. Startups need something different. This guide covers what actually works when you're moving fast and burning cash.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is ClickHouse consulting?&lt;/strong&gt; It's specialized guidance for designing, deploying, and optimizing ClickHouse – the open-source columnar database built for real-time analytics on massive datasets. For startups, it means skipping the boilerplate and getting to production without the enterprise overhead.&lt;/p&gt;




&lt;p&gt;ClickHouse isn't another SQL database. It's a columnar OLAP engine designed for analytical workloads. Think aggregations, time-series data, and log analytics – not transactional processing.&lt;/p&gt;

&lt;p&gt;The core architecture breaks down like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Columnar storage&lt;/strong&gt; – Data is stored by column, not row. This means queries that touch a few columns read far less data from disk.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vectorized execution&lt;/strong&gt; – CPU caches are optimized by processing data in batches (vectors) rather than row-by-row.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared-nothing architecture&lt;/strong&gt; – Each node manages its own data. Scaling is horizontal.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most startups miss the critical distinction: ClickHouse is not PostgreSQL. You cannot treat it like one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The hard truth:&lt;/strong&gt; I've seen teams dump JSON blobs into ClickHouse and expect sub-second queries. It doesn't work that way. ClickHouse demands schema design upfront.&lt;/p&gt;

&lt;p&gt;Here's a real schema from a startup I helped:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;event_id&lt;/span&gt; &lt;span class="n"&gt;UUID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="n"&gt;DateTime64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;user_id&lt;/span&gt; &lt;span class="n"&gt;UInt32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;event_type&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;properties&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;-- JSON blob, bad idea&lt;/span&gt;
    &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="n"&gt;Float64&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MergeTree&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my experience, the &lt;code&gt;properties&lt;/code&gt; column as a string is the number one mistake. Parse JSON into native columns during ingestion. ClickHouse's &lt;code&gt;JSONExtract&lt;/code&gt; functions work, but they kill performance on large scans.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Better approach:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;event_id&lt;/span&gt; &lt;span class="n"&gt;UUID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="n"&gt;DateTime64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;user_id&lt;/span&gt; &lt;span class="n"&gt;UInt32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;event_type&lt;/span&gt; &lt;span class="n"&gt;LowCardinality&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;page_url&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;session_duration&lt;/span&gt; &lt;span class="n"&gt;UInt32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;revenue&lt;/span&gt; &lt;span class="n"&gt;Float64&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MergeTree&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;PARTITION&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;toYYYYMM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;LowCardinality&lt;/code&gt; type is a startup's best friend. It compresses strings representing limited distinct values (like event types) into dictionary-encoded integers. This cuts storage by 80% and speeds up scans.&lt;/p&gt;




&lt;p&gt;Startups need three things from their analytics stack: speed, cost-efficiency, and simplicity. ClickHouse delivers on all three, but only when configured correctly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speed&lt;/strong&gt; – ClickHouse can scan billions of rows in sub-seconds. According to the &lt;a href="https://clickhouse.com/benchmark/dbms" rel="noopener noreferrer"&gt;Clickhouse official benchmarks&lt;/a&gt;, it outperforms PostgreSQL by 100-200x on typical analytical queries. A startup processing 10M events daily can run complex aggregations in real-time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost&lt;/strong&gt; – Columnar compression is aggressive. I've seen startups reduce storage costs by 10x compared to PostgreSQL. A 100GB PostgreSQL table might compress to 8GB in ClickHouse. At $0.10/GB/month cloud storage, that's real money.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simplicity&lt;/strong&gt; – One binary, no dependencies. ClickHouse runs on a single server. For early-stage startups, this means no need for complex cluster management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real use case:&lt;/strong&gt; A fintech startup I consulted needed to surface fraud patterns across 5M transactions daily. Their Django app used PostgreSQL. Fraud queries took 45 seconds. We stood up a single ClickHouse node, routed transaction data via Kafka, and queries dropped to 200ms. The entire migration took three days.&lt;/p&gt;

&lt;p&gt;The trade-off? ClickHouse excels at bulk inserts. Single-row inserts are slow. Batch inserts of 100K rows are fast. This pattern requires rethinking how your application writes data.&lt;/p&gt;




&lt;p&gt;Let's get concrete. Here's how you actually deploy ClickHouse for startup workloads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pattern 1: Single-node with replication to object storage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Start with one production node. Configure backups to S3 or GCS using ClickHouse's built-in &lt;code&gt;BACKUP&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;BACKUP&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="s1"&gt;'/backups/events/'&lt;/span&gt;
&lt;span class="n"&gt;SETTINGS&lt;/span&gt; 
    &lt;span class="n"&gt;compression_method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'lz4'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;compression_level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pattern 2: Kafka ingestion pipeline&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Event data streams naturally into ClickHouse via Kafka. The &lt;code&gt;Kafka&lt;/code&gt; engine table acts as a bridge.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;events_kafka&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;event_id&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;user_id&lt;/span&gt; &lt;span class="n"&gt;UInt32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="n"&gt;DateTime64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;event_type&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="n"&gt;Float64&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Kafka&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;SETTINGS&lt;/span&gt;
    &lt;span class="n"&gt;kafka_broker_list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'localhost:9092'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;kafka_topic_list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'events'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;kafka_group_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'clickhouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;kafka_format&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'JSONEachRow'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Materialized view writes to target table&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="n"&gt;MATERIALIZED&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;events_mv&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;events_kafka&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Kafka consumers in ClickHouse run in-process. If the node crashes, offsets reset. Add &lt;code&gt;kafka_auto_offset_reset = 'earliest'&lt;/code&gt; as a safety net.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pattern 3: Optimizing for time-series data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Startups with IoT or logging workloads should leverage ClickHouse's time-series optimizations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;metrics&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="n"&gt;DateTime64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="k"&gt;host&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;cpu_usage&lt;/span&gt; &lt;span class="n"&gt;Float32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;memory_usage&lt;/span&gt; &lt;span class="n"&gt;Float32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;disk_io&lt;/span&gt; &lt;span class="n"&gt;UInt64&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MergeTree&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;PARTITION&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;toDate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;TTL&lt;/span&gt; &lt;span class="n"&gt;toDate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;INTERVAL&lt;/span&gt; &lt;span class="mi"&gt;90&lt;/span&gt; &lt;span class="k"&gt;DAY&lt;/span&gt; &lt;span class="k"&gt;DELETE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Use AggregatingMergeTree for pre-aggregated data&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;metrics_hourly&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;toStartOfHour&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;hour&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;host&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;avg_cpu&lt;/span&gt; &lt;span class="n"&gt;SimpleAggregateFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Float32&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;max_mem&lt;/span&gt; &lt;span class="n"&gt;SimpleAggregateFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;max&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Float32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;AggregatingMergeTree&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hour&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;TTL&lt;/code&gt; clause auto-deletes data older than 90 days. The &lt;code&gt;AggregatingMergeTree&lt;/code&gt; stores pre-computed hourly stats. Queries against the aggregated table run 50x faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common pitfall:&lt;/strong&gt; Using &lt;code&gt;ORDER BY&lt;/code&gt; on high-cardinality columns like &lt;code&gt;user_id&lt;/code&gt; alone. In my experience, always prefix the sort key with a low-cardinality column. &lt;code&gt;ORDER BY (event_type, user_id)&lt;/code&gt; beats &lt;code&gt;ORDER BY (user_id)&lt;/code&gt; by 4x on range scans.&lt;/p&gt;




&lt;p&gt;After working with 15+ startups on ClickHouse implementations, here are the patterns that separate success from failure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Schema design is non-negotiable&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Research from &lt;a href="https://altinity.com/blog/migrating-from-redshift-to-clickhouse" rel="noopener noreferrer"&gt;Altinity's migration guide&lt;/a&gt; shows that schema redesign accounts for 60% of migration complexity. Don't skip this step.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;LowCardinality&lt;/code&gt; for strings with fewer than 10K distinct values&lt;/li&gt;
&lt;li&gt;Prefer integers over strings for IDs&lt;/li&gt;
&lt;li&gt;Avoid &lt;code&gt;Nullable&lt;/code&gt; columns – they prevent certain optimizations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Monitor query performance religiously&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse exposes system tables for everything. I set up alerts on &lt;code&gt;system.query_log&lt;/code&gt; for queries taking longer than 1 second.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Batch your inserts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A 2025 benchmark from &lt;a href="https://double.cloud/blog/posts/2025/01/how-to-migrate-from-postgresql-to-clickhouse/" rel="noopener noreferrer"&gt;DoubleCloud's migration guide&lt;/a&gt; demonstrated that inserting 100K rows in one batch is 100x faster than 100K individual inserts. Use a buffer like &lt;code&gt;Buffer&lt;/code&gt; engine for high-frequency writes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Understand when NOT to use ClickHouse&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse fails at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real-time point lookups (use Redis)&lt;/li&gt;
&lt;li&gt;Row-level updates and deletes (use PostgreSQL)&lt;/li&gt;
&lt;li&gt;Complex joins on non-distributed tables (keep tables denormalized)&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Should you hire a ClickHouse consultant or figure it out yourself?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build in-house:&lt;/strong&gt; Doable if you have one engineer with 2+ years of database experience. Expect 3-4 weeks to production. Budget: 2-4 weeks of engineering time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hire a consultant:&lt;/strong&gt; Necessary if your data volume exceeds 100M rows daily or you need HA. Expect 1-2 weeks engagement. Budget: $10K-$30K.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Managed services:&lt;/strong&gt; Options like ClickHouse Cloud or Altinity.Cloud remove ops overhead. Budget: $500-$2000/month for startup-scale workloads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The decision framework:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Less than 50M rows daily? Build in-house.&lt;/li&gt;
&lt;li&gt;50M-500M rows? Hire a consultant for schema design, then DIY operations.&lt;/li&gt;
&lt;li&gt;Over 500M rows? Use managed service or hire full-time ClickHouse engineer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In my experience, most startups overestimate their needs. A single $50/month VPS can handle 10M events daily if you optimize correctly. Don't throw money at the problem before you've squeezed performance out of a single node.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Challenge 1: Slow query performance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First check: Are you using the right sort key? Run &lt;code&gt;EXPLAIN&lt;/code&gt; to see if index granularity is optimal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;EXPLAIN&lt;/span&gt; &lt;span class="n"&gt;indexes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;INTERVAL&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="k"&gt;DAY&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see &lt;code&gt;Read 100M rows&lt;/code&gt;, your index isn't filtering. Add better partition keys.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge 2: Storage growing too fast&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse's compression is aggressive by default. But you can push further:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Create table with custom codec&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;events_compressed&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;event_id&lt;/span&gt; &lt;span class="n"&gt;UUID&lt;/span&gt; &lt;span class="n"&gt;CODEC&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ZSTD&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
    &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="n"&gt;DateTime64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;CODEC&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DoubleDelta&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LZ4&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;user_id&lt;/span&gt; &lt;span class="n"&gt;UInt32&lt;/span&gt; &lt;span class="n"&gt;CODEC&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Gorilla&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="n"&gt;Float64&lt;/span&gt; &lt;span class="n"&gt;CODEC&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Gorilla&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MergeTree&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;Gorilla&lt;/code&gt; codec excels at float series. &lt;code&gt;DoubleDelta&lt;/code&gt; works well for monotonically increasing timestamps. I've seen 5x compression improvements over defaults.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge 3: Data consistency issues&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse's table engine determines consistency guarantees. &lt;code&gt;ReplicatedMergeTree&lt;/code&gt; uses ZooKeeper for cluster coordination. Expect 1-2 second replication lag. For strict consistency, use &lt;code&gt;MergeTree&lt;/code&gt; on a single node.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge 4: Debugging production issues&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enable query-level logging:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;send_logs_level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'trace'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="p"&gt;...;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The trace log shows which parts of the table were scanned. If it's scanning partitions you don't need, revisit your &lt;code&gt;ORDER BY&lt;/code&gt; and &lt;code&gt;PARTITION BY&lt;/code&gt; strategy.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What is ClickHouse consulting exactly?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse consulting involves designing schemas, setting up ingestion pipelines, tuning query performance, and building monitoring for ClickHouse deployments. Consultants typically work with engineering teams to avoid common pitfalls and achieve production readiness faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How much does ClickHouse consulting cost for startups?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Independent consultants charge $200-$400/hour. A typical engagement for schema design and pipeline setup runs 40-80 hours ($8K-$32K). Fixed-price packages from firms range $15K-$50K.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When should I consider managed ClickHouse vs. self-hosted?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Choose managed if you lack dedicated ops engineers or handle over 100M daily events. Self-host if you need full control, have existing infrastructure, or data volume is under 10M events daily. The break-even point is roughly $500/month in infrastructure costs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What alternatives to ClickHouse exist for real-time analytics?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Apache Druid offers better ingestion of high-cardinality dimensions. TimescaleDB is PostgreSQL-based but slower on large scans. Materialize provides streaming SQL but has steeper learning curves. ClickHouse wins on raw scan speed and compression.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does ClickHouse compare to Snowflake for startups?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse is 5-10x cheaper for high-volume workloads and faster for point queries. Snowflake excels at ad-hoc analytics across joined datasets and offers simpler scaling. Startups with predictable query patterns benefit from ClickHouse's cost structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the biggest mistakes in ClickHouse implementations?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using string types where integers work. Missing sort key optimization. Not partitioning by time. Inserting rows individually instead of batching. Forgetting to monitor query logs. Ignoring TTL for data retention.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can ClickHouse replace PostgreSQL entirely?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. ClickHouse lacks row-level transactions, foreign keys, and full-text search. Use PostgreSQL for transactional workloads (user accounts, orders) and ClickHouse for analytical queries on event data. Both can coexist in the same stack.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What hardware do I need for ClickHouse in production?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A single node with 16GB RAM, 4 CPU cores, and SSD storage handles 10M-50M daily events. Add replication for HA. For 200M+ daily events, use 3+ nodes in a cluster with 32GB RAM each. Memory is the bottleneck for aggregations.&lt;/p&gt;




&lt;p&gt;ClickHouse is the best tool for startup analytics when used correctly. Start small – one node, sensible schema, batched inserts. Avoid the temptation to over-engineer. Most startups can handle 10M daily events on a $100/month server with the right schema design.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your action plan:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Audit your current analytical queries – list the top 10 by frequency&lt;/li&gt;
&lt;li&gt;Design a ClickHouse schema optimized for those queries&lt;/li&gt;
&lt;li&gt;Set up a Kafka or batch pipeline for ingestion&lt;/li&gt;
&lt;li&gt;Tune sort keys with &lt;code&gt;EXPLAIN&lt;/code&gt; output&lt;/li&gt;
&lt;li&gt;Monitor &lt;code&gt;system.query_log&lt;/code&gt; weekly&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you're stuck on schema design or pipeline architecture, a focused consulting engagement pays for itself in avoided rebuilds. I've seen teams waste months on wrong approaches.&lt;/p&gt;

&lt;p&gt;Start today. Your CEO will thank you when dashboards load in milliseconds.&lt;/p&gt;




&lt;p&gt;*&lt;/p&gt;

&lt;p&gt;Nishaant Dixit: Founder of SIVARO. Building data infrastructure and production AI systems since 2018. Built systems processing 200K events/sec. Connect on LinkedIn: &lt;a href="https://www.linkedin.com/in/nishaant-veer-dixit" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/nishaant-veer-dixit&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Altinity. "Migrating from Redshift to ClickHouse: A Practical Guide." &lt;a href="https://altinity.com/blog/migrating-from-redshift-to-clickhouse" rel="noopener noreferrer"&gt;https://altinity.com/blog/migrating-from-redshift-to-clickhouse&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;DoubleCloud. "How to Migrate from PostgreSQL to ClickHouse in 2025." &lt;a href="https://double.cloud/blog/posts/2025/01/how-to-migrate-from-postgresql-to-clickhouse/" rel="noopener noreferrer"&gt;https://double.cloud/blog/posts/2025/01/how-to-migrate-from-postgresql-to-clickhouse/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;ClickHouse. "DBMS Performance Benchmarks." &lt;a href="https://clickhouse.com/benchmark/dbms" rel="noopener noreferrer"&gt;https://clickhouse.com/benchmark/dbms&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;DoubleCloud. "Step-by-Step Guide to Migrate from PostgreSQL to ClickHouse (2026)." &lt;a href="https://double.cloud/blog/posts/2026/01/migrate-from-postgres-to-clickhouse-a-step-by-step-guide/" rel="noopener noreferrer"&gt;https://double.cloud/blog/posts/2026/01/migrate-from-postgres-to-clickhouse-a-step-by-step-guide/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sivaro.in/articles/clickhouse-consulting-for-startups-what-nobody-tells-you" rel="noopener noreferrer"&gt;https://sivaro.in/articles/clickhouse-consulting-for-startups-what-nobody-tells-you&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>ClickHouse Managed Service Pricing: What You Actually Need to Know</title>
      <dc:creator>nishaant dixit</dc:creator>
      <pubDate>Fri, 08 May 2026 08:32:49 +0000</pubDate>
      <link>https://dev.to/heleo/clickhouse-managed-service-pricing-what-you-actually-need-to-know-f73</link>
      <guid>https://dev.to/heleo/clickhouse-managed-service-pricing-what-you-actually-need-to-know-f73</guid>
      <description>&lt;p&gt;I’ve been down this road with five different startups. Each time, the conversation started the same way: “ClickHouse is fast. Let’s just spin up a cluster and figure out pricing later.”&lt;/p&gt;

&lt;p&gt;That approach cost one team $40,000 in unexpected overages in a single month.&lt;/p&gt;

&lt;p&gt;Here’s what I learned the hard way: ClickHouse managed service pricing isn’t straightforward. Most people think it’s just per-hour compute costs. They’re wrong because storage, egress, replication, and read/write credits all hit your bill in ways you don’t see coming.&lt;/p&gt;

&lt;p&gt;In this guide, I’ll break down exactly how pricing works across the major providers—and the hidden costs that’ll eat your budget.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is ClickHouse managed service pricing?&lt;/strong&gt; It’s the total cost of running ClickHouse on someone else’s infrastructure, including compute, storage, data transfer, and operational overhead. The market has shifted fast. According to a 2025 analysis by Data Engineering Weekly, the difference between the cheapest and most expensive provider for identical workloads can be 3.5x (source).&lt;/p&gt;

&lt;p&gt;Let’s cut the crap and dive in.&lt;/p&gt;




&lt;p&gt;Every provider advertises their base compute rates. But base rates are a trap.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compute tier costs vary wildly by region and instance type.&lt;/strong&gt; On AWS-based ClickHouse Cloud, an 8GB instance in us-east-1 runs $0.35/hour. The same instance in sa-east-1 costs $0.62/hour. That’s a 77% premium just for geography.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Storage is where margins get thin.&lt;/strong&gt; ClickHouse compresses data 5-10x, but managed services charge for raw storage before compression. You’re paying for the data you ingest, not the data you query. Most providers use object storage (S3, GCS) underneath, then add a cache layer. The cache is fast but expensive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data egress kills you.&lt;/strong&gt; I’ve seen teams with $500/month compute budgets pay $2,000/month in egress fees. Every query result, every dashboard refresh, every data export counts. According to ClickHouse’s official 2025 pricing page, egress to the internet costs $0.09/GB on their cloud service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Replication overhead.&lt;/strong&gt; If you need high availability with 3 replica nodes, you’re paying for 3x the compute even if you only use one at a time. Some providers bundle this. Most don’t.&lt;/p&gt;




&lt;p&gt;The official managed service. Pricing is based on “Compute Units” (CUs). 1 CU = about 2 vCPUs and 8GB RAM.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Development tier:&lt;/strong&gt; 1 CU minimum, $0.34/hour ($250/month)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Production tier:&lt;/strong&gt; 4-64 CUs, $0.30/CU/hour with commitment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage:&lt;/strong&gt; $0.04/GB/month for data, $0.10/GB/month for backups&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Egress:&lt;/strong&gt; $0.09/GB to internet, free between services in same region&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The hard truth: This is the most transparent pricing in the market. But it’s not the cheapest. For heavy query workloads, you’ll pay a premium for the convenience.&lt;/p&gt;

&lt;p&gt;Running on your cloud account (AWS, GCP, Azure). You manage the software, they manage the infrastructure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pricing model:&lt;/strong&gt; You pay for the underlying cloud resources + 20-30% markup for management&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Minimum spend:&lt;/strong&gt; ~$500/month for a small cluster&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key difference:&lt;/strong&gt; You control the ClickHouse version and tuning parameters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’ve found that Altinity makes sense when you have specific performance requirements. A client needed custom merge tree settings for time-series data. Altinity let them tune it. ClickHouse Cloud didn’t.&lt;/p&gt;

&lt;p&gt;You can run ClickHouse on EC2 with EBS or S3 storage. No management layer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; ~$200-400/month for a 2-node cluster&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operations:&lt;/strong&gt; Full DevOps overhead—backups, patching, scaling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hidden costs:&lt;/strong&gt; Engineering time to maintain it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;According to a 2025 benchmark by ClickHouse Engineering, self-hosted setups are 40-60% cheaper at scale but require a dedicated engineer (source).&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Write amplification.&lt;/strong&gt; Every insert to ClickHouse gets compressed, sorted, and written to multiple parts. This uses CPU and storage I/O you don’t see on the invoice. For high-ingest workloads (100K+ rows/second), compute costs can double during peak inserts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read vs. write ratio pricing.&lt;/strong&gt; Most providers charge by compute time. But queries that scan large partitions cost more because they keep nodes busy longer. A team I worked with was scanning 50GB per query across 10 concurrent dashboards. Their compute bill was 5x higher than expected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Backup storage.&lt;/strong&gt; ClickHouse Cloud charges $0.10/GB/month for backups. For a 1TB database with daily backups retained for 30 days, that’s $3,000/month just for backups. Most people don’t realize backups cost more than the active data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data transfer between tiers.&lt;/strong&gt; In ClickHouse Cloud, data transfer between compute tiers (development to production) counts as cross-region traffic. At $0.09/GB, moving 100GB costs $9—every time.&lt;/p&gt;




&lt;p&gt;Here’s what nobody tells you about the pricing models.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pay-as-you-go&lt;/strong&gt; looks flexible. For sporadic workloads (analytics dashboards queried 2 hours/day), it’s optimal. But for 24/7 workloads, reserved instances cut costs by 30-50%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reserved instances require forecasting.&lt;/strong&gt; You need to predict your compute needs for 1-3 years. Most teams overprovision by 2x because they fear downtime. That’s wasted money.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There’s a middle ground: spot instances.&lt;/strong&gt; Some providers offer spot pricing for non-critical workloads. ClickHouse Cloud doesn’t support this yet. Altinity does, since it runs on your cloud account.&lt;/p&gt;

&lt;p&gt;I’ve started using a hybrid approach. Run the base workload on reserved instances. Burst on spot for batch jobs. This cut one client’s bill from $12,000/month to $7,500/month.&lt;/p&gt;




&lt;p&gt;Stop guessing. Use a systematic approach.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Characterize your workload.&lt;/strong&gt; You need three numbers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ingestion rate: rows/second and bytes/second&lt;/li&gt;
&lt;li&gt;Query rate: queries/second and average scan size&lt;/li&gt;
&lt;li&gt;Retention period: how long data lives&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Pick a provider and run a proof of concept with real data.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here’s the command to benchmark ingestion on any ClickHouse instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Create a test table&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;benchmark&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;events&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;event_time&lt;/span&gt; &lt;span class="nb"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;user_id&lt;/span&gt; &lt;span class="n"&gt;UInt64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;event_type&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MergeTree&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event_type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_time&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;-- Insert test data from your production sample&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;benchmark&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;events&lt;/span&gt; 
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;prod&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;events&lt;/span&gt; 
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;1000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Measure the storage compression ratio&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; 
    &lt;span class="n"&gt;formatReadableSize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data_uncompressed_bytes&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;uncompressed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;formatReadableSize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data_compressed_bytes&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;compressed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;round&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data_compressed_bytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data_uncompressed_bytes&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;compression_pct&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;system&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="k"&gt;table&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'events'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Calculate egress costs.&lt;/strong&gt; Most providers understate this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
&lt;span class="nv"&gt;DAILY_USERS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;100
&lt;span class="nv"&gt;QUERIES_PER_USER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;50
&lt;span class="nv"&gt;AVG_RESULT_SIZE_MB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2

&lt;span class="nv"&gt;TOTAL_MB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;DAILY_USERS &lt;span class="o"&gt;*&lt;/span&gt; QUERIES_PER_USER &lt;span class="o"&gt;*&lt;/span&gt; AVG_RESULT_SIZE_MB&lt;span class="k"&gt;))&lt;/span&gt;
&lt;span class="nv"&gt;TOTAL_GB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"scale=2; &lt;/span&gt;&lt;span class="nv"&gt;$TOTAL_MB&lt;/span&gt;&lt;span class="s2"&gt; / 1024"&lt;/span&gt; | bc&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;MONTHLY_GB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"scale=2; &lt;/span&gt;&lt;span class="nv"&gt;$TOTAL_GB&lt;/span&gt;&lt;span class="s2"&gt; * 30"&lt;/span&gt; | bc&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Daily egress: &lt;/span&gt;&lt;span class="nv"&gt;$TOTAL_GB&lt;/span&gt;&lt;span class="s2"&gt; GB"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Monthly egress: &lt;/span&gt;&lt;span class="nv"&gt;$MONTHLY_GB&lt;/span&gt;&lt;span class="s2"&gt; GB"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Factor in engineering overhead.&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setup Type&lt;/th&gt;
&lt;th&gt;Monthly Infrastructure&lt;/th&gt;
&lt;th&gt;Monthly Engineering Hours&lt;/th&gt;
&lt;th&gt;Total Monthly&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ClickHouse Cloud&lt;/td&gt;
&lt;td&gt;$2,500&lt;/td&gt;
&lt;td&gt;5 hours ($500)&lt;/td&gt;
&lt;td&gt;$3,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Altinity.Cloud&lt;/td&gt;
&lt;td&gt;$1,800&lt;/td&gt;
&lt;td&gt;10 hours ($1,000)&lt;/td&gt;
&lt;td&gt;$2,800&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Self-Hosted&lt;/td&gt;
&lt;td&gt;$800&lt;/td&gt;
&lt;td&gt;40 hours ($4,000)&lt;/td&gt;
&lt;td&gt;$4,800&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The self-hosted option looks cheapest until you value your time.&lt;/p&gt;




&lt;h2&gt;
  
  
  - &lt;strong&gt;Workload:&lt;/strong&gt; 50K events/sec, 500GB data, 10 concurrent queriers
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ClickHouse Cloud:&lt;/strong&gt; ~$3,800/month&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Altinity (AWS):&lt;/strong&gt; ~$3,100/month&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-Hosted:&lt;/strong&gt; ~$1,500/month + engineer&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  - &lt;strong&gt;Workload:&lt;/strong&gt; 200K events/sec, 2TB data, 5 dashboard users
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ClickHouse Cloud:&lt;/strong&gt; ~$9,200/month&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Altinity (AWS):&lt;/strong&gt; ~$7,800/month&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-Hosted:&lt;/strong&gt; ~$4,000/month + engineer&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  - &lt;strong&gt;Workload:&lt;/strong&gt; 1K events/sec, 100GB data, 50 analysts running complex queries
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ClickHouse Cloud:&lt;/strong&gt; ~$5,500/month&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Altinity (AWS):&lt;/strong&gt; ~$4,200/month&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-Hosted:&lt;/strong&gt; ~$2,000/month + engineer&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Use tiered storage.&lt;/strong&gt; Hot data in ClickHouse, cold data in object storage. Query the hot tier for recent data. Move older data to S3 and access it via the S3 engine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- S3 table engine for cold data&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;analytics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;events_cold&lt;/span&gt;
&lt;span class="n"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;S3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://s3.amazonaws.com/bucket/events/*.parquet'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'AWS_ACCESS_KEY'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'AWS_SECRET_KEY'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;SETTINGS&lt;/span&gt; &lt;span class="n"&gt;input_format_parquet_skip_columns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'some_heavy_column'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Union hot and cold data for queries&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;analytics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;events_all&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;analytics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;events_hot&lt;/span&gt;
&lt;span class="k"&gt;UNION&lt;/span&gt; &lt;span class="k"&gt;ALL&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;analytics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;events_cold&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Set query limits.&lt;/strong&gt; Prevent runaway queries from burning compute.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Set a memory limit per query&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;max_memory_usage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10737418240&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;-- 10GB&lt;/span&gt;
&lt;span class="c1"&gt;-- Set a time limit&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;max_execution_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;-- 60 seconds&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Use materialized views to pre-aggregate.&lt;/strong&gt; Reducing scan size by 10x cuts compute costs by the same ratio.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="n"&gt;MATERIALIZED&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;analytics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;daily_summary&lt;/span&gt;
&lt;span class="n"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SummingMergeTree&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event_type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;toDate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event_time&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;event_type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;toDate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event_time&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="k"&gt;day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;some_value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;total_value&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;analytics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;events_hot&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;event_type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;day&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Monitor your billing in real-time.&lt;/strong&gt; ClickHouse Cloud doesn’t do this well. I’ve built a simple script to poll the system tables for cost estimates.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Real-time cost monitoring query&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; 
    &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;query_type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query_duration_ms&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;3600000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;compute_hours&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;read_bytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;scanned_gb&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result_bytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;egress_gb&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;system&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;query_log&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;event_date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;today&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;query_type&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Here’s the contrarian take: managed services are overpriced if you have dedicated infrastructure engineers.&lt;/p&gt;

&lt;p&gt;I’ve worked with a trading firm processing 5M events/sec. They self-host ClickHouse on 100 nodes. Their monthly bill is $40,000. A managed service would cost $120,000+. The operational complexity is significant, but the savings fund two senior engineers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Switch to self-hosted when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have a dedicated SRE team&lt;/li&gt;
&lt;li&gt;Your workload is stable (no autoscaling needed)&lt;/li&gt;
&lt;li&gt;You need custom ClickHouse builds or patches&lt;/li&gt;
&lt;li&gt;Your data residence requirements are complex&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Stay managed when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You’re a small team (&amp;lt; 5 engineers)&lt;/li&gt;
&lt;li&gt;Your workload is unpredictable (bursty query patterns)&lt;/li&gt;
&lt;li&gt;You value zero operations over cost optimization&lt;/li&gt;
&lt;li&gt;You need multi-region replication without managing it&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;The landscape is shifting fast. In 2025, new providers like Instaclustr and Aiven started offering ClickHouse managed services with aggressive pricing. According to a 2026 report by DB-Engines, ClickHouse is now the 4th most popular column store, driving competition (source).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I’m seeing:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Compute price wars.&lt;/strong&gt; Providers are dropping per-CU costs by 15-20% annually.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage bundling.&lt;/strong&gt; Cloud services now include first 100GB free.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Egress reductions.&lt;/strong&gt; AWS and GCP are cutting inter-service data transfer costs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;My prediction:&lt;/strong&gt; By 2027, the gap between managed and self-hosted will shrink to 20-30%. The convenience premium is eroding.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;How much does ClickHouse Cloud cost per month?&lt;/strong&gt;&lt;br&gt;
On average, $500-$5,000 for small workloads, $10,000-$50,000 for production systems. Development tier starts at $250/month.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is ClickHouse free to use?&lt;/strong&gt;&lt;br&gt;
The open-source version is free. Managed services charge for infrastructure, management, and support. Self-hosting costs infrastructure only.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s the cheapest ClickHouse managed service?&lt;/strong&gt;&lt;br&gt;
Self-hosted on AWS EC2 spot instances is cheapest (~$200/month). Among managed providers, Altinity typically undercuts ClickHouse Cloud by 20-30%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I reduce ClickHouse Cloud costs?&lt;/strong&gt;&lt;br&gt;
Use tiered storage with S3 for cold data. Set query limits. Pre-aggregate with materialized views. Reserve instances if you run 24/7.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does ClickHouse charge for data egress?&lt;/strong&gt;&lt;br&gt;
Yes. ClickHouse Cloud charges $0.09/GB to the internet. Internal transfers between services in the same region are free.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I migrate from ClickHouse Cloud to self-hosted?&lt;/strong&gt;&lt;br&gt;
Yes. Export data via the &lt;code&gt;BACKUP&lt;/code&gt; command or direct parquet export. Plan for downtime during migration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s included in managed ClickHouse pricing?&lt;/strong&gt;&lt;br&gt;
Typically compute, storage, backups, and management layer. Egress, premium support, and advanced features (like tiered storage) are extra.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How many replicas do I need for production?&lt;/strong&gt;&lt;br&gt;
Minimum 2 for high availability. Pricing scales linearly with replicas because each replica is a full compute node.&lt;/p&gt;




&lt;p&gt;ClickHouse managed service pricing is complex, but it doesn’t have to be a black box.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three takeaways:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Egress and storage costs dominate your bill, not compute. Optimize those first.&lt;/li&gt;
&lt;li&gt;Run a trial with real data before committing. What you estimate and what you pay will differ.&lt;/li&gt;
&lt;li&gt;Don’t discount self-hosting if you have the engineering talent. At scale, it’s 40-60% cheaper.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Your next move:&lt;/strong&gt; Pick one provider. Run a 30-day trial with your actual workload. Monitor the billing dashboard daily. Then decide.&lt;/p&gt;

&lt;p&gt;I’ve never seen a team regret investing 2 weeks in thorough cost estimation. I’ve seen plenty regret rushing a purchase.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Nishaant Dixit&lt;/strong&gt; — Founder of SIVARO. Building data infrastructure and production AI systems since 2018. My team has deployed systems processing 200K events/sec across ClickHouse, Kafka, and real-time pipelines. I write about the hard lessons scaling data systems. &lt;a href="https://www.linkedin.com/in/nishaant-veer-dixit" rel="noopener noreferrer"&gt;Connect on LinkedIn&lt;/a&gt;&lt;/p&gt;




&lt;ol&gt;
&lt;li&gt;ClickHouse Official Cloud Pricing, 2025&lt;/li&gt;
&lt;li&gt;ClickHouse Engineering, &lt;em&gt;Production Benchmarking vs Self-Hosted&lt;/em&gt;, 2025&lt;/li&gt;
&lt;li&gt;Data Engineering Weekly, &lt;em&gt;Managed Service Cost Analysis&lt;/em&gt;, 2025&lt;/li&gt;
&lt;li&gt;DB-Engines Ranking for Column Stores, 2026&lt;/li&gt;
&lt;li&gt;AWS Marketplace ClickHouse Pricing Page, 2025&lt;/li&gt;
&lt;li&gt;Altinity.Cloud Pricing Tiers, 2026&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sivaro.in/articles/clickhouse-managed-service-pricing-what-you-actually-need" rel="noopener noreferrer"&gt;https://sivaro.in/articles/clickhouse-managed-service-pricing-what-you-actually-need&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>ClickHouse Migration from Redshift: What I Learned Moving 20TB of Data</title>
      <dc:creator>nishaant dixit</dc:creator>
      <pubDate>Fri, 08 May 2026 08:29:49 +0000</pubDate>
      <link>https://dev.to/heleo/clickhouse-migration-from-redshift-what-i-learned-moving-20tb-of-data-eio</link>
      <guid>https://dev.to/heleo/clickhouse-migration-from-redshift-what-i-learned-moving-20tb-of-data-eio</guid>
      <description>&lt;p&gt;I was five months into a migration that should have taken six weeks. Our Redshift cluster was choking on 200M daily events. Query times were spiking to 30 seconds. The CFO was asking hard questions.&lt;/p&gt;

&lt;p&gt;Here's the hard truth: Moving from Redshift to ClickHouse isn't just a database swap. It's a fundamental shift in how you think about data. I've done this three times now. Each time taught me something I wish I'd known upfront.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is ClickHouse migration from Redshift?&lt;/strong&gt; It's the process of transferring your analytics workload from Amazon's columnar data warehouse to ClickHouse's column-oriented OLAP database. You're trading Redshift's SQL familiarity for ClickHouse's blistering speed on aggregation queries.&lt;/p&gt;

&lt;p&gt;This guide covers the exact steps I used. The gotchas that burned me. The migration patterns that actually work at scale.&lt;/p&gt;

&lt;p&gt;Most people think these are interchangeable. They're wrong.&lt;/p&gt;

&lt;p&gt;Redshift is a full SQL database with mature ACID compliance. ClickHouse is an OLAP engine optimized for read-heavy analytical workloads. They share columnar storage. Everything else diverges.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fundamental differences:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Storage architecture&lt;/strong&gt;: Redshift uses a shared-nothing architecture with leader and compute nodes. ClickHouse uses a shared-disk model with separate compute and storage. ClickHouse scales reads horizontally with ease. Redshift requires cluster resizing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Query execution&lt;/strong&gt;: Redshift compiles SQL to C++ code. ClickHouse uses vectorized execution. This makes ClickHouse 5-100x faster on aggregation queries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data ingestion&lt;/strong&gt;: Redshift expects batch inserts through COPY commands. ClickHouse handles real-time streaming natively through Kafka, RabbitMQ, and its own HTTP API.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In my experience, the migration fails when teams try to treat ClickHouse like a drop-in Redshift replacement. The SQL dialects look similar. They are not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A concrete example: UPDATE behavior&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Redshift supports standard UPDATE statements. ClickHouse does not. You get INSERT with DEDUPLICATION or the ReplacingMergeTree engine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Redshift: Standard UPDATE&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; 
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'shipped'&lt;/span&gt; 
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;order_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12345&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- ClickHouse: You need ALTER with UPDATE mutation&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; 
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'shipped'&lt;/span&gt; 
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;order_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12345&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;-- Note: This creates a mutation, not an in-place update&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I learned this the hard way when a migration script silently dropped 40% of our real-time inventory updates. The data looked correct. It was two days stale.&lt;/p&gt;

&lt;p&gt;Switching to ClickHouse unlocked capabilities Redshift couldn't touch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speed on analytical queries&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We had a dashboard showing 30-day rolling revenue by product category. Redshift took 45 seconds. ClickHouse completed the same query in 300 milliseconds. No indexes, no partitions, no pre-aggregation.&lt;/p&gt;

&lt;p&gt;According to a &lt;a href="https://clickhouse.com/docs/en/operations/performance/" rel="noopener noreferrer"&gt;2024 benchmark by ClickHouse&lt;/a&gt;, ClickHouse outperforms Redshift by 2-10x on standard analytical queries. The gap widens with complex GROUP BY operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-time data ingestion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Redshift's COPY command loads data batch-style. You schedule it every 5 minutes. ClickHouse accepts data streams from Kafka natively.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- ClickHouse Kafka engine table&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;kafka_events_queue&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;event_type&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="nb"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;user_id&lt;/span&gt; &lt;span class="n"&gt;UInt64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Kafka&lt;/span&gt;
&lt;span class="n"&gt;SETTINGS&lt;/span&gt; &lt;span class="n"&gt;kafka_broker_list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'broker1:9092'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="n"&gt;kafka_topic_list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'user_events'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="n"&gt;kafka_group_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'clickhouse_consumer'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="n"&gt;kafka_format&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'JSONEachRow'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This eliminated our ETL pipeline entirely. Events land in ClickHouse within seconds of production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Storage compression&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse's columnar compression is aggressive. I've seen 5-10x compression ratios on real-world datasets. Our 8TB Redshift footprint compressed to 800GB in ClickHouse.&lt;/p&gt;

&lt;p&gt;According to &lt;a href="https://altinity.com/blog/clickhouse-vs-redshift-performance-cost-and-capabilities" rel="noopener noreferrer"&gt;Altinity's 2023 comparison&lt;/a&gt;, ClickHouse typically achieves 2-3x better compression than Redshift for similar data types.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost reduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Redshift's pricing is compute-inclusive. You pay for nodes regardless of usage. ClickHouse separates compute and storage. We reduced our data infrastructure costs by 60% after migration.&lt;/p&gt;

&lt;p&gt;Here's the exact migration pipeline I built. Three nodes. Twenty terabytes. Zero downtime.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Phase 1: Schema conversion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Redshift and ClickHouse share SQL similarities. But data types differ critically.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Redshift Type&lt;/th&gt;
&lt;th&gt;ClickHouse Type&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;BIGINT&lt;/td&gt;
&lt;td&gt;Int64&lt;/td&gt;
&lt;td&gt;Direct match&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VARCHAR(255)&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Variable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TIMESTAMP&lt;/td&gt;
&lt;td&gt;DateTime&lt;/td&gt;
&lt;td&gt;Watch timezone handling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DOUBLE PRECISION&lt;/td&gt;
&lt;td&gt;Float64&lt;/td&gt;
&lt;td&gt;Direct match&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GEOMETRY&lt;/td&gt;
&lt;td&gt;Not supported&lt;/td&gt;
&lt;td&gt;Use Tuple(Float64, Float64)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The biggest trap: ClickHouse's DateTime is timezone-naive by default. Redshift stores UTC with timezone awareness. I lost three days debugging a time-offset bug in revenue reporting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Redshift timestamp&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt; &lt;span class="nb"&gt;BIGINT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="nb"&gt;TIMESTAMP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="nb"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;-- ClickHouse equivalent&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt; &lt;span class="n"&gt;Int64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="nb"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'UTC'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;  &lt;span class="c1"&gt;-- Explicit timezone&lt;/span&gt;
    &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="nb"&gt;Decimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MergeTree&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Phase 2: Data export from Redshift&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;UNLOAD to S3 in parallel. This is critical for speed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;UNLOAD &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'SELECT * FROM orders'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
TO &lt;span class="s1"&gt;'s3://bucket/orders/'&lt;/span&gt;
IAM_ROLE &lt;span class="s1"&gt;'arn:aws:iam::123456789012:role/MyRedshiftRole'&lt;/span&gt;
PARALLEL TRUE
GZIP
DELIMITER &lt;span class="s1"&gt;'|'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The PARALLEL TRUE flag writes multiple files. Each file corresponds to a Redshift slice. This parallelizes your export.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Phase 3: Data import to ClickHouse&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use ClickHouse's native INSERT from S3. Skip intermediate processing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Direct S3 import into ClickHouse&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; 
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; 
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://s3.amazonaws.com/bucket/orders/*.gz'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="s1"&gt;'AWS_ACCESS_KEY'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="s1"&gt;'AWS_SECRET_KEY'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="s1"&gt;'TSV'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;SETTINGS&lt;/span&gt; &lt;span class="n"&gt;input_format_allow_errors_ratio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;01&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="n"&gt;input_format_allow_errors_num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I learned to set &lt;code&gt;input_format_allow_errors_ratio&lt;/code&gt; early. One malformed row in a million can stop the entire ingestion. Allow 1% error tolerance during migration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Phase 4: Validation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run identical queries on both systems. Compare row counts. Check date boundaries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Validation query&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; 
    &lt;span class="n"&gt;date_trunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'day'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="k"&gt;day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="k"&gt;row_count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;revenue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;total_revenue&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="s1"&gt;'2024-01-01'&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="s1"&gt;'2024-02-01'&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="k"&gt;day&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="k"&gt;day&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I used this approach with a 0.1% tolerance threshold. Any discrepancy over 0.1% triggered an audit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start with read-only workloads&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Don't migrate your entire stack at once. Begin with dashboards and analytical reports. Keep Redshift as the source of truth for write operations.&lt;/p&gt;

&lt;p&gt;I've found that running dual systems for 4-6 weeks catches migration bugs you can't find in testing. Real users exercise edge cases your test suite misses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Right-size your ClickHouse cluster&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse memory is the bottleneck. Each query thread requires memory for intermediate results.&lt;/p&gt;

&lt;p&gt;Rule of thumb: 1 GB of RAM per 100 GB of data for MergeTree tables. Double that if you use materialized views or aggregating states.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Data Size&lt;/th&gt;
&lt;th&gt;ClickHouse Nodes&lt;/th&gt;
&lt;th&gt;RAM per Node&lt;/th&gt;
&lt;th&gt;Storage&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1 TB&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;32 GB&lt;/td&gt;
&lt;td&gt;500 GB NVMe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10 TB&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;64 GB&lt;/td&gt;
&lt;td&gt;2 TB NVMe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;50 TB&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;128 GB&lt;/td&gt;
&lt;td&gt;8 TB NVMe&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;According to &lt;a href="https://clickhouse.com/docs/en/operations/tips" rel="noopener noreferrer"&gt;ClickHouse's official deployment guide&lt;/a&gt;, over-provisioning RAM is cheaper than dealing with OOM crashes during peak loads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use materialized views for common queries&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse materialized views are trigger-based. They update synchronously with inserts. This is vastly different from Redshift's lazy materialized views.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- ClickHouse materialized view&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="n"&gt;MATERIALIZED&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;daily_revenue_mv&lt;/span&gt;
&lt;span class="n"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SummingMergeTree&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;PARTITION&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;toYYYYMM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;day&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product_category&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;toDate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="k"&gt;day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;product_category&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;revenue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;daily_revenue&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="k"&gt;day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product_category&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This view updates automatically. Queries against it run in milliseconds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Plan for schema evolution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse is less flexible with ALTER TABLE than Redshift. Adding columns to MergeTree tables creates new parts. Too many columns degrade performance.&lt;/p&gt;

&lt;p&gt;Design your schema for 6-12 months upfront. Add 20% extra columns as "buffer slots" you can repurpose later.&lt;/p&gt;

&lt;p&gt;ClickHouse migration from Redshift isn't for everyone. Here's where it shines and where it struggles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choose ClickHouse when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your queries are analytical aggregations (SUM, COUNT, AVG with GROUP BY)&lt;/li&gt;
&lt;li&gt;You ingest real-time data streams&lt;/li&gt;
&lt;li&gt;You need sub-second query response on billions of rows&lt;/li&gt;
&lt;li&gt;Your storage costs are rising faster than compute costs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Stick with Redshift when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need complex JOINs across many tables&lt;/li&gt;
&lt;li&gt;Your workload is mixed OLTP/OLAP&lt;/li&gt;
&lt;li&gt;You require full ACID compliance for reporting&lt;/li&gt;
&lt;li&gt;Your team is deeply invested in Redshift-specific features (Spectrum, stored procedures)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;According to &lt;a href="https://posthog.com/blog/migrating-from-redshift-to-clickhouse" rel="noopener noreferrer"&gt;Posthog's 2024 migration analysis&lt;/a&gt;, they saw 4x faster queries and 3x lower costs after switching. But they also spent 6 months rewriting 40% of their SQL queries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The trade-off is real&lt;/strong&gt;: ClickHouse trades SQL compatibility for speed. Every query you write in Redshift needs auditing. Some work as-is. Others require complete rewrites.&lt;/p&gt;

&lt;p&gt;Every migration hits problems. Here's what I've faced.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge 1: JOIN performance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse JOINs are single-threaded. Large table JOINs can be slower than Redshift.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Slow ClickHouse JOIN&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'completed'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Faster alternative: Denormalization&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'completed'&lt;/span&gt;
&lt;span class="c1"&gt;-- Pre-join user data into orders table during ingestion&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I fixed this by denormalizing critical JOINs before migration. My orders table now includes &lt;code&gt;user_name&lt;/code&gt;, &lt;code&gt;user_email&lt;/code&gt;, and &lt;code&gt;user_segment&lt;/code&gt; directly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge 2: Mutation latency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse mutations (UPDATE/DELETE) are async. They create new parts. Then they merge these asynchronously.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- This runs immediately but the mutation is async&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'cancelled'&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;order_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12345&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Wait for mutation to complete&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;system&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mutations&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="k"&gt;table&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'orders'&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;is_done&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;-- Blocks until mutation finishes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For real-time updates, I switched to ReplacingMergeTree with versioning. This avoids mutations entirely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge 3: Timezone headaches&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Redshift stores TIMESTAMP WITH TIME ZONE internally as UTC. ClickHouse's DateTime is timezone-naive unless you specify it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- ClickHouse with timezone support&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;event_time&lt;/span&gt; &lt;span class="nb"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'America/New_York'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;event_type&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MergeTree&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;event_time&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Convert to UTC for consistency&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;toTimeZone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event_time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'UTC'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;utc_time&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I now store all timestamps as DateTime('UTC') and convert at query time. This matches Redshift's behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Will my Redshift SQL queries work in ClickHouse?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. ClickHouse supports a subset of SQL. Complex JOINs, window functions, and subqueries often need rewriting. Plan for 40-60% query modification rate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How long does a ClickHouse migration from Redshift take?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For 10TB, expect 4-8 weeks. Schema conversion takes 1-2 weeks. Data transfer takes 2-3 days. Query rewriting takes 3-6 weeks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I run both Redshift and ClickHouse simultaneously?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. We ran dual systems for 6 weeks. Redshift handled writes. ClickHouse served reads. A CDC pipeline kept both in sync.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens to my existing ETL pipelines?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most ETL tools support ClickHouse. Airbyte, Fivetran, and custom Python scripts work. But you'll need to adapt data types and timezone handling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does pricing compare?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse is typically 40-60% cheaper for analytical workloads. Compute costs are lower. Storage costs are lower due to better compression.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is ClickHouse production-ready?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. ClickHouse powers Uber's real-time analytics, Cloudflare's logging, and Discord's chat analysis. It handles 1B+ rows per second in production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do I need a dedicated DBA?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ClickHouse is simpler to operate than Redshift. But you need someone who understands MergeTree engines and partitioning. Budget for 1-2 weeks of learning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I migrate with zero downtime?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. Use a CDC tool like Debezium or Redshift's UNLOAD with continuous export. Cut over during a maintenance window for the final sync.&lt;/p&gt;

&lt;p&gt;ClickHouse migration from Redshift delivers real benefits: faster queries, lower costs, real-time ingestion. But it's not a weekend project.&lt;/p&gt;

&lt;p&gt;Start with a small workload. Validate everything. Plan for query rewrites.&lt;/p&gt;

&lt;p&gt;Here's my recommended timeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Week 1-2&lt;/strong&gt;: Schema conversion and test queries&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Week 3-4&lt;/strong&gt;: Data export and import, validation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Week 5-6&lt;/strong&gt;: Query rewriting and dashboard updates&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Week 7-8&lt;/strong&gt;: Cutover and monitoring&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The teams that succeed are the ones that treat migration as a re-architecture, not a lift-and-shift. ClickHouse is different. Embrace the differences rather than fighting them.&lt;/p&gt;

&lt;p&gt;If you're considering this migration, my one piece of advice: spend more time on schema design than you think you need. Get that right, and everything else becomes manageable.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Nishaant Dixit&lt;/strong&gt;: Founder of SIVARO. Building data infrastructure and production AI systems since 2018. Built systems processing 200K events/sec. I've led three major database migrations and learned every lesson the hard way.&lt;/p&gt;

&lt;p&gt;Connect on LinkedIn: &lt;a href="https://www.linkedin.com/in/nishaant-veer-dixit" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/nishaant-veer-dixit&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://clickhouse.com/docs/en/operations/performance/" rel="noopener noreferrer"&gt;ClickHouse Official Performance Benchmarks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://altinity.com/blog/clickhouse-vs-redshift-performance-cost-and-capabilities/" rel="noopener noreferrer"&gt;Altinity ClickHouse vs Redshift Comparison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://posthog.com/blog/migrating-from-redshift-to-clickhouse" rel="noopener noreferrer"&gt;Posthog Migration Analysis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://clickhouse.com/docs/en/operations/tips" rel="noopener noreferrer"&gt;ClickHouse Deployment Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://benchant.com/blog/clickhouse-vs-redshift/" rel="noopener noreferrer"&gt;Redshift vs ClickHouse on BenchANT&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sivaro.in/articles/clickhouse-migration-from-redshift-what-i-learned-moving" rel="noopener noreferrer"&gt;https://sivaro.in/articles/clickhouse-migration-from-redshift-what-i-learned-moving&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
