A rate limit is not backpressure
When Shopify Admin, a vision model, or PrintNode starts answering 429, the usual fix is a Redis token bucket at the edge. That is rate limiting: each caller gets a budget. It does not say whether your worker pool, Postgres connection limit, or PrintNode queue can absorb the next event. Backpressure is that capacity signal — queue depth, in-flight caps, dependency latency — and it has to push back even when every caller is still under their personal limit. We see the two collapsed in webhook ingest and catch-up jobs the same way: fair callers, saturated path, and a queue that looked healthy until age exploded.
Two questions that look like one
Rate limiting asks: is this caller, tenant, or route over its budget? It protects fairness. One noisy shop should not starve the others sharing an Admin API cost pool or a shared OCR worker.
Backpressure asks: can the downstream path finish more work right now? A worker pool is full. The PrintNode job queue is aging. Vision latency is climbing. The answer is independent of whether the caller still has tokens left.
Collapsing them into "we have a rate limiter" is how an integration stays polite at the gateway and still eats itself. Fair admission into an unbounded buffer is just a delayed outage with nicer logs.
What a rate limit buys you
Put the limit where identity is clear — API key, shop, tenant — and size it for the expensive path, not the average GET. Shopify cost points and model tokens are not interchangeable with request counts; a cheap list call and a heavy order rewrite do not share one naive RPS number.
Edge limits stop accidental floods and keep one client from monopolizing a shared dependency. They do not know your in-process semaphore is already maxed, or that yesterday's webhook gap just enqueued three hours of catch-up next to live orders.
Treat 429 from your own edge as a fairness signal to that caller. Treat saturation of your workers as a different signal — often still a 429 with Retry-After, but keyed off capacity, not the caller's remaining budget.
What backpressure actually is
Backpressure is capacity feedback. Cap in-flight work. Bound the queue. Watch age and depth, not only throughput. When the high-water mark hits, refuse or defer new intake until the path drains below a low-water mark — hysteresis stops the flap that a single threshold creates.
For webhook receivers that hand off to slow work, that means the HTTP handler is not "accept forever, hope the queue drains." A full bounded queue should surface as pushback to the producer, not as silent buffering until memory or job age becomes the outage.
This pairs with not clearing a backlog at full speed. Catch-up and live traffic share one downstream budget. Rate limits per caller will not stop catch-up from starving the live path if both are admitted into the same unbounded worker pool.
Where teams blur them in practice
A gateway token bucket in front of an unbounded Bull/SQS consumer looks done in a design review. Under a quiet-hour catch-up, every caller is still under limit while job age climbs past the window where a kitchen ticket or a parse correction still matters.
Another blur: returning 503 for saturation. Well-behaved dispatchers treat 503 as broken and trip breakers; 429 with Retry-After reads as slow down. Reserve 503 for dependencies that are actually unavailable. Saturation is a throttle, not a fake outage.
Client libraries that ignore Retry-After turn either control into amplification. Document the contract: honor the header, back off, and keep live user work on a lane that outranks catch-up.
What we check before an integration ships
Name the rate limit identity and the unit it meters. Name the backpressure signals — max in-flight, max queue depth, max job age — and what the handler returns when they trip. Confirm catch-up cannot bypass those caps.
Load a burst where every caller is under budget and the worker pool is not. If the system only fails when a single caller exceeds RPS, you tested fairness, not capacity. If the queue grows without a reject or pause path, you still have an infinite buffer wearing a limiter badge.
The milestone is two working controls that answer different questions. A rate limit without backpressure is a polite door into a room that still fills with smoke.
Questions
- Do we need both on every endpoint?
- You need both wherever producers can outrun a scarce dependency or a finite worker pool. A purely static read behind a CDN may only need edge abuse limits. Webhook ingest, OCR pipelines, and printer dispatch need capacity feedback too.
- Is a concurrency semaphore backpressure?
- It is one form of it — a hard cap on in-flight work. Pair it with a short queue or a fast reject. A semaphore in front of an unbounded queue just moves the pile.
- How is this different from not clearing a backlog at full speed?
- That note is about sharing one upstream quota between catch-up and live traffic. This one is about not mistaking per-caller fairness for path capacity. You usually need both disciplines on the same integration.
Sources
- Rate limiting and backpressure in microservices — Fairness budget vs capacity feedback; bounded queues; load shedding.
- Webhook rate limiting and backpressure — Token bucket vs concurrency caps; queue depth as signal; 429 Retry-After vs 503.
- Related: Don't clear a backlog at full speed
- Related: A 429 is not a toast