couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oguzhan Eris <e...@ekls.com>
Subject Replication Question
Date Fri, 01 Oct 2010 21:09:31 GMT
I'm trying to find some more information on how exactly replication
"fits-in" with things like validation functions.

My question is based on the following scenario.

Have a cluster of cross replicating couchdb's where each can be
written to independently.

If a big network outage causes the clusters to be split,  the
databases will continue to work on their side of the network and
replicate to the ones they can access to.  So in this split brain
scenario, we are likely to have conflicts when the network outage is
restored.

What I'd like to be able todo is, control replication through a
validation function which is as simple as   if (oldDoc &&
oldDoc.lastModifiedTime < newDoc.lastModifiedTime) { throw(forbidden)}

Assuming timestamps are always in sync and lastmodifiedtime represents
the time the doc was last updated by the respective system, all I want
is to not have a document be replicated to my instance if I have a
newer copy.

I have tried various ways to mimic this behavior but I really can't
tell if it's working and whether replication updates run through a
validate_doc_update.

I realize I can detect a conflict later and do something about it, but
I really would prefer not to have conflicts at all and deal with them
on-update instead of post-update.

Thanks

Mime
View raw message