The algorithm behind Shopify's REST API rate limiting.
The leaky-bucket algorithm models rate limiting as a bucket that fills with each request and drains at a fixed rate. When the bucket is full, additional requests are rejected with HTTP 429. Shopify's REST bucket holds 40 requests and drains at 2 per second on standard plans (higher on Plus). The practical implication for bulk edits: burst up to 40, then throttle to 2/s — and always read the `X-Shopify-Shop-Api-Call-Limit` header to know how full the bucket is.