Efficiently accessing documents

When a document is loaded from RavenDB, all of the data is retrieved at once. In many cases, this is extremely optimal. For example, when we need to render the invoice in our hypothetical accounting system or a page in our Wiki, it only requires one request to the database. In the relational model, it would have taken multiple queries or joins that duplicate data.

The fastest way to load a document is to retrieve it by key. When retrieving by key, RavenDB can go directly to the data store and pull the document out quickly. Your data model should be designed to match the key used within the application code to the key used in the database. For example, in an ASP.NET MVC application the URL route can correspond directly ...

Get RavenDB High Performance now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.