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?