Inert offline subscriptions

Hi all!

I have a question related to offline collections, which arose from this beautiful thread: Is GroundDB the best for offline storage?. I try to optimize serverload. I have a few collections, that don’t really require reactivity / online subscriptions, because they most likely will not change during a day or maybe a week / month. So I suppose it is kind of a waste to have subscriptions up for those collections all the time.

What I would like to accomplish is make sort of „lazy“ or „inert“ subscriptions; if there’s no data in offline storage or that data is older than a specific timespan, subscription gets established and data gets synced. Otherwise, data will only be fetched offline and the subscription will not be established to save server resources.
Maybe it’s possible to add a _syncedAt property to the offline data? Or is all of this not a big deal since subscriptions aren’t that expensive?

I‘m totally aware that this is in contrast to what’s a key feature of meteor, but it seems overkill to me to have full reactivity on a collections that rarely changes.

Any thoughts?

If you don’t care about reactivity, sync the data with methods into an exclusively local collection - then from the client side you can use it in the same way.

If the amount of data you’re sending is large, you can then use ground DB, or directly use localStorage/indexDB if you want to cache that data. There you’d be caching the response to a method call, so you could index on method name + args + syncedAt or similar

1 Like