Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CB7CB3FC1 for ; Wed, 4 May 2011 16:32:42 +0000 (UTC) Received: (qmail 86271 invoked by uid 500); 4 May 2011 16:32:41 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 86237 invoked by uid 500); 4 May 2011 16:32:41 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 86229 invoked by uid 99); 4 May 2011 16:32:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2011 16:32:41 +0000 X-ASF-Spam-Status: No, hits=-1.4 required=5.0 tests=FS_REPLICA,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of john.poyau@lmco.com designates 192.31.106.12 as permitted sender) Received: from [192.31.106.12] (HELO mailfo01.lmco.com) (192.31.106.12) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2011 16:32:31 +0000 Received: from mailgw1a.lmco.com (ppalertrelay.lmco.com [192.31.106.7]) by mailfo01.lmco.com (8.14.3/8.14.3) with ESMTP id p44GW8Wo019380 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 4 May 2011 17:32:09 +0100 Received: from emss07g01.ems.lmco.com (relay5.ems.lmco.com [166.29.2.16])by mailgw1a.lmco.com (LM-6) with ESMTP id p44GW8Oi013084;Wed, 4 May 2011 10:32:08 -0600 (MDT) Received: from CONVERSION2-DAEMON.lmco.com by lmco.com (PMDF V6.4 #31805) id <0LKO00G01J9KUU@lmco.com>; Wed, 04 May 2011 16:32:08 +0000 (GMT) Received: from hvxhtpn5.us.lmco.com ([158.186.148.34]) by lmco.com (PMDF V6.4 #31805) with ESMTP id <0LKO00B9NJ98KZ@lmco.com>; Wed, 04 May 2011 16:32:03 +0000 (GMT) Received: from HVXMSP8.us.lmco.com ([158.186.148.55]) by hvxhtpn5.us.lmco.com ([158.186.148.34]) with mapi; Wed, 04 May 2011 12:32:01 -0400 Date: Wed, 04 May 2011 12:32:00 -0400 From: "Poyau, John" Subject: RE: EXTERNAL: Re: Document Timestamp On Replication In-reply-to: <4DC17B73.3010407@facilityone.com> To: Owen Marshall Cc: "user@couchdb.apache.org" Message-id: <9946CE35511F1449ADF88A3F647DFE2816B07BEDD5@HVXMSP8.us.lmco.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-language: en-US Content-transfer-encoding: 7BIT Thread-Topic: EXTERNAL: Re: Document Timestamp On Replication Thread-Index: AcwKdnq3FMIVpvIXTIab0aSTDEOkMwAAF3XA Accept-Language: en-US acceptlanguage: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: References: <9946CE35511F1449ADF88A3F647DFE2816B0602907@HVXMSP8.us.lmco.com> <4DC067DD.5070508@facilityone.com> <9946CE35511F1449ADF88A3F647DFE2816B06F1724@HVXMSP8.us.lmco.com> <4DC163B2.10502@facilityone.com> <9946CE35511F1449ADF88A3F647DFE2816B06F1FA1@HVXMSP8.us.lmco.com> <4DC17B73.3010407@facilityone.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2011-05-04_07:2011-05-04,2011-05-04,1970-01-01 signatures=0 X-Virus-Checked: Checked by ClamAV on apache.org Owen, Thank you for all replies. I answered inline -----Original Message----- From: Owen Marshall [mailto:omarshall@facilityone.com] Sent: Wednesday, May 04, 2011 12:15 PM To: user@couchdb.apache.org Cc: Poyau, John Subject: EXTERNAL: Re: Document Timestamp On Replication On 05/04/2011 11:29 AM, Poyau, John wrote: > -We want to keep track of the time that a document is added/updated in > a source database Then you definitely want an updated field per-document. Implementing this varies with your needs. You could use a single timestamp that gets clobbered each time, if you don't need a huge auditing trail. You could also do a list of timestamps if it would prove helpful. One other technique that I'm especially fond of is to store changes as attachments to each document. This gives you great audit trails -- who made what change when. You could go so far as to store the full document state before the change. But if you don't need that level of auditing, a timestamp field is the way to go. > -We want to keep track of the time that a document get replicated to a target databases on replication. Don't. Don't don't don't. But because I hate it when the answer is "you're doing it wrong" and nothing else, some notes: * You will definitely want to separate the replication time from the update time (as they clearly aren't the same thing.) * Further, that *cannot* go in the document, clearly. I know, I was planning on using a separate document to track update_timestamp. * You'd need at a minimum filtered/named replication to send the documents you want, and an update handler to put the "replicated time" in some other document. Again though, you never answered the simple question of *why* you want to know this. Let me be clear: what you are trying to do adds a bunch of complexity to your documents, your replication, and your program. And I'm not sure why you want to do it so badly. I am implementing a spec that requires a update_timestamp that tracks the time any change to the document including when it is replicated to a target db. I think you make a good point that an update_timestamp is not exactly the same as the replication_timestamp. What problem do you think you are solving by storing the replicated time? Knowing when the document was added the target database -- Owen Marshall FacilityONE omarshall@facilityone.com | (502) 805-2126