Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 71315 invoked from network); 29 Jan 2010 06:41:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Jan 2010 06:41:28 -0000 Received: (qmail 8173 invoked by uid 500); 29 Jan 2010 06:41:27 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 8036 invoked by uid 500); 29 Jan 2010 06:41:27 -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 8026 invoked by uid 99); 29 Jan 2010 06:41:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jan 2010 06:41:26 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of kevin@meebo-inc.com does not designate 74.125.78.26 as permitted sender) Received: from [74.125.78.26] (HELO ey-out-2122.google.com) (74.125.78.26) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jan 2010 06:41:14 +0000 Received: by ey-out-2122.google.com with SMTP id 4so599741eyf.41 for ; Thu, 28 Jan 2010 22:40:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.86.206 with SMTP id w56mr260386wee.1.1264747253491; Thu, 28 Jan 2010 22:40:53 -0800 (PST) In-Reply-To: <56a83cd01001282237j21e2f68fi4fb53e507d852ed2@mail.gmail.com> References: <56a83cd01001281541n17735fecn2cdd3222a1858a@mail.gmail.com> <61E99071-7F5E-4F3A-9DD6-8CACE5A968AE@desaintmartin.fr> <56a83cd01001282233r6c5abf63i3c280525c9a215da@mail.gmail.com> <56a83cd01001282237j21e2f68fi4fb53e507d852ed2@mail.gmail.com> Date: Thu, 28 Jan 2010 22:40:53 -0800 Message-ID: <23c535ff1001282240nd7fb2b8s22c48cf322d0c9c8@mail.gmail.com> Subject: Re: Time machine backup while CouchDB running? From: Kevin Ferguson To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0016e6d783fcc66745047e47ea66 X-Virus-Checked: Checked by ClamAV on apache.org --0016e6d783fcc66745047e47ea66 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable David, check out this preso-- it should explain how the CouchDB storage engine works in a bit more detail. http://jchrisa.net/drl/_design/sofa/_show/post/How-CouchDB-Treats-the-Disks Kevin On Thu, Jan 28, 2010 at 10:37 PM, David Van Couvering < david.vancouvering@gmail.com> wrote: > Thinking further on this: I think one difference is with Derby each table > is > its own file. Since you need to maintain relational consistency in a SQL > DB, this is a problem if you're copying lots of table files while > transactions are in flight. Sybase could be a single file (or raw device= ), > or it could be split across multiple devices for better throughput, so > again > you have potential consistency problems (plus I think you tended to back = up > through a special API, as standard file copy doesn't work on raw devices)= . > > I guess in CouchDB since it's a single file, *perhaps* you don't have the > same issues around maintaining consistency... > > On Thu, Jan 28, 2010 at 10:33 PM, David Van Couvering < > david.vancouvering@gmail.com> wrote: > > > Well, that's true of any database, but for most databases if you try to > > take a "snapshot" of a db file while it's running, chances are pretty > good > > you're not going to like what you get. More often than not a transacti= on > > will have been half-written to the file when you "grab" it and back it > up. > > And as we all know, the only thing worse than finding a worm in an app= le > is > > finding half a worm... > > > > That's why "online backup" is a key feature requirement for any databas= e > > worth it's salt. We had to implement it for Sybase, and we had to > implement > > it for Apache Derby. > > > > What I'm hearing here is because the way CouchDB works (I'm not sure I > > fully grok it), at any point you take a copy of the db file, it's in a > > consistent state. I guess what this means is each document is written = as > a > > single atomic write, so you can't end up with half a document in your > > backup. > > > > I know you've told me this works, but call me paranoid - is that really > > true? What if the document is umpteen gajillibytes long? Is it still > > written as a *single atomic write* to the disk? Do you all lock the fi= le > > each time you do a write? Does Time Machine lock the file from writes > the > > whole time it's reading it/taking a snapshot of it? Just want to make > > really sure we're all on the same page here. > > > > Thanks, > > > > David > > > > > > On Thu, Jan 28, 2010 at 9:51 PM, de Saint Martin C=E9dric < > > cedric@desaintmartin.fr> wrote: > > > >> Tell me if I'm wrong, but CouchDB's databases are stored in > files. > >> So if you backup all these files, there is no risk of corrupting your > data. > >> Conclusion : TimeMachine will work. > >> > >> > >> On 29 janv. 2010, at 00:41, David Van Couvering wrote: > >> > >> > Anyone know if a TimeMachine backup of a running CouchDB will work, = or > >> is > >> > there a likelihood of corruption? > >> > > >> > -- > >> > David W. Van Couvering > >> > > >> > http://www.linkedin.com/in/davidvc > >> > http://davidvancouvering.blogspot.com > >> > http://twitter.com/dcouvering > >> > >> > >> > > > > > > -- > > David W. Van Couvering > > > > http://www.linkedin.com/in/davidvc > > http://davidvancouvering.blogspot.com > > http://twitter.com/dcouvering > > > > > > -- > David W. Van Couvering > > http://www.linkedin.com/in/davidvc > http://davidvancouvering.blogspot.com > http://twitter.com/dcouvering > --0016e6d783fcc66745047e47ea66--