I have to admit; I've been thinking about this as well… and considering the 
complexities involved with developing algorithms to deal with caches, fsyncs 
and concurrency I tend to lean toward NOT rolling your own, but instead look at 
what's out there.

Event though it's oriented towards server usage, I became quite the fan of 
Redis[1] over the years. I've been pondering this for a while now: how bad 
would it be to have (something like) Redis as the backing datastore for 
anything key/value persistence related? Many areas, not only prefs, but more 
importantly session history et al would benefit from a datastore that is more 
performant than raw file I/O than Gecko APIs provide. I meant the roll-your-own 
scenario there.

Perhaps I'm thinking a tad too far out of the box this time, but think about it!

Mike.

[1] http://redis.io/

On Apr 26, 2013, at 11:33 PM, Justin Dolske <dol...@mozilla.com> wrote:

> On 4/26/13 11:17 AM, Gregory Szorc wrote:
> 
>> But, please don't
>> make consumers worry about things like SQL, schema design, and PRAGMA
>> statements.
> 
> Ideally, yes. But I suspect there will never be a one-size-fits all solution, 
> and so we should probably be clear about what it's appropriate/intended for 
> (see: prefs today!).
> 
>> Anyway, I just wanted to see if others have thought about this. Do
>> others feel it is a concern? If so, can we formulate a plan to address
>> it? Who would own this?
> 
> I'd really like to see a simple, standard way to mirror a JS object to/from 
> disk. There would barely be any API, it Just Works. EG, something like:
> 
>  Cu.import("jsonator2000.jsm");
>  jsonator.init("myfile.json", onready);
>  var o;
>  function onready(aVerySpecialProxyObject) {
>    o = aVerySpecialProxyObject;
>  }
>  ...
>  o.foo = 42;
>  if (o.flagFromLastSession) { ... }
> 
> With a backend that takes care of file creation, error handling, flushing to 
> disk, doing writes OMT/async, handling writes-on-shutdown, etc. Maybe toss in 
> optional compression, checksumming, or other goodies.
> 
> It's been on my maybe-some-weekend list for a while. :)
> 
> Justin
> _______________________________________________
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to