Plans to support functions returning delta updates?
I have a question about the use case where you are subscribing to a query that returns a large array of data that changes often.
Are there any plans to officially support smartly returning only the changes, rather than the whole array every time? Similar to how Firestore and Realm ( called MongoDB Atlas Device SDKs now) behaves.
Thanks!
13 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
hi! the plan is to build this as part of the local sync engine project
An Object Sync Engine for Local-first Apps
Object sync engines manage a rich object graph across multiple clients and a centralized server and are a great fit for building local-first apps.
any ETA on this?
I’m also curious on eta. I wish we could just get delta syncs with subscriptions first. It would be sooooo useful
we have to knock out some chef stuff, and hire up the team to take on all these new projects. I'm going to estimate we'll get back to it mid summer
Imo we don’t need a full local first implementation, just subscriptions that do light caching for the UI to load instantly when re-viewing a page (without having to re-pull from scratch), and also delta updates in the subscription. This is all we need and it would be perfectly useful.
And to be clear, I’m not talking about the helper for cached subscriptions. Though that has some good use cases
npm
convex-helpers
A collection of useful code to complement the official convex package.. Latest version: 0.1.79, last published: 10 days ago. Start using convex-helpers in your project by running
npm i convex-helpers
. There are 12 other projects in the npm registry using convex-helpers.oh
😦
yeah, deltas for normal subscriptions aren't likely to show up soon -- the local sync engine which has a robust model for deltas would be the first version of that
Cached subscriptions + delta updates would be enough to get by.
Right now we have been building our own implementation and it’s not fun/ideal.
the function subscribes by updated time. Then we have to re-subscribe on every subscription response. Then manage a soft delete table for any deletions.
If we could get a delta subscription without local first that would be really really nice
Hi, is this an official package from convex?
Yeah. @Ian on our team maintains it.
Wow!! This package makes convex even more amazing 🤯