While CouchDB has no built-in concept of relationships between
documents, there are some techniques you can use to model relationships in
your documents and views. The CouchDB Wiki page on Modeling Entity
Relationships in CouchDB and Google’s Modeling
Entity Relationships article were used as a reference for this
section. If you’d like to compare the following examples to a relational
database, please reference the column descriptions for the
publisher (Table 5-1),
book (Table 5-2),
author (Table 5-3), and
book_author (Table 5-4).
Table 5-1. Column descriptions from the publisher table
Table 5-2. Column descriptions from the book table
Table 5-3. Column descriptions from the author table
Table 5-4. Column descriptions from the book_author junction table
The relational database design outlined here is intended to make it easy for you to translate between the equivalent SQL and CouchDB queries. This is not necessarily a recommended database design. ...