incubator-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 13:59:13 GMT
> On Wed, Dec 8, 2010 at 13:34, He Shiming <> wrote:
> An example: this app has two users, you and me. Documents:
> {"_id": "dirkjan", "name": ["Dirkjan", "Ochtman"], "type": "user"}
> {"_id": "he", "name": ["He", "Shiming"], "type": "user"}
> Now I can easily build views that take the "document type" into
> account (get all users), and I can easily make an atomic update of all
> information related to one user.
> Hope that helps,
> Dirkjan

Thanks again for clarifying. So this is one database per project, and
inside this database, everything is flat document. Each user has one

Now if each user has several blogs, each with several articles, do
these information fit into the user document? Or do I create separate
documents, with "type" field set to either "blog" or "article"?

Most apps are user-oriented. Everything is tied to a user. Does that
mean everything related to this user fits into the user document? Will
this approach introduce any difficulty later on?

Best regards,
He Shiming

View raw message