Code Monkey home page Code Monkey logo

Comments (5)

alexmingoia avatar alexmingoia commented on September 26, 2024

I'm looking to deal with a high volume of data (50,000 - 100,000 records or more). I know WebSQL could handle it - but I'm not so sure about IndexedDB, LocalStorage, or GlobalStorage (certainly not cookies).

These are the limits for the different storage mechanisms:

localStorage
5000KB across browsers

indexedDB
By default in Firefox 4, a site can use up to 50MB of IndexedDB storage. If it tries to use more than 50MB, Firefox will ask the user for permission: http://mxr.mozilla.org/mozilla-central/source/modules/libpref/src/init/all.js#101

In Firefox for mobile devices (Google Android and Nokia Maemo), Firefox will ask for permission if a site tries to use more than 5MB: http://mxr.mozilla.org/mozilla-central/source/mobile/app/mobile.js#571

webSQL
Not sure, some people report that there's a hard limit of 5 MB, but I've read elsewhere it is 50 MB. Chrome will ask the user for permission to use over 5MB.

cookies
4000KB+ depending on the browser

I ran a test and was able to get 20,000 records to store... but sometimes it seems hard to tell which storage method is active in Chrome and firefox doesn't seem to have a way to let you peek into the datastore.

Sticky uses the first available storage adapter in the order specified by the adapters option. adapters defaults to ['localStorage', 'indexedDB', 'webSQL', 'cookie'].

One other thing I found was that removeall did seem to fail in chrome (despite a callback of true)... so I'm not sure what I was doing wrong.

I'm working on writing tests for Sticky now. I'll be done soon. The tests will catch any bugs like this.

from sticky.

 avatar commented on September 26, 2024

Local Storage:
Can the localStorage be expanded upon in any browser?

indexedDB:
What about Chrome? Does it work the same way as FF?

webSQL:
What about Mobile Safari and android?

I'm working on a layer above yours that selectively would decide if there's a connection available and when to update from online based on that... What you've got here is great and I can't wait to see how far it goes.

from sticky.

alexmingoia avatar alexmingoia commented on September 26, 2024

localStorage can't be expanded in any browser. Chrome's indexedDB implementation may differ from Firefox since both are incomplete.

webSQL Mobile Safari is 5MB IIRC.

from sticky.

 avatar commented on September 26, 2024

Hm... So i think I need to reconfigure my storage defaults to WebSQL (to allow chrome and my Rhoelements environment to expand to the necessary size), then IndexedDB - Can I just remove the rest?

LocalStorage is almost useless to me because if we store lots of data - we can't grow the database larger and we'd never use cookies I don't think...

from sticky.

alexmingoia avatar alexmingoia commented on September 26, 2024

In that case, specify that indexedDB and webSQL are preferred adapters like so:

var store = new StickyStore({
    adapters: ['indexedDB', 'webSQL, 'localStorage']
});

from sticky.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.