It seems you cannot embed databases in CouchDB. How do people deal with this limitation? For example, suppose I want to create a blogging mechanism in which each domain has a separate database. In each database, I may need the Users database, Orders database, etc., to contain various user documents, order documents, etc.
The obvious way is a flat structure in which the database name demarcates the artificial boundary between the nesting levels of the database with a hyphen:
myblog.com-users
myblog.com-posts
myblog.com-comments
anotherblog.com-users
anotherblog.com-posts
anotherblog.com-comments
...hundreds more...
Another solution would be to keep the databases at a lower level and mark each document with a top-level value:
user document containing User1 with instance = "Test" or field = "myblog.com"
source
share