Noob Question: Does MiniMongo Query Browsers Local Storage?


#1

Below is an outline of a browser’s makeup from html5rocks

My question: is this data persistence (i.e. local storage) what minimongo, webSQL, redis, store.js and others are querying?

If so, at what point are they interacting? is the rendering engine taking mini-mongo commands from the JS interpreter then applying them to the local storage/data persistence? Or is the browser engine really the only thing in touch with the data persistence/local storage?

Or does mini-mongo store the data somewhere else on the client entirely?

http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/layers.png


#2

In the case of minimongo specifically, no it is not using web browser localStorage. MDG originally created its own in-memory storage solution (tied to a DDP connection) for handling minimongo based collection data. To see this in action, go to https://www.meteor.com/, crack open your Chrome console, and type/run the following:

Meteor.connection._mongo_livedata_collections

This will dump the currently active collection data that’s being stored in-memory. Drill down through the returned Objects and you’ll start to see where the data is actually stored locally. I’ve attached a quick example.