Q:

couchDB - correct way to model bookmark data?

I'm learning couchDB ,and decided to build a bookmark manager as a practice project.
I'm a little stuck in RDBMS ways of thinking and keep wanting to creat documents as if they were tables.
So I'm wondering if this approach is "correct" in terms of using document database like couchDB?
Each document contains user data, I name the document user12345612345.json and then structure the data inside like this:
{
     "username":"todd",
     "password":"hSnxS987sDJf77600sHjdyDhskJShdskshjS75sa765sa"
     "bookmarks":
                  [
                       {
                       "url":"http://www.hello.com",
                       "title":"Hello website"
                       },
                       ... etc...
                  ]
}

So, I am storing all bookmarks for one user in a single document. That way, I can load this on login, and manage the data, and if there is an update, I update that one document.
I'm thinking with a number of users, if I stored each bookmark as a document, that would be zillions of documents that would need to be indexed by user - not sure that would be the right approach.
My next step is to add folders and tags. I'm thinking I would simply add those arrays into this user document.
Right?

A:

You are doing the right thing. The biggest mental step you need to take when moving from structured to "less structured" is that you keep object properties together. So if a user is unique and bookmarks are associated to that user, keep the user and the bookmarks together like you are doing now.
Same for your users and tags. Think about what you are doing in your applications. Probably you would like to retrieve a user with his bookmarks, tags, folder, etc in just one call instead of going over several tables, joins, etc. That's the beauty of NoSQL. ;-)

