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 94FB0D991 for ; Thu, 8 Nov 2012 19:34:38 +0000 (UTC) Received: (qmail 67467 invoked by uid 500); 8 Nov 2012 19:34:37 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 67428 invoked by uid 500); 8 Nov 2012 19:34:37 -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 67420 invoked by uid 99); 8 Nov 2012 19:34:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 19:34:37 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.160.52] (HELO mail-pb0-f52.google.com) (209.85.160.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 19:34:28 +0000 Received: by mail-pb0-f52.google.com with SMTP id rr13so2116775pbb.11 for ; Thu, 08 Nov 2012 11:34:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=pNELD8UNfxTCzi0nESUp7t+FcvjD7pBdPhlI0QmSMOM=; b=Jl5z74p8PCdbrf6TP3m/tMz93pR0oaxWeRB2Aycx8stZ6YK/nbJxPU6N6CLpuI7WVD 4VI/7Dn+cvZp3bZ6r4hucjJB2186r5ZufhQggG55FDwNaIiSSNGl51zTKcSBvtmHIoC3 tFIYr2KZgTSPNNpE0mSRFgCuz5ZmfugTYP/x/fW6Nzkb58YPYGnLtJRlvX2pwo+eROtd QtuZY1/A/SqaUAgUfDgH8r/UNiVo57qQwLapVmf/rje7ItjPETV2DUC9O2Exs28wrSIr Xpv1DLjCe5jwNs7+oznATHPgiKUCBtcYoYt/k7dHRxfTYEM2yuasGNz8B1nrsMdR8bH1 xmcQ== Received: by 10.68.218.97 with SMTP id pf1mr26751316pbc.96.1352403248220; Thu, 08 Nov 2012 11:34:08 -0800 (PST) Received: from [192.168.13.21] (71-84-176-101.dhcp.mdfd.or.charter.com. [71.84.176.101]) by mx.google.com with ESMTPS id zv10sm16367034pbc.76.2012.11.08.11.34.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Nov 2012 11:34:07 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1283) Subject: Re: Adding fields to _user db From: Nathan Vander Wilt In-Reply-To: <20121005091019.7e166a00@svilendobrev.com> Date: Thu, 8 Nov 2012 11:34:05 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <1B2FEF1C-621B-4D9C-B501-4507425000C3@calftrail.com> References: <20121005091019.7e166a00@svilendobrev.com> To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1283) X-Gm-Message-State: ALoCoQkvQ4v1wMY3j47kinP0N9BGEJyDczldvtdtdXNf29Rss91fTWwPmmjKxeidx1mZjW2zDYvG X-Virus-Checked: Checked by ClamAV on apache.org The built-in validation function prevents you from storing *other* = document types in the _users database. I don't know of any problems, in = practice, to storing additional fields *within* user documents. You = should prefix them (or isolate them within an app-specific key) however, = to avoid issues should CouchDB assign a future meaning to a field name = you picked. The catch, though, is that these fields will not currently be passed via = the "userCtx" field to validation, filter, show/list, etc. functions as = you might expect. There was some discussion of this at one point, and = perhaps a JIRA ticket was filed, but if you need to pass additional data = to design doc functions you'll need to resort to creative use of the = roles array for now ;-) regards, -natevw On Oct 4, 2012, at 11:10 PM, svilen wrote: > +1 on the question >=20 > i am still undecisive whether to use _users (and put all profile > data there), make separate db, and live with the ~joins, or use > completely separate (~already made) non-couchdb thing - in my case = it's > no much difference. >=20 > if internaly it is not any special than other databases, it should be > no big deal storing couple of fields extra.=20 > syncpoint is using it this way.=20 >=20 > But i dont know about overdoing it, say adding attachments e.g. photo? > will that screw anything?=20 >=20 > i am thinking that if it gets too big it will be because of number of > users not because single user-data is big. but i may be wrong.. >=20 > svil >=20 >=20 > i intend to do same anyway. > On Fri, 5 Oct 2012 03:49:52 +0200 > Wordit wrote: >=20 >> I've read before that you are not supposed to store any other data in >> the _users database except what's already there. Thing is, I need to >> use a nickname for users since their email address is their username >> (that's what BrowserId, Google OpenID etc use). >>=20 >> Adding a nickname field should be the easiest way to hide their >> email/username. I've tried creating a hash of the username in a >> profile document and storing the nickname there, but it makes things >> very complex (e.g. see my post about CommonJS) and uses more >> resources. >>=20 >> Design-wise it makes most sense to me to store the nickname in the >> _users db since this is directly related to the user's identity. = Their >> actual username, being an email address, needs to be hidden. Is there >> a good reason not to do this? >>=20 >> Marcus