Skip to content

feat(plugins): add pull-based replication plugin for external-to-internal sync#208

Open
itsbryanman wants to merge 1 commit into
outerbase:mainfrom
itsbryanman:feat/replication-plugin
Open

feat(plugins): add pull-based replication plugin for external-to-internal sync#208
itsbryanman wants to merge 1 commit into
outerbase:mainfrom
itsbryanman:feat/replication-plugin

Conversation

@itsbryanman
Copy link
Copy Markdown

/claim #72

Pull-Based Replication Plugin

Syncs data from an external Postgres source into the internal
Durable Object SQLite instance so it can serve as a near-edge
read replica.

What's included

  • plugins/replication/index.ts — full plugin implementation
  • plugins/replication/index.test.ts — 12 passing tests
  • plugins/replication/README.md — usage docs
  • dist/plugins.ts — export added

Key design decisions

  • Cursor-based incremental sync with checkpoint persistence in tmp_replication_checkpoints (survives DO hibernation)
  • Auto-creates internal SQLite table schema from first synced batch
  • Fail-open per table — one table error won't abort others
  • No new dependencies — uses existing RPC layer
  • Admin-only HTTP endpoints: GET /replication/status, POST /replication/run

Demo

demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant