<div dir="ltr"><div><div>On the subject of storage systems that are available in Gecko, I'd be remiss if I didn't mention kinto.js, which is part of the Kinto suite, a set of tools meant to build offline-first web applications. (I work on the team that built Kinto.) If you want a key-value ("document") store with deliberately simplistic synchronization primitives, kinto might interest you. kinto.js is available in Gecko with a backend based on Sqlite. (You can also use kinto.js in non-Gecko projects, where it uses IndexedDB.)<br><br></div>I'm using kinto.js to implement chrome.storage.sync, but it's also been used to handle certificate blocklist updates. See services/common/blocklist-clients.js for an example of usage.<br><br></div>Ethan<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 11, 2016 at 4:33 PM, Richard Newman <span dir="ltr"><<a href="mailto:rnewman@mozilla.com" target="_blank">rnewman@mozilla.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">As some of you know, Nick Alexander and I have been working on an exploratory storage system called <a href="https://github.com/mozilla/datomish/" target="_blank">Datomish</a>[1]. There's a blog post queued up, but part of the idea is to make fairly fast, durable, flexible, multi-consumer storage way easier to handle than starting out with Sqlite.jsm and trying to figure out who owns the schema migration code.<div><br></div><div>One way to think about it: what if Prefs — the de facto lightweight multi-consumer store in Gecko — was graph-structured, supported upserts and indices and rules and transactions and full-text querying, and was actually durable?<br><div><br></div><div>That's not at all in competition with a simple JSON file store — which remains an excellent way to meet special-purpose, small-size storage needs, and I'm glad to see Luke and co step up to maintain one!  — but it does address many of the concerns in that original "Storage in Gecko" thread, so I figured this was as good a place as any to mention it.</div><div><br></div><div>-R</div><div><br></div><div>[1] <<a href="https://github.com/mozilla/datomish/" target="_blank">https://github.com/mozilla/<wbr>datomish/</a>></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 11, 2016 at 12:53 PM, Chris Peterson <span dir="ltr"><<a href="mailto:cpeterson@mozilla.com" target="_blank">cpeterson@mozilla.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Is JSONFile.jsm suitable for the long-sought Gecko storage system
    that's not as hacky as <a>about:config</a> prefs or as heavyweight as
    SQLite? btw, I didn't see any tests specifically for JSONFile.jsm.
    Are the other Password Manager tests on top of JSONFile.jsm adequate
    test coverage?<br>
    <br>
    Here is a link to a 2013 "Storage in Gecko" thread on dev-platform
    bikeshedding requirements around sync/async APIs and atomic and lazy
    I/O. This thread spun out bug 866238 ("implement simple key-value
    store on top of IndexedDB").<br>
    <br>
<a href="https://groups.google.com/d/msg/mozilla.dev.platform/vYbQqkqGzlo/YYIvd-rB9ToJ" target="_blank">https://groups.google.com/d/ms<wbr>g/mozilla.dev.platform/vYbQqkq<wbr>Gzlo/YYIvd-rB9ToJ</a><div><div class="m_-2283385725005495290h5"><br>
    <br>
    <br>
    <div>On 10/11/2016 7:53 AM, Luke Chang
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="m_-2283385725005495290h5">
      <div dir="ltr">
        <div>
          <div>Hey folks,</div>
          <div><br>
          </div>
          <div>This is a notice about a module, JSONFile.jsm, just
            landed in "toolkit/modules".</div>
          <div><br>
          </div>
          <div>Matt, Steve and I have been working on Form Autofill [1].
            While implementing, we intend to leverage modules of
            Password Manager because of their similar behaviors.
            LoginStore.jsm [2] is one of those modules.</div>
          <div><br>
          </div>
          <div>The above-mentioned JSONFile.jsm is basically separated
            from LoginStore.jsm, which is in charge of storing
            login-related data in a ".json" file. In order to increase
            the reusability of such JSON-formatted storage that we're
            going to use in Form Autofill as well, we refactored
            LoginStore.jsm. More specifically, those IO-specific APIs
            were generalized and moved to JSONFile.jsm. Therefore,
            LoginStore.jsm will focus on schema-related operations such
            as data migrations.</div>
          <div><br>
          </div>
          <div>To sum up, you can now utilize JSONFile.jsm to store
            simple data in a single file as long as the data can be
            serialized to JSON format. More details can be found in bug
            1304322 [3].</div>
          <div><br>
          </div>
          <div>Thanks,</div>
          <div>Luke</div>
          <div><br>
          </div>
          <div>[1] <a href="https://wiki.mozilla.org/Firefox/Features/Form_Autofill" target="_blank">https://wiki.mozilla.org/Firef<wbr>ox/Features/Form_Autofill</a></div>
          <div>[2] <a href="https://dxr.mozilla.org/mozilla-central/source/toolkit/components/passwordmgr/LoginStore.jsm" target="_blank">https://dxr.mozilla.org/mozill<wbr>a-central/source/toolkit/<wbr>components/passwordmgr/<wbr>LoginStore.jsm</a></div>
          <div>[3] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1304322" target="_blank">https://bugzilla.mozilla.org/s<wbr>how_bug.cgi?id=1304322</a></div>
        </div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>______________________________<wbr>_________________
firefox-dev mailing list
<a href="mailto:firefox-dev@mozilla.org" target="_blank">firefox-dev@mozilla.org</a>
<a href="https://mail.mozilla.org/listinfo/firefox-dev" target="_blank">https://mail.mozilla.org/listi<wbr>nfo/firefox-dev</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>______________________________<wbr>_________________<br>
firefox-dev mailing list<br>
<a href="mailto:firefox-dev@mozilla.org" target="_blank">firefox-dev@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/firefox-dev" rel="noreferrer" target="_blank">https://mail.mozilla.org/listi<wbr>nfo/firefox-dev</a><br>
<br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
firefox-dev mailing list<br>
<a href="mailto:firefox-dev@mozilla.org">firefox-dev@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/firefox-dev" rel="noreferrer" target="_blank">https://mail.mozilla.org/<wbr>listinfo/firefox-dev</a><br>
<br></blockquote></div><br></div>