NServiceBus uses persistence to store saga state, enable the outbox, and support certain transport features.
Features that require persistence
- Sagas
- Outbox
- Subscriptions (storage required if the transport does not support native publish-subscribe)
- Delayed delivery (storage required if the transport does not support native delayed delivery)
- Gateway deduplication
Selecting a persister
It can be a challenge to decide whether or not a persister is needed and which one is the best option for a specific scenario. See the guide to selecting a persister for help in making that decision.
Supported persisters
- SQL
- Microsoft SQL Server
- MySQL
- PostgreSQL
- Oracle
- Amazon Aurora (with MySQL or PostgreSQL) and Amazon RDS
- Cosmos DB
- DynamoDB
- MongoDB
- Azure Table
- NHibernate
- RavenDB
- MSMQ
- Learning
- Non-Durable
Persistence at a glance
The main page for each persistence library includes a Persistence at a glance section that calls out some of the important differences between each option. This section describes what each item means and why it is important.
- Supported storage types: The features that the library supports.
- May include sagas, the outbox, and subscriptions.
- Support for timeouts includes delayed retries and message deferral as well.
- Gateway deduplication is not covered, as the gateway component is a separate package from NServiceBus and has its own persistence packages.
- Transactions: Describes how the persister keeps changes to saga data, outbox data, and business data consistent within message handlers. Persisters with this capability expose the transaction or session through the
SynchronizedStorageSessionproperty ofIMessageHandlerContext. - Concurrency control: Describes how the persistence behaves when multiple message handlers attempt to update saga data simultaneously. Packages that enable pessimistic concurrency offer better performance for sagas implementing a scatter-gather pattern.
- Scripted deployment: Describes how storage prerequisites (such as table schemas) can be deployed as part of a DevOps process.
- Installers: Describes whether the persistence can create storage prerequisites (such as table schemas) at runtime via the installers feature for a smoother development-time experience.