One Timestamp, a 17x Input Bill: How LLM Prompt Caching Breaks Without an Error
The cache matches the prompt only up to the first byte that changes.

Kafka · WebSockets (10k+ connections) · ClickHouse · Multi-tenant IoT / NOC SaaS · LLM integration · AWS · Grafana/Prometheus · ~50% P99 latency reduction
AWS SQS · WebSockets · Firebase · 1M+ daily notifications · 900ms → 40ms query optimization
NLU engines · Node.js EventEmitter · Redis caching · 40% fewer redundant calls
The cache matches the prompt only up to the first byte that changes.
The model did not get cheaper. It skipped work it did one minute earlier.
A good map of six patterns, with some numbers that lost their conditions on the way.
The JSON was valid and the ID was real, but it pointed at the wrong product.
Each agent's rule is correct; together they wait for each other forever.
Follow one row through twelve steps, from INSERT to a byte that survives a power cut.
A timeout is not a failure, and one header is not enough to stop a double charge.
For 15 years one consumer owned each partition. Share groups change that.
Serverless is not Lambda. It is the seams between services, and every seam is at-least-once.
Not a 'what is Lambda' post: what actually happens between an invoke and your handler.
The code was inside a transaction, and it still sold three tickets when only one was left.
Page 1 loads in 8 ms. Page 5,000 takes four seconds, and the index is not the problem.
A data structure that is wrong on purpose, and saves your disk because of it.
In software the outliers are not rare. They are the story.
When a service buckles under load, a bigger queue is the most natural wrong answer.
You never wanted time. You wanted order.
An election does not pick the best node. It gets every node to agree on the same one.
"I can't reach it" is not the same as "it's dead".
The paper that named the patterns every large system already uses.
Reading your own writes is easy to define and hard to build without melting the primary.
Every process will be told to stop. The question is whether it gets a warning it can act on.
When you press Enter in Slack, the message does not use the WebSocket that is already open.
Inserts fail with 'Duplicate entry 2147483647', and nobody inserted a duplicate.
"Our queue guarantees exactly-once" is almost always false once a flow crosses a boundary.
Three different mechanisms share one name, and production needs more than one of them.
Caching is not 'add Redis'. It is a stack of layers, each with its own failure modes.
A key with TTL zero can still use memory. Here is why.
Why RocksDB, Cassandra and ClickHouse write so fast, and what they pay for it later.
"Let the database handle it" works until the write rate grows a hundred times.
A hash ring spreads keys evenly on paper. Production traffic is not even.
Your primary key decides how every insert lands in the index.
Two kinds of load balancer, and the difference is what each one can see.
Ten thousand connections and ten million are different problems, not the same one scaled.
Your p99 explodes while the autoscaler is still deciding what to do.
When the collector pauses, every thread stops: zero requests in, zero responses out.
More connections usually make a slow database slower.
DELETE looks like the simplest statement. Under concurrent load it is the most expensive one.
The index existed. The query was written so the database could not use it.
One user could see 100,000 devices. Every obvious way to filter for them failed.
Brute-force nearest neighbors works on a laptop and collapses at production scale.
The index was bigger than the data, and every query paid for it.
Fan-out on write, fan-out on read, and why Twitter needs both.
A small reconnect bug left thousands of zombie sockets open, until the server ran out.