Cross browser HTML5 storage library [closed]
Asked Answered
R

4

6

I have one requirement where should be stored locally when internet is not available. It should handle it in cross browser compatible way. Now as I know there are variety of options to store the data locally (indexedDB, WebSQL, localStorage). All I really want is a unified API. I don't want to detect and write code for several storage engines.

All I really care about is give a key, and give the data and it should be persisted across browser sessions/crashes.

After lot of googling the only library that I have actually come across is persisJS:

http://pablotron.org/?cid=1557

But it is roughly 4 1/2 years old. Is there anything better ormore reliable and newer than this?

Rainbolt answered 19/9, 2012 at 15:59 Comment(0)
T
0

Try out SequelSphere

It is a 100% HTML5/JavaScript Relational Database that works cross-browser and uses local storage to persist it's data. You can use SQL to query it as well. It is it's own database engine, and doesn't rely upon the built-in relational databases. As such, it will work across all browsers.

Tracheitis answered 4/10, 2012 at 16:34 Comment(0)
L
3

If you'd prefer to always be able to store

See http://www.jstorage.info/, specifically the Browser support section

If the browser is allowed to not cache if it doesn't support it

See locache: https://github.com/d0ugal/locache

The important bit for you being that is gracefully degrades and uses other mthods to store the information. It's also very easy to use and rather lightweight!

JavaScript framework for client side caching in the browser using DOM Storage with expiring values. With a memcache inspired API usage is very simple. Locache has no dependencies and is very small.

locache gracefully degrades when the browser doesn't support localStorage. Usually this will be IE6 or IE7, you wont get any errors, but caching attempts will be silently dropped and lookups will always appear to be a cache miss.

Lymphocyte answered 19/9, 2012 at 16:1 Comment(0)
C
1

You should try lawnchair.

Also, note that not all storage engines are created equal. If you want to store large amounts of data and access it asynchronously (not blocking the UI), then you're restricted to IndexedDB and WebSQL, which are not supported in all browsers. This gives you more cross-browser support for IndexedDB, but IE will still be left out.

Cochineal answered 19/9, 2012 at 16:35 Comment(2)
Hi Jemery, What is this lawnchair? I viewed the page but it doesn't have anything mentioned regarding which storage engines does it support. Can you please link me to that?Rainbolt
It calls them "adapters". It supports basically anything. But as I said, the caveat is that asynchonous storage of large amounts of data is not possible in IE now.Cochineal
A
1

Have you check out of my own library YDN-DB

It is very carefully design for IndexedDB API on performance and robutness, but great fallback to WebSQL and localStorage.

Andri answered 20/9, 2012 at 5:59 Comment(0)
T
0

Try out SequelSphere

It is a 100% HTML5/JavaScript Relational Database that works cross-browser and uses local storage to persist it's data. You can use SQL to query it as well. It is it's own database engine, and doesn't rely upon the built-in relational databases. As such, it will work across all browsers.

Tracheitis answered 4/10, 2012 at 16:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.