Legendary Trio
automationthoughts

API rate limits and retry strategies

Working with external APIs always means working with limits. Every platform has its own: request rate limits, file size limits, publishing frequency limits.

The naive strategy — just retry on error — works poorly. If the platform returned 429, an immediate retry will only make things worse.

The right approach: exponential backoff with random jitter, understanding the difference between "transient failure" and "permanent error," and being explicit about what to retry and what not to.

This is one of those things you're better off thinking through in advance than fixing after the first production incident.