PM7: Data Modeling for Document and Graph NoSQL Databases
Share this Session:
  Mike Bowers   Mike Bowers
Enterprise Data Architect
LDS Church


Monday, April 3, 2017
01:30 PM - 04:45 PM

Level:  Intermediate

Relational data modeling has several weaknesses. It shreds the data in a business entity into multiple tables. Queries and views must be used to reconstitute business entities, and this slows performance and complicates development, because normalized data does not match the business-defined objects in applications. Sparse data is hard to represent in relational models. Complex relationships (such as networks and hierarchies of data) are hard to represent and are slow to query. Search is difficult, because data is shredded into tables deliberately to remove context.

Document modeling combined with graph modeling solves these problems and creates a powerful new data modeling paradigm. A document naturally represents a business entity with all its core one-to-many and many-to-many relationships embedded in the document. This greatly speeds query performance and simplifies development, because the data in the database directly matches the business-defined objects in applications.

JSON is the core data model of web services, and JSON is a document model. Document databases can directly store and retrieve JSON without modification, which makes web services very easy to develop. Document modeling by itself is insufficient, though, because we still need to express relationships between business entities.

Graph modeling enables documents (i.e., business entities) to be related to each other and to transaction entities. The graph model turns relationships into explicit data (as opposed to implicit foreign keys in the relational model). This makes the relationships themselves query-able, and it makes it possible to query for patterns in the relationships, such as a mother of a father is a grandmother, and so is the mother of a mother. It also enables your code to traverse graphs to find complex patterns and make complex decisions quickly.

Combining document modeling with graph modeling creates a document-graph model. This is similar to a property graph model except that it is much more powerful. A property-graph model is limited to relating a flat list of properties in one entity to a flat list of properties in another entity. The problem is that a business entity is too complex to be represented as a flat list of properties. The document-graph model enables you to connect true business entities to each other and to their transactions in any way imaginable.

This class will show you how to do document-graph modeling. Several databases make this document-graph modeling possible including Oracle, Cassandra, MarkLogic, and OrientDB. You can also combine different databases to make this possible, such as combining MongoDB and Neo4J.

Michael Bowers is principal enterprise data architect at the LDS Church. He has spent over 20 years as an enterprise architect, software developer, and database architect.

In 2008 Michael brought the MarkLogic NoSQL database to LDS. Today it delivers 1.8 TB of data to 95 million annual visitors with billions of page hits across 182 websites, transactional applications, and web services.

Close Window