/claim #72

Description

Adds a lightweight replication plugin that automatically pulls data from a configured external database (PostgreSQL, MySQL, Turso) into the internal local SQLite database.

This implementation deeply integrates with the existing architecture and alarm mechanism without altering the core StarbaseDBDurableObject system:

  • Implements plugins/replication/index.ts cleanly within ~110 lines.
  • Extends the existing executeExternalQuery mapping logic with INSERT OR REPLACE INTO natively to replicate rows idempotently.
  • Utilizes the cursorColumn (default: id) and state tracking via an automatically provisioned tmp_replication_cursors SQLite table to ensure duplicate data isn’t fetched and replication scales independently per table.
  • Relies cleanly on the existing application ecosystem structure, avoiding unnecessary code bloat or intrusive dependencies across do.ts or route handlers.

Local Testing Performed

  • Validated external source (PostgreSQL) SELECT batching via dynamically mapped cursors.
  • Successfully verified edge cases when external results return empty batches (cursor tracks cleanly, upsert logic exits gracefully).
  • Validated full vitest pass on local logic simulating large schema syncs to ensure robust state management during the mapping step.
  • Checked TypeScript compiler to assure zero type defects or regressions.

Demo Video

https://github.com/user-attachments/assets/a2d3ace8-fe96-46c1-8b41-6e066006dd0e

Claim

Total prize pool $250
Total paid $0
Status Pending
Submitted March 22, 2026
Last updated March 22, 2026

Contributors

VO

voldemort9999

@voldemort9999

100%

Sponsors

OU

Outerbase (YC W23)

@outerbase

$250