Skip to content

Convex replicator module#574

Merged
stevensJourney merged 103 commits into
mainfrom
module-convex
Jun 1, 2026
Merged

Convex replicator module#574
stevensJourney merged 103 commits into
mainfrom
module-convex

Conversation

@kobiebotha
Copy link
Copy Markdown
Contributor

@kobiebotha kobiebotha commented Mar 19, 2026

This adds support for Convex as a replication source. Since Convex itself is open source (technically also FSL), it was quite feasible for me to implement this.

As with any datastore, there are many quirks. I've attempted to document pertinent ones in a README.md in the module root. Required reading is the section titled "Mutation Transaction Atomicity".

To get a feel for the system, run the convex self-host-demo: https://github.com/powersync-ja/self-host-demo/tree/convex-demo. Then simply open two instances of the Convex React demo app (new) (http://localhost:3030) side by side.

When running the demo, to log into the Convex dashboard, you need to jump through some hoops:

  1. Check the container logs for the convex-keygen Docker container
  2. Get the "Admin key" printed to console

TODO

  • Test against Convex Cloud (it has been a while since I did that)
  • Fix replication metrics (currently reporting per transaction "page", should report per mutation?)
  • Update Test Connection logic to ensure that the powersync_checkpoints table and write mutation function exist
  • Measure replication performance
  • Docs feat: Convex docs powersync-docs#456

Comment thread docs/convex/schema-change-handling.md
Comment thread modules/module-convex/src/replication/ConvexReplicationJob.ts Outdated
Comment thread modules/module-convex/src/replication/ConvexStream.ts Outdated
Comment thread modules/module-convex/src/replication/ConvexStream.ts Outdated
Comment thread modules/module-convex/src/replication/ConvexStream.ts Outdated
Comment thread modules/module-convex/src/types/types.ts Outdated
Comment thread modules/module-convex/test/src/util.ts Outdated
Comment thread modules/module-convex/src/module/ConvexModule.ts Outdated
Rentacookie
Rentacookie previously approved these changes May 28, 2026
Copy link
Copy Markdown
Contributor

@Rentacookie Rentacookie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 😁

Comment thread modules/module-convex/src/client/ConvexApiClient.ts Outdated
rkistner
rkistner previously approved these changes Jun 1, 2026
Copy link
Copy Markdown
Contributor

@rkistner rkistner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not review all the details, but the approach looks good. The info in docs/convex is very useful! Should add similar docs for other dbs over time.

@stevensJourney stevensJourney requested a review from rkistner June 1, 2026 13:20
@stevensJourney stevensJourney merged commit a94b6c3 into main Jun 1, 2026
46 checks passed
@stevensJourney stevensJourney deleted the module-convex branch June 1, 2026 13:35
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.

4 participants