Skip to main content
This page covers the cross-cutting practices that turn a working polling integration into a production-grade one. The previous pages in this group cover the mechanics (polling, user-change detection, project-change detection, reconciliation). This one covers the practices that span them — checkpointing, idempotency, drift detection, cost/reliability trade-offs, and debugging. The audience is integration architects designing a polling architecture that will run in production for years, not engineers prototyping for a demo.

The five core practices

Each of these is a multi-page topic in itself. This page covers the essentials.

Practice 1: Durable checkpointing

The checkpoint — “we’ve processed everything up to time X” — is the most important piece of state in the integration. If it’s lost or corrupted, the integration’s understanding of “what’s been done” is wrong.

Where to store checkpoints

For most partner integrations, a relational database table works:
A composite key per customer per resource. Updates happen at the end of each successful poll cycle.

Atomic checkpoint advancement

The critical pattern: never advance the checkpoint before processing is complete.
JavaScript
For workflows where processing can fail per-record (DLQ pattern), the principle still holds: advance to the latest successfully processed record’s updated_at, not to wall-clock time.

Checkpoint backup

For high-stakes integrations, back up checkpoints separately from the primary store:
JavaScript
If the primary store is lost or corrupted (region outage, accidental DELETE, etc.), the backup allows recovery without a full re-sync.

Recovery from a lost checkpoint

If a checkpoint is missing for a customer: Don’t silently “guess” — pick a strategy explicitly per customer. Logging the recovery decision gives an audit trail when questions arise later.

Practice 2: Idempotency at every layer

Polling, reconciliation, and processing all retry. They retry on failures, on restarts, on operator-initiated re-runs. Operations must be safe to repeat.

What makes an operation idempotent

An operation is idempotent if performing it N times has the same effect as performing it once. For sync workloads:

Building idempotency into processing

Three patterns: Pattern A: idempotent destination operations Use upsert operations on the destination. The classic example:
JavaScript
Whether this is the first sync or the hundredth, the destination ends in the same state. Pattern B: deduplication keys For operations that aren’t naturally idempotent (sending emails, creating records), use a deduplication key:
JavaScript
The dedup record prevents repeated sends even if the polling cycle re-discovers the user. Pattern C: optimistic concurrency For operations that update existing records, use if-not-changed-since semantics:
JavaScript
A stale repeat write (e.g., from reconciliation re-discovering an already-processed record) is skipped without changing destination state.

When idempotency is impossible

For operations with one-time side effects (welcome emails, provisioning new accounts in third-party systems), dedup keys are essential. Without them, retries produce duplicated work. For workflows where you genuinely can’t guarantee idempotency, ensure the operation only happens at well-defined moments — typically only when the integration knows the user is “new” (via persistent state lookup, not heuristics).

Practice 3: Drift detection

Knowing whether the integration is working is as important as making it work. Drift detection is the practice of continuously verifying that observable reality matches expectations.

What to measure

Setting up alerts

The right alert thresholds depend on customer expectations and your operational maturity. Start conservative — too few alerts is more dangerous than too many.

Dashboards over alerts

Alerts catch acute problems. Dashboards catch slow drift: For partner integrations serving many customers, the per-customer dashboard is the most useful — it answers “is this specific customer’s integration healthy?” in seconds.

Practice 4: Cost vs. reliability balance

Every polling and reconciliation operation has a cost in API request budget. Reliability has a cost too — but they’re not equally valuable beyond a certain point.

The cost curve

The first 90% of reliability is cheap (basic polling + daily reconciliation). The next 9% is moderately expensive (weekly full reconciliation, sample auditing). The last 1% (real-time drift detection, per-record verification, multi-region failover) is very expensive. For most partner integrations, target ~99% reliability. The remaining 1% is handled by:
  • Customer-visible audit trails (so issues are visible when they occur)
  • Operator escalation paths (so the team can intervene when needed)
  • Per-customer support tooling (so issues can be debugged efficiently)
Investing in perfect reliability beyond this is usually worse ROI than investing in better debuggability.

Right-sizing cadences

Push back on “real-time” requirements — most aren’t truly real-time needs, just comfort goals. A clear conversation about what business problem the freshness solves often reveals that hourly is fine.

Per-resource cadence tuning

