mongodbmeteorofflineofflineappsoffline-browsing

Does Meteor-JS support offline storage/cache?


Does Meteor-JS support offline storage/cache?

From what I'm reading: https://guide.meteor.com/collections.html :

Instead, on the client, a collection is a client side cache of the database. This is achieved thanks to the Minimongo library—an in-memory, all JS, implementation of the MongoDB API.

The in-memory part seems to negate working offline. Am I wrong?

EDIT: By "offline" I mean as many as possible of those qualities:

EDIT2: I guess the proper term would be offline-first


Solution

  • You are right about having concerns about the "in-memory" part of Minimongo. But on an offline device this is not as bad as it can look like: as long as the app is kept in memory (i.e. sitting in a tab if opened through a browser, or not forcedly closed if opened as a Cordova packaged app), your Minimongo lives and retains your data.

    However, should the browser tab be closed, or the Cordova app brought out of device memory (i.e. user forces it to close through the task switcher / apps manager, or Android is getting short of RAM and looks for unused apps to close. This also means that just going back to home screen keeps your app in memory), then your Minimongo (and its data) goes away.

    But there are packages that can take care of that use case as well. See How can Meteor apps work offline?