<div dir="ltr">Hi Even,<div><br></div><div>the aim is to sync data between masters as per - <a href="http://dataprotocols.org/couchdb-replication/">http://dataprotocols.org/couchdb-replication/</a> An example would be using GDAL in QGIS and going offline to edit data and then coming back online, the user would need to synchronize the dataset. As replication is a core part of CouchDB I would like to add it to the CouchDB OGR Driver.</div><div><br></div><div>Synchronizing at the database opening is a great idea, that makes sense.</div><div><br></div><div>LevelDB would be a new GDAL dependency for the CouchDB driver, the GeoJSON will be persisted in leveldb so that subsequent connections to a couchdb database would only retrieve any changes to an upstream CouchDB server. LevelDB is under the BSD license. LevelDB is used in PouchDB so it is relatively easy to follow that code. I would aim to abstract leveldb behind a OGRCouchDBCache class so that this storage engine could be changed.</div><div><br></div><div>Norman</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 4, 2015 at 1:43 AM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Norman,<br>
<br>
I'm not familiar with what this "sync" is about, so please bear with the naive<br>
questions.<br>
Is it to synchronize all masters between them ?<br>
Why GetFeature() and/or not at the first GetNextFeature(), or at database<br>
opening ?<br>
What is the persistence you mention, and what is the connexion with the sync<br>
you mention ? Is it done at client (OGR) side ? Would leveldb be a new GDAL<br>
dependency ?<br>
<br>
Even<br>
<div class="HOEnZb"><div class="h5"><br>
> Hi,<br>
><br>
> I am looking to add sync to the GDAL CouchDB driver. I would rather not add<br>
> additional API functions to do this but to wrap it up in the<br>
> usual GetFeature call. The first call to GetFeature would initiate a sync,<br>
> but thoughts on this are appreciated.<br>
><br>
> Sync is a useful function that is a key differentiator with CouchDB which<br>
> is a multi-master database.<br>
><br>
> There are a couple of ways of doing the sync, I could force a whole<br>
> database sync (the CouchDB model) or we could do a filtered sync based on<br>
> the bbox of the current local dataset. I would do the former in the initial<br>
> implementation.<br>
><br>
> As for the persistence, I would like to use leveldb as a local store though<br>
> I could use sqlite. The two schemas are as follows;<br>
><br>
> <a href="https://github.com/pouchdb/pouchdb/blob/master/lib/adapters/idb/idb.js#L56" target="_blank">https://github.com/pouchdb/pouchdb/blob/master/lib/adapters/idb/idb.js#L56</a><br>
> <a href="https://github.com/couchbaselabs/TouchDB-iOS/wiki/Object-Design-And-Schema" target="_blank">https://github.com/couchbaselabs/TouchDB-iOS/wiki/Object-Design-And-Schema</a><br>
><br>
> I will be create a PR on this shortly, but I am interested in any early<br>
> feedback.<br>
><br>
> Norman<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a><br>
</font></span></blockquote></div><br></div>