Reliability · 3 min read
Verified Experience PatternDesigning Reliable Third-Party Integrations
Third-party APIs will fail in ways you don't control. The patterns that keep your system reliable anyway: retries, circuit breakers, and dead-letter queues.
Every integration platform eventually learns the same lesson: the third-party API you depend on will be slow, rate-limited, or simply down, and none of that is under your control. What is under your control is how your system behaves when it happens.
Retries with backoff, not retries on a loop
A naive retry — try again immediately — often makes things worse by adding load to an already-struggling upstream system. Exponential backoff with jitter spreads retries out over time and avoids synchronized retry storms across many failing jobs at once.
Retries should also be bounded. A job that fails indefinitely needs a clear exit, which is where dead-letter queues come in.
Circuit breakers
A circuit breaker tracks the failure rate of calls to a specific dependency and, once it crosses a threshold, stops sending traffic to it for a cooldown period — failing fast instead of piling up timeouts. This protects your own system's resources (connection pools, worker capacity) from being consumed waiting on a dependency that isn't going to respond, and gives the upstream system room to recover instead of being hit with retry traffic while it's already struggling.
Dead-letter queues
When a job exhausts its retries, the worst outcome is silently dropping it. A dead-letter queue captures it instead, preserving the payload and failure context for inspection, manual intervention, or automated replay once the underlying issue is fixed. This turns "we lost some data" incidents into "we have a backlog to reprocess" — a meaningfully different, more recoverable situation.
Idempotency is the quiet requirement
Every one of these patterns — retries, replay from a dead-letter queue — can result in the same operation being attempted more than once. If processing a job isn't idempotent, retries and replay become a source of duplicate data instead of a reliability mechanism. Designing for idempotency (e.g. via idempotency keys or upsert-based writes) up front is cheaper than retrofitting it after the first incident it causes.
Observability as the connective tissue
None of these patterns are useful if you can't see them working. Queue depth, retry counts, circuit-breaker state, and dead-letter queue volume are the metrics that tell you whether an integration is degrading before it becomes a customer-facing incident.
These patterns together — queueing, retries, circuit breakers, and dead-letter queues — are what took integration uptime from roughly 95% to 99.5% and cut MTTR by about 40% in the Data & Integration Platform system.