Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Incrementally calculate checksums per connection & include empty buckets #12

Closed
wants to merge 2 commits into from

Conversation

rkistner
Copy link
Contributor

Incremental checksums

Bucket operations are always additive (operations are only added at the end of the bucket, never removed or modified). This makes it easy to calculate checksums incrementally.

This changes the checksum calculation to be incremental per connection - we only get the checksum for operations since the last checkpoint from the database, instead of recalculating checksums for the entire checkpoint on every change. This doesn't reduce the latency on initial connection, but does significantly reduce the latency and database overhead for any changes processed after that.

Future improvements could cache checksums across different connections and/or users, in memory or in database storage.

Empty buckets

This now also returns zero checksums for empty buckets to the client, instead of omitting the bucket. This does not affect synced data on the client, but helps with diagnosing sync issues.

@rkistner rkistner mentioned this pull request Jun 13, 2024
@rkistner
Copy link
Contributor Author

Superseded by #17.

@rkistner rkistner closed this Jun 13, 2024
@rkistner rkistner deleted the optimize-checksums branch June 13, 2024 08:53
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants