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 BA5129DDA for ; Mon, 11 Jun 2012 13:27:30 +0000 (UTC) Received: (qmail 37503 invoked by uid 500); 11 Jun 2012 13:27:29 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 37473 invoked by uid 500); 11 Jun 2012 13:27:29 -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 37465 invoked by uid 99); 11 Jun 2012 13:27:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2012 13:27:29 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dave@muse.net.nz designates 209.85.220.180 as permitted sender) Received: from [209.85.220.180] (HELO mail-vc0-f180.google.com) (209.85.220.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2012 13:27:21 +0000 Received: by vcbfk26 with SMTP id fk26so2443820vcb.11 for ; Mon, 11 Jun 2012 06:27:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muse.net.nz; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=6ED3n3rHvvwJnK5S6PJwITDak36sVoVrGyGvuIJSzNs=; b=EiuZu3Af4h1auej3eBmRdy4PflbYoZCcVEoDh/A4FCFTknZh9E0irbObmJQpauUBjQ t49c6vTSK6JSwl/qbnT57rMkD8Xu2QH9wzSJFVtIYhv53gy2iYbw0SR7uctKXfFcbZX3 fPfceDLET1MxK5jW6g2T/gOCOYuvw7UspBY3s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding :x-gm-message-state; bh=6ED3n3rHvvwJnK5S6PJwITDak36sVoVrGyGvuIJSzNs=; b=J8ySGp/gaqJOyhNSNVMhY3nmn8WFqKRIfT1/P7qjHmWBU8Ug9zCb3Sdjfx2RnQnYyK oAGf8Vvw7cvfXlsr8NsgvJ8PozMYeM3Miz/fAtmDPOY3Ar78Dgu33SujiWDIJOcYoSQN 9yO/o0sWtMYjVQKfwjr6f38wA3Fm63oWCHxwlKbqfWHyaS0zBTyBawVIg1eoRGF7rEr/ rgbocsGa9t0ZNsewPIg1ATo81rh7lwsrGvNjGysiSiOrNJ91Bta6nEZDiHrP3boXeiWW 3LcT43HoU1XEXHbwuVUOLDPQ64sGF+RghdTYBDsykpZC19lcI9pYkicPRLWCa+uqCU5D C1cw== MIME-Version: 1.0 Received: by 10.52.70.242 with SMTP id p18mr10453984vdu.97.1339421220225; Mon, 11 Jun 2012 06:27:00 -0700 (PDT) Received: by 10.52.33.172 with HTTP; Mon, 11 Jun 2012 06:27:00 -0700 (PDT) X-Originating-IP: [84.112.19.176] In-Reply-To: References: Date: Mon, 11 Jun 2012 15:27:00 +0200 Message-ID: Subject: Re: How to split the data over a period of time. From: Dave Cottlehuber To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmg2OBL+oPG+oGwNY2mMVsa3RoTMoWzSNtCvXp3/0BvJm96gf4h/z52/0V45CiP1QQk9e2E On 11 June 2012 14:50, Harikrishnan R wrote: > Hi, > > =A0 =A0 My application uses couch-db for storing events. Daily on an aver= age > my database size increases up-to 4GB. =A0So If I keep the database for 3-= 6 > months my disk space > get reduced. Presumably this happens by CouchDB compaction? Or do you aggregate and then make a summary dataset yourself? > What is the best strategy for > > =A01) taking the backup of couch-db after a period of time. This really depends on what you want to be able to restore, and how frequently you expect to do that. some options: backup of couchdb file only -> able to restore any/all docs from that time, and rebuild views from that= . backup view & db files -> able to switch back to production-ready state without waiting for view rebuilds. This works nicely if you have CoW storage (snapshots). wire up _changes feed to a log file. -> able to retrieve state of doc changes throughout the time period. Consider that compaction will remove data from older revisions, keeping only the revision tree information, to save space. So if history of documents is important then you need to either track chang= es and store them separately, or consider if a simply backup prior to compacti= on is enough. > =A02) how to retrieve the data from backup and from the current on demand= . See above, depends on what / how you want to do. You can restore any couch db file and rename it, the docs will be accessible under the new file= name. > =A03) When to index the documents. Not clear what you mean here? A+ Dave