O'Reilly logo

RavenDB High Performance by Brian Ritchie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Data modeling by example

To better understand document modeling, let's walk through an example. We are designing a Wiki that consists of spaces, pages, comments, attachments, and tags. In a relational world, it would be modeled like the following:

Data modeling by example

But, we are not in a relational world. So, let's look at this from a document perspective. Which entities in the preceding model above are aggregates? Users, spaces, and pages each have the right to exist independently. Tags, comments, and attachments aren't really meaningful outside the context of their page.

In a document database, the data could be modeled as follows (we'll address attachments later): ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required