Open-sourced a rate-limiting middleware for replication-interview with token bucket and sliding window
Some background first. Our setup is replication-interview plus three downstream services, seven figures of daily requests, peaking around nine in the evening.
Worth noting: the official docs do cover this, just in a very inconspicuous spot. I only found it reading the source comments, where the author explains the reasoning — roughly "so that it degrades into predictable behaviour in extreme cases".
POST /api/uploads → CDN origin pull