Within an integration: Different cadences across resources cuts total request volume by 50-80% versus a uniform “every 15 min for everything” cadence.

Practice 5: Debuggability

When sync breaks, the team needs to be able to find out why quickly. The practices that enable this:

Structured logging

Every polling and reconciliation operation should log: Structured logs (JSON, not strings) make filtering and aggregation possible.

Trace IDs across the pipeline

For each polling cycle, generate a trace ID and propagate it through every operation:
JavaScript
The trace ID lets you reconstruct everything that happened in a specific poll cycle later. When a customer says “data for user X is missing,” searching logs by user X plus a date range pulls up the exact cycle that should have processed it.

Per-record audit trail

For each record processed, record:
JavaScript
The per-record audit is what answers “when did we last process user X?” — essential for both reconciliation and customer support.

Inspection tooling

Build operator tooling that exposes: The tooling doesn’t need to be fancy — even simple CLI scripts that hit the structured-log store and per-record database are sufficient for most debugging needs.

Reproduction without production

For investigating issues, the ability to re-run a polling cycle against historical state is valuable:
JavaScript
Replay against past time windows in a dry-run mode helps investigate “why didn’t this record get processed?” questions.

Putting it together: a polling reliability blueprint

A reference blueprint for production polling reliability: The components: The complexity is real, but each component does one well-defined job. The combination produces production-grade reliability that scales across many customers.

Common anti-patterns

A few patterns that look reasonable but cause production issues:

Anti-pattern: “the polling worker IS the integration”

Some integrations are built around a single all-in-one polling worker that does everything. When it breaks, everything breaks. Better: separate polling from processing. Polling enqueues changes; a separate worker processes them. Each can fail and recover independently.

Anti-pattern: “we’ll catch deletions someday”

Deletion detection is hard, so it’s often deferred. Then a customer asks why deleted volunteers still appear in their reports — and the answer is “we don’t sync deletions.” Better: build deletion detection from the start, even if it’s just weekly. The infrastructure is the same as full reconciliation; you’re doing it anyway.

Anti-pattern: “we’ll just re-sync everything when there’s a problem”

For small customers this works. For large customers, “re-sync everything” is hours of API calls and processing. Plan for incremental recovery, not just full reset.

Anti-pattern: “the audit log is just for compliance”

Audit logs become invaluable for debugging. Make them queryable, filterable, and indexed — not just write-only.

Anti-pattern: “if reconciliation finds gaps, auto-fix them”

Sometimes reconciliation finds gaps because polling has a bug. Auto-fixing hides the bug behind reconciliation’s automatic correction. Treat sustained reconciliation gaps as a signal to investigate, not just a checklist item to clear.

Anti-pattern: hardcoded cadences across customers

Different customers have different scales and needs. Hardcoded “every 15 minutes for everything” works initially but scales poorly. Make cadence per-customer-configurable from the start.

A maturity model

Where is your integration on the polling reliability maturity model? Most production integrations land between Level 3 and Level 4. Level 5 is reserved for the highest-stakes integrations (compliance-critical workflows, financial reporting, etc.). For each level, the previous level’s practices are foundational — you can’t skip from Level 1 to Level 4.

Production checklist

For a polling integration at Level 3+:
  • Checkpoints stored in durable, transactional storage
  • Checkpoints advanced only after successful per-record processing
  • Per-record processing operations are idempotent
  • Dedup keys protect non-idempotent operations
  • Per-resource cadences tuned to actual freshness needs
  • Daily incremental reconciliation runs for each resource
  • Weekly full reconciliation including deletion detection
  • Per-record audit trail with trace IDs
  • Per-customer dashboards exposing sync health
  • Alerts on stalled checkpoints, growing DLQ, elevated error rates, reconciliation gap rates
  • Cadences are per-customer-configurable
  • Replay/dry-run tooling exists for debugging
  • Documented runbook for common failure modes
  • On-call playbook for the most common alerts

Where to go next

Reconciliation Patterns

The companion page on the reconciliation patterns this page builds on.

Sync Architecture Patterns

The broader architectural patterns these practices fit into.

Error Recovery Patterns

The error-handling patterns that support this reliability model.

API Performance Tips

The performance patterns that keep polling efficient at scale.
Last modified on May 22, 2026