<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>AI Engineering &amp; Backend Blog on Faizan Nadeem | Full-Stack AI Engineer</title><link>https://faaaizan.space/blogs/</link><description>Recent content in AI Engineering &amp; Backend Blog on Faizan Nadeem | Full-Stack AI Engineer</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 04 Dec 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://faaaizan.space/blogs/index.xml" rel="self" type="application/rss+xml"/><item><title>Fan-Out Queues for Push Notifications During Traffic Spikes</title><link>https://faaaizan.space/blogs/push-notification-fan-out/</link><pubDate>Fri, 04 Dec 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/push-notification-fan-out/</guid><description>&lt;p&gt;A fan-out queue is how one &amp;ldquo;Flash sale starts now&amp;rdquo; push reaches hundreds of thousands of phones without your sender, your database or your push provider falling over. You enqueue one campaign, a fan-out step splits the audience into batches, and a pool of workers sends those batches at a controlled rate. When traffic spikes 10x, the queue gets longer; nothing else has to get faster.&lt;/p&gt;
&lt;p&gt;This post shows how fan-out queues work for push notifications during a spike, with a simulation I wrote and ran so you can see what each piece changes.&lt;/p&gt;</description></item><item><title>How to Choose a Celery Broker: Redis vs RabbitMQ vs SQS</title><link>https://faaaizan.space/blogs/celery-broker-redis-vs-rabbitmq-vs-sqs/</link><pubDate>Fri, 04 Dec 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/celery-broker-redis-vs-rabbitmq-vs-sqs/</guid><description>&lt;p&gt;Choosing a Celery broker comes down to three questions: what you already run, how long your tasks wait before they run, and whether you need to see inside the queue. Celery supports RabbitMQ, Redis and Amazon SQS as stable brokers, and each one fails in a different way when you pick it for the wrong job.&lt;/p&gt;
&lt;p&gt;My short answer: RabbitMQ is the safe default, Redis is fine for short tasks once you tune two settings, and SQS is the right call on AWS when you want no broker servers at all and can live without monitoring.&lt;/p&gt;</description></item><item><title>Django4Shell (CVE-2026-124827): GeoDjango Fix and Checklist</title><link>https://faaaizan.space/blogs/django4shell-cve-2026-124827/</link><pubDate>Thu, 03 Dec 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/django4shell-cve-2026-124827/</guid><description>&lt;p&gt;Django4Shell is the name the researcher gave CVE-2026-124827, a GeoDjango bug that Django patched on December 2, 2026. If your project stores rasters in a PostGIS &lt;code&gt;RasterField&lt;/code&gt; and that field is writable from the admin, a &lt;code&gt;ModelForm&lt;/code&gt; or an API serializer, an attacker can make GDAL write a file to a path of their choosing on your server. Depending on the GDAL driver, that can become remote code execution.&lt;/p&gt;
&lt;p&gt;The fix is a normal upgrade: Django 6.1.4, 6.0.11 or 5.2.20. Below is what the bug is, how to tell in two minutes whether you are exposed, and what to do if you cannot deploy today.&lt;/p&gt;</description></item><item><title>AI Tender Management: How It Works, From a Real Build</title><link>https://faaaizan.space/blogs/ai-tender-management/</link><pubDate>Wed, 02 Dec 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/ai-tender-management/</guid><description>&lt;p&gt;AI tender management means using large language models and retrieval to do the slow parts of bidding: reading a 50-page tender, deciding whether it is worth answering, and drafting a response from your own past work. Done well, it turns days of proposal writing into minutes of review. Done badly, it produces confident proposals for tenders you were never eligible for.&lt;/p&gt;
&lt;p&gt;I was the backend developer on &lt;a href="https://faaaizan.space/projects/ai-rfp-manager-ai-powered-tender-management/"&gt;AI RFP Manager&lt;/a&gt;, a tender management platform that parses RFPs, scores Go/No-Go decisions and drafts grounded proposals. This post is the architecture we shipped and the problems that shaped it.&lt;/p&gt;</description></item><item><title>FastAPI max_concurrency in Depends(): Avoid Silent Deadlocks</title><link>https://faaaizan.space/blogs/fastapi-concurrency-limits-multi-resource-dependencies/</link><pubDate>Sun, 15 Nov 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/fastapi-concurrency-limits-multi-resource-dependencies/</guid><description>&lt;p&gt;When building high-throughput APIs in FastAPI, database connection exhaustion is one of the most common production failure modes. Under a sudden traffic surge, incoming asynchronous requests can spawn hundreds of database sessions simultaneously, quickly overwhelming connection pools like PostgreSQL or PgBouncer.&lt;/p&gt;
&lt;p&gt;To address this, modern versions of FastAPI introduced a first-class concurrency limiter directly into &lt;code&gt;Depends()&lt;/code&gt;: the &lt;code&gt;max_concurrency&lt;/code&gt; parameter. On the surface, it seems as simple as adding &lt;code&gt;Depends(get_session, max_concurrency=10)&lt;/code&gt; to protect your database.&lt;/p&gt;</description></item><item><title>5 Things That Break When an AI Demo Goes to Production</title><link>https://faaaizan.space/blogs/5-things-that-break-ai-demo-production/</link><pubDate>Mon, 19 Oct 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/5-things-that-break-ai-demo-production/</guid><description>Why AI demos fail in production: explore 5 critical failure modes in latency, noisy inputs, cost, hallucinations, and evals, plus practical engineering fixes.</description></item><item><title>AI Agent vs Chatbot: The One-Line Test for Your Stack</title><link>https://faaaizan.space/blogs/chatbot-vs-agent/</link><pubDate>Mon, 19 Oct 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/chatbot-vs-agent/</guid><description>Chatbot vs agent: learn the one-line test to choose the right AI architecture, compare latency, costs, and failure modes, and avoid unnecessary complexity.</description></item><item><title>What an AI Engineer Actually Does All Day: 5 Workflows</title><link>https://faaaizan.space/blogs/what-ai-engineers-do-all-day/</link><pubDate>Mon, 19 Oct 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/what-ai-engineers-do-all-day/</guid><description>An honest look at what an AI engineer does all day: data cleanup, evals, latency and cost tuning, guardrails, and talking to users to ship reliable AI.</description></item><item><title>REA (Reverse Engineer Anything): Codex Setup &amp; Use Cases</title><link>https://faaaizan.space/blogs/rea-reverse-engineer-anything/</link><pubDate>Sat, 17 Oct 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/rea-reverse-engineer-anything/</guid><description>&lt;p&gt;Reverse Engineer Anything (REA) connects an AI coding agent to tools that inspect compiled software, packaged applications, and browser behavior. It exposes those tools through the Model Context Protocol (MCP) and a command-line interface. The useful output is an explanation supported by evidence: code locations, relationships, observations, and explicit gaps. It does not promise to recover a complete original source repository. &lt;a href="https://github.com/morluto/rea"&gt;Official project&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I find the most useful question to ask about REA is specific: can it explain how one feature works well enough to inform an implementation or diagnose a change? This guide covers that workflow, the setup decisions, and how to read the results without mistaking a plausible explanation for a verified one.&lt;/p&gt;</description></item><item><title>Tracing a Python API with OpenTelemetry</title><link>https://faaaizan.space/blogs/opentelemetry-fastapi-tracing/</link><pubDate>Wed, 14 Oct 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/opentelemetry-fastapi-tracing/</guid><description>&lt;p&gt;The report always sounds the same: &amp;ldquo;the app is slow sometimes.&amp;rdquo; Not on every request, not for every user, and not reproducible on demand, which means &lt;code&gt;print&lt;/code&gt; statements and a debugger attached to your local machine are useless, because the slow request already happened on a production replica you weren&amp;rsquo;t watching, and by the time you&amp;rsquo;re looking, the moment is gone. Logs help a little, if the request happened to touch a code path that logs something, but logs from a FastAPI handler, a Celery worker, and a database connection pool are three separate streams with no shared thread tying them back to the one request that was slow.&lt;/p&gt;</description></item><item><title>API Rate Limiting: Token Bucket, Sliding Window, and Redis</title><link>https://faaaizan.space/blogs/api-rate-limiting-algorithms/</link><pubDate>Mon, 12 Oct 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/api-rate-limiting-algorithms/</guid><description>&lt;p&gt;Most rate limiters in production aren&amp;rsquo;t wrong because someone picked the wrong algorithm: they&amp;rsquo;re wrong because someone picked an algorithm that only works correctly on a single process, then deployed it across four replicas behind a load balancer. Each replica happily counts requests against its own in-memory dictionary, a client hammering the API gets routed round-robin across all four, and the &amp;ldquo;limit&amp;rdquo; that was supposed to cap them at 100 requests per minute quietly becomes 400. Nobody notices until the bill from a downstream API comes in, or an abuse pattern gets four times more room to operate than the limit was designed to allow.&lt;/p&gt;</description></item><item><title>Small, Fast, Reproducible Python Docker Images</title><link>https://faaaizan.space/blogs/python-docker-multi-stage-build/</link><pubDate>Sat, 10 Oct 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/python-docker-multi-stage-build/</guid><description>&lt;p&gt;Most Python Docker images are bad in the same three ways at once: they&amp;rsquo;re huge, they rebuild from scratch on every code change because the dependency layer keeps invalidating, and they ship a full C compiler toolchain into production because nobody separated &amp;ldquo;what it takes to build this&amp;rdquo; from &amp;ldquo;what it takes to run this.&amp;rdquo; Ask why, and the answer is usually a single-stage &lt;code&gt;FROM python:3.12&lt;/code&gt; Dockerfile that &lt;code&gt;pip install&lt;/code&gt;s requirements and copies the app in one undifferentiated block: a pattern that was fine for a weekend project and never got revisited once the image hit production.&lt;/p&gt;</description></item><item><title>Structured Outputs from LLMs That Don't Break in Production</title><link>https://faaaizan.space/blogs/llm-structured-outputs/</link><pubDate>Thu, 08 Oct 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/llm-structured-outputs/</guid><description>&lt;p&gt;The demo works every time: ask the model to return JSON matching a schema, &lt;code&gt;json.loads()&lt;/code&gt; the response, move on. Then it ships, and three weeks in, someone finds a stack trace where the model wrapped its JSON in a markdown code fence, or added a friendly &amp;ldquo;Here&amp;rsquo;s the extracted data:&amp;rdquo; sentence before the actual object, or, worse, returned syntactically valid JSON that&amp;rsquo;s missing a field your downstream code assumed would always be there. None of this is the model being unreliable in some mysterious way. It&amp;rsquo;s the predictable result of treating &amp;ldquo;ask nicely for JSON&amp;rdquo; as equivalent to &amp;ldquo;get a validated JSON object,&amp;rdquo; when those are two different levels of guarantee that happen to look the same in a happy-path demo.&lt;/p&gt;</description></item><item><title>Cutting LLM Costs Without Shipping a Worse Agent</title><link>https://faaaizan.space/blogs/llm-cost-optimization/</link><pubDate>Wed, 07 Oct 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/llm-cost-optimization/</guid><description>&lt;p&gt;The instinctive move when an LLM bill gets uncomfortable is to swap the model for a cheaper one and call it done. Sometimes that&amp;rsquo;s genuinely fine. Often it isn&amp;rsquo;t, and the way it isn&amp;rsquo;t is insidious: the agent still answers, the demo still looks fine, and three weeks later someone notices the classification accuracy quietly dropped four points, or the agent started missing an edge case it used to handle. Nobody connects that regression to the model swap because nothing crashed: it just got worse in a way that doesn&amp;rsquo;t show up unless you&amp;rsquo;re specifically measuring for it.&lt;/p&gt;</description></item><item><title>Building an MCP Server in Python</title><link>https://faaaizan.space/blogs/build-mcp-server-python/</link><pubDate>Mon, 05 Oct 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/build-mcp-server-python/</guid><description>&lt;p&gt;Most MCP tutorials show you a &amp;ldquo;hello world&amp;rdquo; tool (one function, two arguments, a print statement) and stop right where the actual decisions start. A server with one tool doesn&amp;rsquo;t need a design; it needs a decorator. The real work begins once you have more than one thing to expose and have to decide what a &amp;ldquo;tool&amp;rdquo; is versus what should really be a &amp;ldquo;resource,&amp;rdquo; whether an LLM client should be trusted to call anything in your server unauthenticated, and how much of your internal API surface you&amp;rsquo;re comfortable handing to a model that decides for itself what to call and when.&lt;/p&gt;</description></item><item><title>Human-in-the-Loop Agents with LangGraph</title><link>https://faaaizan.space/blogs/langgraph-human-in-the-loop/</link><pubDate>Sat, 03 Oct 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/langgraph-human-in-the-loop/</guid><description>&lt;p&gt;The pitch for autonomous agents is always &amp;ldquo;it handles the whole task end to end.&amp;rdquo; The reality of shipping one is that almost nobody actually wants that for anything consequential: sending an email to a customer, deleting a database row, approving a refund. What they want is an agent that does the work and stops right before the irreversible part, waits for a person to look at it, and then finishes. That&amp;rsquo;s a completely different engineering problem than &amp;ldquo;call the model in a loop,&amp;rdquo; because now your agent has to survive being paused for an unknown length of time: seconds if someone&amp;rsquo;s watching a dashboard, days if the approver is on vacation.&lt;/p&gt;</description></item><item><title>LangChain vs LangGraph: When You Actually Need a Graph</title><link>https://faaaizan.space/blogs/langchain-vs-langgraph/</link><pubDate>Thu, 01 Oct 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/langchain-vs-langgraph/</guid><description>&lt;p&gt;Ask a team why they moved from LangChain to LangGraph and you&amp;rsquo;ll usually get a shrug and &amp;ldquo;the agent kept doing weird stuff.&amp;rdquo; That answer is more accurate than it sounds, but it hides the actual mechanism. A &lt;code&gt;AgentExecutor&lt;/code&gt; chain is a loop wearing a trench coat: it looks like it&amp;rsquo;s making decisions, but underneath it&amp;rsquo;s a fixed while-loop that calls a model, checks for a tool call, runs the tool, and repeats until the model stops asking for tools. There&amp;rsquo;s no way to pause it, no way to branch it, and no way to make it remember anything past what fits in the prompt on the next iteration.&lt;/p&gt;</description></item><item><title>Multi-Tenant RAG: Metadata Filtering Without Leaking Data</title><link>https://faaaizan.space/blogs/multi-tenant-rag-metadata-filtering/</link><pubDate>Wed, 30 Sep 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/multi-tenant-rag-metadata-filtering/</guid><description>&lt;p&gt;A multi-tenant RAG system has a failure mode that single-tenant systems don&amp;rsquo;t: it can produce an answer that&amp;rsquo;s fluent, well-cited, and completely correct-looking, while quietly containing another customer&amp;rsquo;s data. This isn&amp;rsquo;t a hypothetical edge case: it&amp;rsquo;s the direct, predictable consequence of a very common shortcut, where tenant scoping is applied as a filter on search &lt;em&gt;results&lt;/em&gt; rather than as a hard constraint on the search itself. Vector similarity search doesn&amp;rsquo;t know what a tenant is; if you don&amp;rsquo;t tell it, at the index level, exactly what a given query is and isn&amp;rsquo;t allowed to see, it will happily return the most similar vector in the entire index, whoever it belongs to.&lt;/p&gt;</description></item><item><title>Why Your RAG Retrieves the Wrong Chunks</title><link>https://faaaizan.space/blogs/rag-retrieving-wrong-chunks/</link><pubDate>Mon, 28 Sep 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/rag-retrieving-wrong-chunks/</guid><description>&lt;p&gt;&amp;ldquo;The model is hallucinating&amp;rdquo; is the default diagnosis when a RAG system gives a wrong answer, and it&amp;rsquo;s usually the wrong one. Hallucination, the model confidently making something up, is a generation failure. But the far more common failure in a production RAG pipeline happens a step earlier: retrieval hands the model the wrong context, or incomplete context, and the model is doing exactly what it&amp;rsquo;s supposed to do with what it was given. It&amp;rsquo;s not lying; it&amp;rsquo;s answering faithfully from bad source material.&lt;/p&gt;</description></item><item><title>Evaluating a RAG Pipeline: Recall@k, MRR, Faithfulness</title><link>https://faaaizan.space/blogs/rag-evaluation-metrics/</link><pubDate>Sat, 26 Sep 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/rag-evaluation-metrics/</guid><description>&lt;p&gt;Most teams &amp;ldquo;evaluate&amp;rdquo; their RAG pipeline by asking it a handful of questions, reading the answers, and deciding whether it feels right. That works exactly until it doesn&amp;rsquo;t: until a chunking change, an embedding model swap, or a prompt tweak silently makes retrieval worse while the two or three questions everyone always tests still happen to come back fine. Without a real eval set, every change to the pipeline is a bet you can&amp;rsquo;t actually measure, which means regressions ship quietly and improvements can&amp;rsquo;t be proven, only asserted.&lt;/p&gt;</description></item><item><title>Reranking in RAG: When It's Worth the Latency</title><link>https://faaaizan.space/blogs/rag-reranking-latency/</link><pubDate>Fri, 25 Sep 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/rag-reranking-latency/</guid><description>&lt;p&gt;&amp;ldquo;Add a reranker&amp;rdquo; has become the default answer to &amp;ldquo;our RAG answers aren&amp;rsquo;t great,&amp;rdquo; in roughly the same way &amp;ldquo;add an index&amp;rdquo; is the default answer to &amp;ldquo;our query is slow&amp;rdquo;: sometimes exactly right, sometimes solving a problem you don&amp;rsquo;t have while adding latency you&amp;rsquo;ll regret. A reranker doesn&amp;rsquo;t retrieve anything; it re-scores candidates your first-stage retrieval already found, using a model that&amp;rsquo;s slower but more precise than the embedding similarity that ranked them initially. If your first-stage retrieval isn&amp;rsquo;t finding the right chunk &lt;em&gt;at all&lt;/em&gt;, reranking has nothing correct to promote, and you&amp;rsquo;ve added a few hundred milliseconds for no measurable improvement.&lt;/p&gt;</description></item><item><title>Hybrid Search: Combining BM25 and Vectors in Postgres</title><link>https://faaaizan.space/blogs/hybrid-search-bm25-vectors-postgres/</link><pubDate>Thu, 24 Sep 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/hybrid-search-bm25-vectors-postgres/</guid><description>&lt;p&gt;The pitch for vector search is that it understands meaning, not just keywords: ask about &amp;ldquo;canceling a subscription&amp;rdquo; and it&amp;rsquo;ll find the passage about &amp;ldquo;ending your plan&amp;rdquo; even though the words don&amp;rsquo;t match. That&amp;rsquo;s true, and it&amp;rsquo;s also the reason vector-only retrieval quietly fails on the queries that matter most in practice: the ones with a specific error code, a product SKU, a person&amp;rsquo;s name, or a config key. Embeddings are good at synonymy and bad at exactness, because the whole point of an embedding is to compress specific tokens into a fuzzy semantic neighborhood, which is precisely the property that makes &lt;code&gt;ERR_429_RATE_LIMIT&lt;/code&gt; look almost the same as &lt;code&gt;ERR_500_INTERNAL&lt;/code&gt; to a dense retriever.&lt;/p&gt;</description></item><item><title>Jev by TypeSafe: Typed AI Decisions for Backends</title><link>https://faaaizan.space/blogs/jev-typesafe-system-one-model/</link><pubDate>Sat, 19 Sep 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/jev-typesafe-system-one-model/</guid><description>&lt;p&gt;Most of the LLM calls in a production backend aren&amp;rsquo;t asking for prose. They&amp;rsquo;re asking for a decision: which queue does this ticket go to, should this escalate, is this retrieved chunk relevant, which tool runs next. We still send those questions to a model built to generate text, ask it for JSON, parse the JSON, validate the schema, and retry when it comes back malformed. The generation layer is the part we never wanted.&lt;/p&gt;</description></item><item><title>Chunking Strategies for RAG, Benchmarked on Real Documents</title><link>https://faaaizan.space/blogs/rag-chunking-strategies/</link><pubDate>Fri, 18 Sep 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/rag-chunking-strategies/</guid><description>&lt;p&gt;Most RAG postmortems start in the wrong place. Someone swaps the embedding model, adds a reranker, tunes the prompt, and the retrieval quality barely moves, because the actual damage happened earlier, at the chunking step, before any of those components ever saw the text. Chunking is usually the first thing implemented and the last thing revisited, which is backwards: it&amp;rsquo;s the one decision that determines what&amp;rsquo;s even possible to retrieve. If a chunk boundary splits a table from its caption, or a definition from the sentence that uses it, no embedding model and no reranker can put it back together at query time.&lt;/p&gt;</description></item><item><title>Celery + Redis Gotchas Nobody Warns You About</title><link>https://faaaizan.space/blogs/celery-redis-gotchas/</link><pubDate>Sun, 13 Sep 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/celery-redis-gotchas/</guid><description>&lt;p&gt;Redis is the default broker for most new Celery projects, and for good reason: it&amp;rsquo;s already in the stack for caching, it&amp;rsquo;s fast, and getting a worker running against it takes about four lines of config. What that easy setup hides is that Redis was never designed as a message broker in the way RabbitMQ was. Celery&amp;rsquo;s Redis transport is a compatibility layer built on top of Redis&amp;rsquo;s general-purpose data structures, and several of its behaviors, particularly around delivery guarantees, are emulated approximations of what a real AMQP broker does natively, not first-class features of Redis itself.&lt;/p&gt;</description></item><item><title>Celery Retry with Exponential Backoff + Dead-Letter Queue</title><link>https://faaaizan.space/blogs/celery-retries-backoff-dead-letter-queue/</link><pubDate>Sat, 12 Sep 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/celery-retries-backoff-dead-letter-queue/</guid><description>&lt;p&gt;The default retry behavior most teams ship with Celery is &lt;code&gt;max_retries=3&lt;/code&gt; and nothing else: no backoff, no jitter, no distinction between &amp;ldquo;the downstream API is down for ten seconds&amp;rdquo; and &amp;ldquo;this task will never succeed no matter how many times you run it.&amp;rdquo; Then a dependency has a rough afternoon, every task hitting it fails, every one of those retries fires again within the same second, and the retry storm finishes the job the original outage started. The retries didn&amp;rsquo;t help. They amplified the problem into the thing that actually caused the incident.&lt;/p&gt;</description></item><item><title>Celery Idempotent Tasks: Stop Tasks Running Twice</title><link>https://faaaizan.space/blogs/celery-idempotent-tasks/</link><pubDate>Wed, 09 Sep 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/celery-idempotent-tasks/</guid><description>&lt;p&gt;The support ticket usually reads the same way: &amp;ldquo;customer says they were charged twice for one order.&amp;rdquo; Someone pulls the logs, finds a single API call, a single &lt;code&gt;charge_customer.delay(order_id)&lt;/code&gt;, and then finds the task ran twice anyway, twelve seconds apart, on two different workers. Nobody wrote a bug that duplicated the call. The system worked exactly as designed. That&amp;rsquo;s the part that trips people up: Celery task running twice isn&amp;rsquo;t a malfunction, it&amp;rsquo;s the documented, intended behavior of at-least-once delivery, and it will happen to every Celery deployment that runs long enough.&lt;/p&gt;</description></item><item><title>Why Your AI Agent Needs a Kill Switch</title><link>https://faaaizan.space/blogs/ai-agent-kill-switch/</link><pubDate>Wed, 09 Sep 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/ai-agent-kill-switch/</guid><description>&lt;p&gt;Google Trends spiked this week for &amp;ldquo;rogue AI agents,&amp;rdquo; &amp;ldquo;agent executing unowned code,&amp;rdquo; and &amp;ldquo;agent contacting outside researchers&amp;rdquo;, and none of that is paranoia. It&amp;rsquo;s the search volume of teams who gave an autonomous agent real tool access, shipped it, and only then found out what &amp;ldquo;autonomous&amp;rdquo; means once nothing is watching.&lt;/p&gt;
&lt;p&gt;The pattern repeats because the failure isn&amp;rsquo;t the model. It&amp;rsquo;s the backend around it. An agent gets a database client, a shell, or an email API &amp;ldquo;to move fast,&amp;rdquo; running under the same service account as everything else, with no record of which call did what and no way to stop it mid-task. The agent isn&amp;rsquo;t malicious: it&amp;rsquo;s doing exactly what an unconstrained LLM does: pursuing a goal with whatever tools it can reach.&lt;/p&gt;</description></item><item><title>Celery vs Dramatiq vs RQ vs arq: Best Python Task Queue 2026</title><link>https://faaaizan.space/blogs/python-task-queue-comparison/</link><pubDate>Tue, 08 Sep 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/python-task-queue-comparison/</guid><description>&lt;p&gt;Most teams don&amp;rsquo;t choose a Python task queue: they inherit one. Someone bootstrapped the project three years ago, Celery was the obvious name, and now every &amp;ldquo;should we background this?&amp;rdquo; decision defaults to &lt;code&gt;@app.task&lt;/code&gt; without anyone actually weighing the alternatives. That&amp;rsquo;s not necessarily wrong, but it&amp;rsquo;s not a decision either: it&amp;rsquo;s momentum. And momentum is a bad reason to run a message broker, a result backend, and a supervisor process for a job that RQ could handle with a fraction of the moving parts.&lt;/p&gt;</description></item><item><title>Zero-Downtime Postgres Migrations</title><link>https://faaaizan.space/blogs/zero-downtime-postgres-migrations/</link><pubDate>Mon, 07 Sep 2026 00:00:00 +0000</pubDate><guid>https://faaaizan.space/blogs/zero-downtime-postgres-migrations/</guid><description>&lt;p&gt;The migration that takes down production is almost never the one anyone was worried about. It&amp;rsquo;s rarely a &lt;code&gt;DROP TABLE&lt;/code&gt;: everyone reviews those carefully. It&amp;rsquo;s the &amp;ldquo;safe-looking&amp;rdquo; one: adding a &lt;code&gt;NOT NULL&lt;/code&gt; column with a default, or building an index on a busy table during business hours, run by someone who reasonably assumed that if the migration tool generated it automatically, it must be safe to run.&lt;/p&gt;
&lt;p&gt;The uncomfortable truth is that &amp;ldquo;safe&amp;rdquo; in a migration tool&amp;rsquo;s eyes usually means &amp;ldquo;syntactically correct,&amp;rdquo; not &amp;ldquo;won&amp;rsquo;t block the table.&amp;rdquo; Postgres&amp;rsquo;s DDL operations acquire real locks, and several of the most common schema changes acquire a lock, &lt;code&gt;ACCESS EXCLUSIVE&lt;/code&gt;, that blocks every read and write against the table for however long the operation takes. On a small table that&amp;rsquo;s milliseconds, invisible. On a table with tens of millions of rows and constant traffic, that&amp;rsquo;s a multi-minute production outage caused by a migration that looked like a one-line diff.&lt;/p&gt;</description></item></channel></rss>