[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] IndexedDB Irmin backend



On 24 March 2015 at 21:55, Anil Madhavapeddy <anil@xxxxxxxxxx> wrote:
> On 24 Mar 2015, at 16:23, Thomas Leonard <talex5@xxxxxxxxx> wrote:
>>
>> I've replaced my HTML Storage Irmin backend with an IndexedDB one:
>>
>>  https://github.com/talex5/cuekeeper/blob/master/js/irmin_IDB.ml
>>
>> Unlike HTML Storage, IndexedDB isn't limited to 5 MB. It also supports
>> transactions, so updates should no longer be racey.
>>
>> However, IndexedDB doesn't support notifications. My backend therefore
>> also writes the current branch head hash to a single HTML Storage key
>> so notifications work (browser tabs remain synchronised).
>
> That's a good idea -- I guess it's safe to assume that any browser
> modern enough to support IndexedDB will also have LocalStorage.
>
> Is there a prebuilt version anywhere (or a simpler testcase) to point
> various browsers at to check if the requisite support is present? I'm
> thinking in particular of Android and iPhone browsers which may be
> buggy, at least according to http://caniuse.com/#feat=indexeddb

There isn't at the moment. I'd rather not put up a demo site yet as
the storage format is likely to change and anyone who started using it
would have to migrate their data manually.

The Safari bug, while bad, shouldn't affect us. We only have two
tables and they should have no primary keys in common (unless you name
a branch after a sha1 hash you already used in a commit). Encoding the
branch names would fix that (and perhaps should be done anyway, in
case someone wants a non-string branch name).

The IE bugs are related to complex keys, which we don't use.

There appears to be a minor memory leak in Firefox too:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1147942

On the good news side: backups turned out to be easy. Each site (in
Firefox at least) gets its own directory under ~/.mozilla containing
an SQLite DB for that site. You can simply copy this to a new Firefox
instance and it will pick up the data. Example path:

~/.mozilla/firefox/(salt).default/storage/default/http+++example.com/idb/


-- 
Dr Thomas Leonard        http://0install.net/
GPG: 9242 9807 C985 3C07 44A6  8B9A AE07 8280 59A5 3CC1
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.