Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 96138 invoked from network); 6 Nov 2010 10:30:43 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Nov 2010 10:30:43 -0000 Received: (qmail 20523 invoked by uid 500); 6 Nov 2010 10:31:13 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 19624 invoked by uid 500); 6 Nov 2010 10:31:09 -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 19005 invoked by uid 99); 6 Nov 2010 10:31:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Nov 2010 10:31:07 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of karel.minarik@gmail.com designates 209.85.214.52 as permitted sender) Received: from [209.85.214.52] (HELO mail-bw0-f52.google.com) (209.85.214.52) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Nov 2010 10:30:59 +0000 Received: by bwz6 with SMTP id 6so3188529bwz.11 for ; Sat, 06 Nov 2010 03:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=HYKa6NPv37AS1XX+ca5Rrh0yIwU21o9gUNAriqau/XA=; b=OW/+QE/EkiDH8emnrhsS9bYfX3u+elEyZHAxq3eUnfa3nJ9SmPchaJIf3TxhE0Up/4 VvuX84vmkmZOKlbZ7d14efY8wDF7QFPVe5EIa/o/u/0fm8VzmfAifv7sBCN5gowz4Lrd vpmJkZYhZZhft+Dot1cDsMt+i6XU+ZCCCWzKs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=rTy4xJo/Xp1KDR+SMVsIaSYvd5x/k41Ta+dewK0pHknRMxohyiKhaLwSQ3B8S+mU8O AfX4OnXHMvDM6PJCP5zQ1fWncJjQ+7wqMuksGY8DhsbUWDwW+G9lb41eiufT2N7bnf3y cMvA6oEEGUyMy8xIN2ecUAMWxPSEtd5v+arJ8= Received: by 10.204.124.14 with SMTP id s14mr2843808bkr.21.1289039438058; Sat, 06 Nov 2010 03:30:38 -0700 (PDT) Received: from [192.168.2.104] (a40-prg1-10-118.static.adsl.vol.cz [88.146.57.118]) by mx.google.com with ESMTPS id f21sm1832458bkf.12.2010.11.06.03.30.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 06 Nov 2010 03:30:35 -0700 (PDT) Message-Id: <173F866C-8CB5-41A3-B823-7C99F5CD58FB@gmail.com> From: =?UTF-8?Q?Karel_Mina=C5=99=C3=ADk?= To: user@couchdb.apache.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Why use multiple databases ? Date: Sat, 6 Nov 2010 11:30:33 +0100 References: X-Mailer: Apple Mail (2.936) Hello, kinda late, but better then never :) > (1) What kind of issues do you take into consideration when deciding > if certain types of documents should go into their own database ? Mainly the impossibility of map/reduce views to work accross databases. If you split data into separate dbs, and you need some reporting accross all those "accounts", you have to do some replication (of a subset of docs) into some "common" database. The same applies to fulltext indexing such as CouchDB-Lucene. > (2) Are your decisions based on performance, security or some other > considerations ? We have a media monitoring application and have decided to put data for every application account into a separate database, mainly because: * It simply much cleaner this way :) (NB: you can name your dbs like "someprefix/dbname", and this is also the path on the disk.) * We are able to make the db accesible to the account _directly_ by mapping in a frontend webserver. So they are able to use the "raw data", not only the application API. We consider this to be the main benefit. * We earn an additional layer of security for free with this setup, which is nice. * We are able to very quickly and easily check sizes of dbs, view files, etc of accounts, eg. just by looking int Futon for the most cases * It would be rather easy (or so we think :) to "manually shard" the data accross different machines (eg. accounts A-M go to machine S1, N- Z to machine S2, etc) > (3) What else should I be asking you - if I was not a noob ;?) Well, maybe just providing the context of your app. I'd say anywhere where you have something like "user inboxes", or something like "every user/account has their own data and we don't need to query accross them" (our case) is a good candidate for separate dbs. Karel