Show HN: IronDB – a resilient key-value store for the browser
github.com
github.com
I'm not sure any of these properties are ensured the way anyone would want. Why do this? What are the failure modes this protects against? If only one of the backing stores is active when a result is written, and then the others later become active with no data, is blank data returned for the prior result? It seems like recording timestamps would fix this problem nicely on a single system and make this thing overall quite reliable.
See my other comment, here: https://news.ycombinator.com/item?id=18297177
I'll explicate this in the documentation. Thank you for your feedback, bazizbaziz.
I recently tested localForage [0] to see if it could be more reliable and get around storage limitations of localStorage. Unfortunately, LocalForage has a very annoying problem where it picks a single storage backend to use, but the one it chooses can switch on page reloads (yes, even on the same device/browser.) and this switching causes data loss as keys stored in the other backends are unaccessible. I'm very interested to see if IronDB can help here! Thanks for working on this.
Don't hesitate to let me know if there's anything else I can help with, bazizbaziz.
I have a use case for this: I've written what is basically a crud web app for a non-profit. That's an offline app (appcache) and right now uses localstorage for keeping data offline in the browser while in the field. That is pretty brittle as is, but dedicated application installations didn't fit the budget. The app is used in the field by volunteers all over the country. With volunteers fluctuating and many people being privacy conscious, it happens regularly that they change Firefox preferences to delete cookies etc. on shutdown, and now newer Firefoxes deprecating localstorage, potentially resulting in data loss.
Something like IronDB would actually help me.
If you find any bugs, or have any ideas to improve IronDB, don't hesitate to let me know.
Think this is their site: https://www.irondb.io
Nope, this is just syntactic sugar on top of calling (up to) 4 JavaScript functions.
- save all values everywhere: why not select the one that would last the longest (that people delete least often)? Or maybe two, if you want a cookie but also want to survive over "delete all cookies". But then again, if a user wants to delete cookies then you really shouldn't try to keep it.
- "Data is stored resiliently but can also be voluntarily purged if the user designedly clears cookies and application storage." So you delete data when the user wants to delete data. Which database doesn't have this feature?
- doesn't use Flash, Silverlight, or Java -- which do?
- "healing" is usually used in the context of distributed computing, but here it means that it gets around user wanting to delete stuff from it's browser, but perhaps isn't in-the-know enough to delete everything but just the cookies.
No offence to the author but all this sound malicious. Perhaps this is why evercookie isn't maintained?
For improved resiliency.
You can also configure IronDB to only use any two datastores of your choice, if you so desire: IronStorage's constructor takes an Array of storage implementations of your choice. See https://github.com/gruns/irondb#api.
> So you delete data when the user wants to delete data. Which database doesn't have this feature?
A database where the data therein can be deleted without warning. Browsers unceremoniously delete IndexedDB, LocalStorage, and SessionStorage under storage pressure. See https://developers.google.com/web/fundamentals/instant-and-o...
> doesn't use Flash, Silverlight, or Java -- which do?
Evercookie, a similar library, uses Flash, Silverlight, and/or Java.
See https://github.com/samyk/evercookie.
> No offence to the author but all this sound malicious. Perhaps this is why evercookie isn't maintained?
No offense taken.
Thank you for your feedback, kreetx. Don't hesitate to let me know if I can answer any other questions, or if there's anything else I can do for you.
IronDB's goal is to store data reliably, e.g. in the face of storage eviction, but not against user intention. If the user clears all browsing data, that willful action is respected.
Thank you for your feedback. I'll clarify this in the docs.
And under storage pressure, browsers evict data stored in IndexedDB, LocalStorage, and/or SessionStorage. See
https://developers.google.com/web/fundamentals/instant-and-o...
IronDB is resilient in the face of such events.
Thank you for your feedback. I'll add an explanation about such in the documentation.
IronDB doesn't.
See https://developers.google.com/web/updates/2016/06/persistent....
Great point, though. I'll highlight this in the documentation. Thank you.
My team has been assuming that is true (for local,session)Storage and so far haven't been bitten.
Only occasionally have we even gotten close to that size. You can also shove loads of data in the DOM.
Edit: one of the old refs - 10MB
https://www.html5rocks.com/en/tutorials/offline/quota-resear...
ps: this will back fire real bad when safari and friends add permission prompts for each specific storage that this library fills up in a for loop.
https://developers.google.com/web/fundamentals/instant-and-o...
IronDB redundantly stores data in multiple datastores -- cookies, IndexedDB, LocalStorage, and SessionStorage -- and self-heals if the data in any thereof is deleted or corrupted. For example, stored data is safeguarded in the event the user clears their cookies or IndexedDB is purged due to storage pressure.
tl;dr: IronDB is resilient in the face of data deletion. localForage isn't.
It would be nice to have an in-between where if a user authorized an app to permanently consume up to X amount of disk space the browser would allow it. But pulling off that user interaction well (i.e., getting the user to make an informed decision rather than blindly clicking yes or no) seems quite hard.