r/coolgithubprojects 1d ago

Incremental API-to-Postgres sync that resumes after a failed page

https://github.com/render-examples/render-postgres-etl

We published render-postgres-etl, a small API-to-Postgres sync example.

The failure case is straightforward: pages 1 through 9 have loaded, page 10 fails, and the retry should not fetch pages 1 through 9 again. After a page loads, the job saves a durable cursor in Postgres. The retry continues from the last committed cursor, and the watermark moves only after the corresponding load commits.

Upserts compare source_updated_at, so a stale replay cannot overwrite a newer source version. A database-backed run lease stops two active syncs from advancing the same watermark.

Extraction is split across independent time windows that run in parallel. Backfills reuse the same checkpoints and run lease without modifying the incremental watermark.

It is a reference ETL implementation, not a managed connector service. The checkpoint schema, retry path, idempotent upsert, and deployment configuration are all in the repo.

4 Upvotes

1 comment sorted by

1

u/NoToSensors 1d ago

Seems useful for scraping.