concept operation in category ravendb

appears as: operations, operation, operations, n operation
RavenDB in Action

This is an excerpt from Manning's book RavenDB in Action.

Being schema-free also means reads are a lot faster than relational databases, because usually most read operations concentrate on one document. Reading one document is tremendously faster than doing a relational join over two or more tables. We’ll demonstrate this when we discuss document-oriented modeling in chapter 5.

One way of doing so is by referencing one document from another, by specifying it’s ID. If the two are of completely different domain entities (a Product and a Customer, for instance), then it makes the most sense to just link to one document from another, using a simple string property in the referencing document. Once a document has been referenced, you can use Includes to make read operations more efficient. It can also be used from indexes, as we will see later.

#A – We want to retry the operation multiple times #B – Loading the document after opting-in for Optimistic Concurrency. This is required on a session basis. #C – Making the change to the document, with all required business logic #D – Persisting the changes – this will throw a ConcurrencyException which we catch and retry #E – The change was persisted successfully, so we can break out of the retry loop