Skip to content
Jacky Bosega monogram logoJACKY BOSEGA
The Lab

Automation / Lab Note

What API Rate Limits Teach You

Notes on retries, backoff and designing marketing data workflows that fail politely instead of silently corrupting a reporting table.

Started 2023-08-12 / Updated 2025-06-11

Every marketing data pipeline eventually meets a rate limit. What separates a robust pipeline from a fragile one is what happens in the thirty seconds after that.

These are working notes from breaking the same integration in several instructive ways.

The failure that matters

A hard failure is fine — you see it, you fix it. The dangerous case is a partial load: half the campaigns returned, the job marked successful, and a reporting table that is quietly wrong for a week.

Patterns that hold up

None of these are clever. All of them are the difference between trusted and untrusted data.

  • Exponential backoff with jitter — synchronised retries are their own denial of service.
  • Idempotent writes keyed on a natural business key, so a replay never duplicates.
  • Atomic swaps: load into a staging table, promote only on a complete run.
  • Row-count and freshness assertions before promotion, not after.
  • A dead-letter record for every dropped request, with enough context to replay it.

The organisational half

Technical retries do not help if nobody is told. Every pipeline needs one owner and one alert channel, and the alert must say what is stale — not that a job exited non-zero.

Setup

Domain
Automation
Format
Working lab note
Core rule
Fail loudly, promote atomically
Applies to
Ad platform and analytics APIs

Tags

Stack

  • REST APIs
  • Exponential backoff
  • Idempotency keys
  • Staging tables
  • Alerting

Domain

All Automation experiments

Want the detail behind this experiment?

If this overlaps with something you're building, I'm happy to share what worked and what didn't.