I will be giving a presentation on Entity Relationships in a Document Database at CouchConf Boston on May 15th. The talk description:
Unlike relational databases, document databases like CouchDB and Couchbase do not directly support entity relationships. This talk will explore patterns of modeling one-to-many and many-to-many entity relationships in a document database. These patterns include using an embedded JSON array, relating documents using identifiers, using a list of keys, and using relationship documents.
Additionally, this talk will address how each entity relationship pattern equates to its equivalent in a relational database. I’ll be discussing the relevant differences between document databases and relational databases such as:
- Document databases do not have tables
- Each document can have its own schema
- There is no built-in concept of relationships between documents
- Views/indexes are queried directly instead of being used to optimize more generalized queries
- A column within a result set can contain a mix of logical data types
- There is typically no support for transactions across document boundaries
This talk is based on the MapReduce Views for SQL Users chapter that I’ve added to the second edition of Writing and Querying MapReduce Views in CouchDB.