Book Image

Learning NServiceBus - Second Edition

By : David Boike
Book Image

Learning NServiceBus - Second Edition

By: David Boike

Overview of this book

Table of Contents (18 chapters)
Learning NServiceBus Second Edition
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Persistence concerns


Storing saga data depends upon a saga persister that is able to translate our C# classes into a data store and back again. Because the different persistence mechanisms behave in wildly different ways, this introduces some behavior that we need to be aware of when creating our saga data classes.

We won't really discuss in-memory persistence because it is not fit for production use, and because by just storing the object in memory, it really doesn't have to do much of anything. However, we do need to mention a few things about RavenDB and NHibernate.

RavenDB

RavenDB is a document database that serializes C# class structures to JSON and then stores that JSON in its data store, identified by an ID. This makes it capable of storing a potentially complex object graph without a lot of hassle.

However, one implementation detail of RavenDB is that while storing or loading a document by its ID is a fully transactional operation, querying by any other document property is not. This...