However just wanted to clarify that PouchDB doesnt natively use localstorage for storage, its primarily IndexedDB or WebSQL in the browser (leveldb in node).
We do actually use localstorage for cross tab messaging, but thats mostly a hack due to the lack of idb event listeners (that are coming in v2)
Your PouchDB application works locally on your device, whether the connection is up and down, and the data is synched with the remote database whenever there is connection.
The alternatives to this PouchDB to CouchDB synching mechanism would have to be either:
- the user checks whether the connection is up, and manually manages the sync, or
- the application programmer saves the user the trouble by adding code that checks whether the connection is up, and automatically manages the sync
localStorage is not indexed, you have to implement some sort of lookup yourself. If you go that way, a tip is to store values as objects with ids as keys, that way you get a sort of hash map as index thing going which alleviates things a bit. PouchDB is indexed and provides a way to query your documents.