Design a Third-Party Data Pull Platform
Design a multi-tenant control plane and scheduler for reliable, incremental pulls from rate-limited third-party APIs.
Problem statement
For this exercise, assume tenants configure credentials and schedules for third-party REST APIs that expose paginated records, provider-specific rate limits, and optional incremental cursors.
The platform runs an initial bounded backfill and later scheduled incremental pulls, durably lands original provider envelopes, advances a cursor only after the corresponding page is durable, and exposes run progress, freshness, errors, and retry controls.
Providers may throttle, return malformed pages, change schemas, repeat records, omit a next cursor, or time out after responding. Credentials must remain isolated, encrypted, revocable, and unavailable to workers outside the owning connection. One noisy tenant or provider must not starve other due runs.
Outbound writes, webhook ingestion, cross-provider entity resolution, analytics transformation, and a low-latency end-user query product are outside scope.
What to build
- Authorized tenant operators can create, test, pause, resume, rotate credentials for, and revoke provider connections without exposing secrets.
- Operators can configure a pull schedule and trigger an idempotent initial or incremental run that respects provider and tenant limits.
- The platform durably stores original provider records and lineage while retries yield one logical landed version per provider record change.
- Operators can inspect freshness, page and cursor progress, quarantined data, throttling, failures, and retry or cancel eligible work.
At scale
- For this exercise, assume 20,000 tenants own 200,000 active connections across 500 provider types, with schedules ranging from every five minutes to once per day.
- For this exercise, dispatch 99% of due runs within two minutes while respecting provider-wide, account-specific, and tenant-specific quotas; a single run may backfill 100 million records.
- For this exercise, sustain one million outbound API requests per minute at peak, with pages averaging 500 records and provider responses up to 10 MiB.
- For this exercise, retain raw provider envelopes for 30 days and connection, credential-version, cursor, run, and audit metadata for one year; accepted pages must survive a worker or single-zone failure.