couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From He Shiming <>
Subject Re: Database design with CouchDB
Date Wed, 08 Dec 2010 12:34:47 GMT
On Wed, Dec 8, 2010 at 8:17 PM, Dirkjan Ochtman <> wrote:
> That's not the way I do it with CouchDB. I would either use a
> per-application database or a per-user (per-project?) database,
> depending on the kind of data you want to put in. For example, if you
> have an app where users really only see their own data, and there's a
> lot of it, you might want to have a per-user databases.
> For my per-application databases, I just have user documents that have
> some marker (I use a "type": "user" property on the documents,
> usually). That is, each document specifies it's own type (that is, the
> table it would have belonged to in your SQL-based database), and you
> might for example have a design document per document type. A user
> document will have the name, password and full profile.
> Cheers,
> Dirkjan

So one database for one project, and one document for a kind of data
huh? That's very helpful, thank you very much.

One follow up question. Why do you use marker fields for each
document, as opposed to just use "user" as the key for the "user
document"? Does this have any advantage in view design?

Best regards,
He Shiming

View raw message