couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: replication - use new data only after successfull replication
Date Wed, 13 Jun 2012 08:56:17 GMT
CouchDB's ACID properties apply at the single document level for this
reason (among others). The replicator has some parallelism and so the
order of updates on the target will not always match that of the
source. There is also no transaction around a replication process (by
design). Another reason for this decision is so that the semantics of
the database remain the same when clustered or sharded (as is done in
BigCouch today and in  CouchDB after the BigCouch merge).

As Dave suggests, you should place data in the same document if you
want it to be updated atomically. This is also why applications are
typically stored in a single design document.

B.

On 13 June 2012 08:08, Dave Cottlehuber <dave@muse.net.nz> wrote:
> On 13 June 2012 06:55, R. Germershausen <ralph.germershausen@foresee.biz> wrote:
>> hi. is there any way to make couchdb only usind new data after
>> successfull replication?
>> for example: during replication a document is deleted. replication is
>> interrupted. but there is another document (old version) which i use to
>> generate a navigation. so this would point to a non existing document.
>> can i somehow prevent this? so only use new data when replication is
>> fully done?
>
> Not directly.
>
> I think the best approach if this is an issue is to see if you can
> bundle up these
> changes into a single document - for example put these navigation items as
> attachments into a single doc, or as part of a design document, so that
> it's transferred atomically.
>
> Alternatively you can always do specific doc replication by passing a set of
> ids to the replicator, and then run a normal replication as a second phase:
>
> http://wiki.apache.org/couchdb/Replication#Named_Document_Replication
>
> A+
> Dave

Mime
View raw message