CandyWrite
HomeBlogs
CandyWrite

An independent publishing platform for essays on technology, design, and creative work. Free to read, free to write.

Explore

  • Home
  • All Blogs
  • Topics
  • Tags
  • Writers
  • Most Read

About

  • About Us
  • Help & Support
  • Contact

Contact

  • hello@candywrite.com
  • support@candywrite.com

Get Updates

© 2026 CandyWrite. All rights reserved.

AboutHelpContactPrivacy PolicyTerms of Service
  1. Home
  2. Blogs
  3. AI & Engineering
  4. Streaming, Queues, and the Death of the Request-Response Mindset
Streaming, Queues, and the Death of the Request-Response Mindset
AI & Engineering

Streaming, Queues, and the Death of the Request-Response Mindset

When work takes ninety seconds, HTTP request-response stops being an adequate model. The patterns that fix it are borrowed from job systems, not from web frameworks.

M

Written by

Muhammad Umer
  • 29 August 2026
  • 3 min read
  • 0 views
0

Web engineering spent twenty years assuming that a request finishes. Requests that take more than a few seconds were pathological, something to be optimised away. Then a category of features arrived where the work genuinely takes a minute or more, and the old shape started failing in familiar ways: gateway timeouts, duplicate work on retry, lost results when a user navigates away.

Separate accepting work from doing it

The correct shape is the one job systems have used forever. The request validates input, writes a task record, and returns an identifier immediately. A worker picks up the task and does the slow part. The client subscribes to progress. Nothing about this is novel; what is new is how many product features now need it.

Once you make this split, several problems solve themselves. Timeouts stop mattering. A user closing the tab no longer cancels the work. Retries become safe because the task row is the source of truth, and a second attempt updates the same record instead of starting a parallel one.

Choose your transport for the failure you can tolerate

  • Polling is the least elegant and the most robust. It survives proxies, mobile networks, and sleeping devices. Start here.
  • Server-sent events are ideal for one-directional token streams and degrade to reconnection cleanly.
  • WebSockets earn their complexity only when you need genuinely bidirectional, low-latency traffic.

A pattern that works well is streaming for the live experience plus a durable task record as the fallback, so a dropped connection means the user reloads and sees the finished result rather than losing it.

Idempotency is not optional

Any long operation will be retried, by your infrastructure, by an impatient user, or by a mobile client that lost its connection at second eighty-nine. Give every submission a client-generated key, store it, and make a repeat submission return the original task instead of starting a new one. Without this, the visible symptom is duplicate charges, duplicate emails, and duplicate records, and the invisible symptom is a bill you cannot explain.

Show the pipeline, not a spinner

An indeterminate spinner for ninety seconds reads as broken. A list of steps where each completes in sequence reads as work being done, even when the total time is identical. Name the steps in the user's language: reading the document, finding relevant sections, drafting, checking. Perceived speed is mostly a legibility problem.

Users forgive slow far more readily than they forgive uncertain. Progress that can be read is progress that can be waited on.

What to instrument

Track queue depth, time to first byte of useful output, total task duration at the ninety-fifth percentile, and abandonment rate by step. That last one is the product metric hiding inside an infrastructure dashboard: it tells you exactly where the wait became intolerable.

ArchitectureWeb Development

Enjoyed this article?

Show some love or pass it on to someone who'd like it.

About the author

M

Muhammad Umer

@umarrafique

View profile

I'm Muhammad Umer. I write about technology, business, and the forces shaping our world. I started writing because I had questions.

WebsiteTwitterGitHub

Join the conversation

Discussion0

Live updates

Join the conversation. Sign in to leave a response or reply to comments.

Sign InCreate Account
No responses yet. Be the first to share your thoughts!
On this page

Keep reading

Related articles

More essays on the same topics, picked for you.

View all blogs
AI & Engineering

6 Sept 2026•4 min read

The React Compiler Ended the Memoization Debate. Now What?

Automatic memoization removed a whole category of busywork from React codebases. It also exposed which of our performance habits were cargo cult all along.

MMuhammad Umer
AI & Engineering

3 Sept 2026•3 min read

Small Models, Big Systems: The Case for Routing Instead of Scaling

Sending every request to your largest model is the most expensive default in modern software. A routing layer usually beats an upgrade, on both cost and latency.

MMuhammad Umer
AI & Engineering

5 Sept 2026•4 min read

Retrieval Is a Data Problem, Not a Vector Problem

Most RAG systems fail long before the embedding model is at fault. The fixes live in chunking, freshness, and permissions, not in a better index.

MMuhammad Umer
AI & Engineering

8 Sept 2026•5 min read

Agents Are Not Chatbots: What Changes When Software Takes Actions

The jump from answering questions to operating software breaks most of the assumptions we built our AI features on. Here is what actually needs to change in your stack.

MMuhammad Umer

Enjoyed this perspective?

Join 12,000+ readers getting our Saturday morning editorial dispatch with our top essays and reading recommendations.