Skip to content

Conversation

stevensJourney
Copy link
Collaborator

Overview

This builds on-top of #105.

This adds the ability to set the storage's Write Checkpoint mode after the storage's initialisation.

Setting the Write Checkpoint mode often depends on the active Sync rules. This adds a watchActiveCheckpoint method on the BucketStorage which should yield the active checkpoint and active Sync Rules.

This also adds plan parameters to the PowerSync config file.

Copy link

changeset-bot bot commented Oct 17, 2024

⚠️ No Changeset found

Latest commit: 83cb22b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@stevensJourney stevensJourney marked this pull request as ready for review October 18, 2024 13:48
@rkistner
Copy link
Contributor

The majority of the write checkpoint operations are specific to a specific set of sync rules (takes sync_rules_id somewhere in the parameters). Could we move those APIs to SyncRulesBucketStorage instead? (implemented in MongoSyncBucketStorage)

With that done, we could calculate the write checkpoint mode once when MongoSyncBucketStorage is instantiated, and don't need to watch for any changes.

'fullDocument.last_checkpoint': 1,
'fullDocument.last_checkpoint_lsn': 1
'fullDocument.last_checkpoint_lsn': 1,
'fullDocument.content': 1
Copy link
Contributor

Choose a reason for hiding this comment

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

This has the potential to add a lot of overhead - the rest of the change stream is optimized to get checkpoint updates with as little latency as feasible. It also shouldn't be needed - the content of a sync rules document never change.

@stevensJourney
Copy link
Collaborator Author

The majority of the write checkpoint operations are specific to a specific set of sync rules (takes sync_rules_id somewhere in the parameters). Could we move those APIs to SyncRulesBucketStorage instead? (implemented in MongoSyncBucketStorage)

With that done, we could calculate the write checkpoint mode once when MongoSyncBucketStorage is instantiated, and don't need to watch for any changes.

That does seem better. I've implemented that here. I'll close this PR since it will no longer be required.

@rkistner rkistner deleted the configurable-configuration branch December 9, 2024 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants