[whatwg] Storage quota introspection and modification

Scott Hess shess at google.com
Wed Mar 10 14:39:51 PST 2010


2010/3/10 Jeremy Orlow <jorlow at chromium.org>:
> 2010/3/10 Ian Fette (イアンフェッティ) <ifette at google.com>
>> As I talk with more application developers (both within Google and at
>> large), one thing that consistently gets pointed out to me as a problem is
>> the notion of the opaqueness of storage quotas in all of the new storage
>> mechanisms (Local Storage, Web SQL Database, Web Indexed Database, the
>> Filesystem API being worked on in DAP, etc). First, without being able to
>> know how large your quota currently is and how much headroom you are using,
>> it is very difficult to plan in an efficient manner. For instance, if you
>> are trying to sync email, I think it is reasonable to ask "how much space do
>> I have," as opposed to just getting halfway through an update and finding
>> out that you hit your quota, rolling back the transaction, trying again with
>> a smaller subset, realizing you still hit your quota, etc.
>> I would like to see a method added, for any "storage mechanism", something
>> like "GetCurrentQuota()" and "GetCurrentQuotaUsed()". (I specifically don't
>> care what they're called or the details, e.g. whether they need to be
>> callbacks, I just want to see us address this use case.)
>
> I too have heard this plea over and over again.  I've also heard that even
> knowing the order of magnitude of headway would be useful.  This is nearly a
> deal breaker for a lot of apps.  Having to gracefully handle a quota related
> error _every_ single time you do an operation is a big pain.

As with any other API, just because the browser says you can do it
doesn't mean that when you try to do it, it will work, so you pretty
much have to handle it.

An alternative to providing a measure of what your remaining quota is
would be to provide an estimate of the minimum amount of additional
data which the system has a high confidence that it can store for you.
 That number can probably be generated more reliably, and it sidesteps
some of the issues with what quota really is (after considering
straight storage overhead and the overhead needed to deal with
transactions).

-scott



More information about the whatwg mailing list