1 min lesson
Rate limits, backoff, idempotency and retries
Walk through the important items in "Rate limits, backoff, idempotency and retries" and give the practical point of each.
Step 1 of 2
Rate limits, backoff, idempotency and retriesthe four words that make plumbing production-grade
Third-party APIs throttle you, fail intermittently and occasionally double-process. Production code expects all three. Idempotency is the one candidates miss most and it is the one that prevents charging a lead twice or creating duplicate CRM records.
POST /v1/contacts Idempotency-Key: lead-7f3a9c-2026-06-15 # same key => server dedupes the create # client retry loop (pseudocode) for attempt in 1..5: res = send(request) if res.status == 429 or res.status >= 500: wait(min(2 ** attempt, 30) + jitter) # exponential backoff + jitter continue break # success or a 4xx we should not retry
- Rate limit - respect the provider’s ceiling; on a 429, back off rather than hammering.
- Backoff - wait longer after each failure (exponential), with jitter so many clients don’t retry in lockstep.
- Idempotency key - a stable key per logical operation so a retry re-runs safely instead of duplicating.
- Retry only the retryable - retry 429s and 5xx; do not retry a 400, which means your request is wrong.
Learn more
Full explanation
Schema drift and defensive parsing
Schema drift and defensive parsingthird-party responses change without telling you
A provider can rename a field, return null where you expected a string or version their API on you. Code that assumes a perfect response breaks silently in the night. Defensive parsing - validate the shape, default the missing, log the unexpected - keeps a surprise from poisoning your data.
Learn more
Full explanation
Logging and observability
Logging and observabilityso the integration is debuggable at 2am
An integration you cannot observe is one you cannot trust. Log enough to answer “did it run, did it succeed and if not, why” without redeploying. The bar is being able to debug a failed sync from logs and a dashboard, not from guessing.
- Structured logs
- request id, status, latency, error - queryable, not free-text
- Failure alerts
- page or Slack when error rate or queue depth crosses a threshold
- A dead-letter path
- events that fail repeatedly land somewhere replayable, not lost
- A health dashboard
- success rate and volume over time, so drift is visible before users feel it
If you can’t answer “did it run and why did it fail” from logs, it isn’t production-ready.
When you sketch any integration in the technical screen, narrate the failure modes unprompted: “This call gets rate-limited, so backoff; it can double-fire, so an idempotency key; the schema can drift, so defensive parsing; and I log every call so I can debug it.” Reliability vocabulary is the clearest signal that you build production plumbing, not demos.
QYour integration creates a CRM contact via POST. A network blip causes a retry and you fear duplicate records. What is the correct fix?