incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Poyau, John" <john.po...@lmco.com>
Subject RE: Document Timestamp On Replication
Date Tue, 03 May 2011 20:54:50 GMT
Owen,

Thank you for your reply.  I am aware of the issue that you mentioned and that is why I posted
my question to list.

One approach that I thought of is to use a separate document to hold the update_timestamp,

these documents would not get replicated (filtered out on replication). Documents that tracks
the update_timestamp would get created using a document update handler as you mentioned.

I posted my question looking to see if there were any another way to track document updates
even through replication. 

Again thank you



-----Original Message-----
From: Owen Marshall [mailto:omarshall@facilityone.com] 
Sent: Tuesday, May 03, 2011 4:39 PM
To: user@couchdb.apache.org
Cc: Poyau, John
Subject: EXTERNAL: Re: Document Timestamp On Replication

On 05/03/2011 10:38 AM, Poyau, John wrote:
> What is the couchdb way of update the documents update_timestamp on replication.

Are you using continuous replication? If so, _don't ever do this_!

If you do, you will likely end up passing the same document back and forth between nodes.
I.E: User pushes doc to node A, node A replicates to node B, node B bumps the update_timestamp,
node A pulls the new document, node A bumps the update_timestamp... repeat ad nauseum.

Even if you aren't using continuous replication, you still _shouldn't do this_! Replicate
your documents and handle conflicts when they happen.

If for some reason you have a truly good reason, you might be able to accomplish this with
update handlers:
http://wiki.apache.org/couchdb/Document_Update_Handlers

But if you are not 100% completely positively sure, I'd urge you to read the excellent CouchDB
guide on replication and on conflicts:

http://guide.couchdb.org/draft/replication.html
http://guide.couchdb.org/draft/conflicts.html

--
Owen Marshall
FacilityONE
omarshall@facilityone.com | (502) 805-2126


Mime
View raw message