<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><span class="gmail-"><div>According to a sync person, sync just transacts really fast to the places database and hopes for the best.<br></div></span></div></div></blockquote><div><br></div><div>Sync uses the Places API, rather than writing directly… but it does indeed do so iteratively and hoping for the best!</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><span class="gmail-"><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> The only thing writing to Places should be Places, cause it's the only one knowing how to handle Sync needs, triggers, expiration and such things. It's far more complex than it looks just by opening the db, cause we have requirements regarding privacy and Sync. I'd say there's 90% probability an external writer would do the wrong thing.<br></div></div></div></div></div></blockquote><div><br></div></span>I think I want to break the places subsystem into pieces, and, in particular, to have a places database API (and protocol?).  The current places subsystem would use it.  My “tightly coupled wiki” would use it.  I would do all that myself, unless someone wants to help.  When I’m done with where-ever this leads, you will get something much easier to modify.</div></div></blockquote><div><br></div><div>There is a Places API/protocol: mozIAsyncPlaces. The problem is that you need to be within Firefox to use that, and it's very focused on serving Places's needs.</div><div><br></div><div>If you're accessing from a separate app, you're doing it via SQLite, and that ain't right: SQLite is an implementation detail (albeit a leaky one), and using that will bypass large parts of Places that expect to see all changes. You'll screw up caches, introduce inconsistency, break Sync, etc. etc.</div><div><br></div><div>Furthermore, changes to Places that don't further the needs of Firefox itself are likely to meet some resistance: changing software introduces risk and instability, and it's not worth doing that unless it supports a broad set of users <i>and</i> will be maintained for years.</div><div><br></div><div><br></div><div>It sounds like you might be interested in <a href="https://github.com/mozilla/tofino">Project Tofino</a>'s "User Agent Service":</div><div><br></div><div><a href="https://160.twinql.com/different-kinds-of-storage/">https://160.twinql.com/different-kinds-of-storage/</a></div><div><br></div><div><br></div><div>which provides a separate service for storing data for the browser. We're building a general-purpose relational store that's explicitly intended to support multiple concurrent consumers with evolving schema, persistent history, and that sort of thing — problems that Places wasn't really intended to solve.</div><div><br></div><div>Some further reading (more blog posts on this coming in the next week or so):</div><br class="gmail-Apple-interchange-newline"><a href="https://github.com/mozilla/datomish-user-agent-service">https://github.com/mozilla/datomish-user-agent-service</a></div><div class="gmail_quote"><a href="https://github.com/mozilla/datomish/">https://github.com/mozilla/datomish/</a><br><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>PS.  My goal is to produce the programming environment that would permit me to make making changes to large codebases much easier in general.  A key part of that environment is the organizer/planner that I have cobbled up in ESR45.  It needs to be greatly improved.  ESR45 goes away in March 2017.  I can’t program at all without externalizing my memory in this fashion so I must have a solution by then. Other people do the same — I’m not alone in this need.  See the “Get Things Done” book for an example of this.</div></div></blockquote><div><br></div><div>I'm not sure how this ties in to Places or Firefox — are you using bookmarks and tags as an organizer?</div><div><br></div><div>Regardless, I think this discussion might have reached the edge of what's relevant for <a href="mailto:firefox-dev@mozilla.org">firefox-dev@mozilla.org</a> — which has a pretty broad distribution — but I'd be very happy to continue this discussion with you off-list.</div></div></div></div>