SQL Persistence can store NServiceBus data in multiple different relational database engines, without the need for an intermediate ORM, using only a
DbConnection supplied in the configuration.
- Supports multiple database engines
- No ORM dependency - easily use with Entity Framework, Dapper, etc.
- Independent tables for each endpoint - no "noisy neighbor" problems
- Generates DDL scripts at compile time in the build output directory
- Generated scripts can be promoted outside the build directory and can then be:
- Added to source control
- Compared using a diff viewer
- Inspected by DBAs
- Treated as first-class citizens in operations workflows for installation and deployment
- Sagas are:
The SQL Persistence consists of several Nuget Packages.
This packages installs into the MSBuild pipeline and generates all SQL installation scripts at compile time. It does this by interrogating types (in the target assembly) and attributes (from the
NServiceBus. NuGet package) to infer what scripts to create. It is required for any project where those SQL installation scripts are required. For Saga scripts it will be any project that contains Saga classes. For Timeouts, Subscriptions and Outbox scripts it will be the endpoint hosting project. This package has a dependency on the
NServiceBus. NuGet package
This package contains several parts
- APIs for manipulating
EndpointConfigurationat configuration time.
- Runtime implementations of Saga, Timeouts, Subscriptions and Outbox persisters.
- Attribute definitions used to define certain compile time configuration settings. These attributes are then interrogated by the NServiceBus.Persistence.Sql.MsBuild NuGet Package when generating SQL installation scripts
- Optionally runs SQL installation scripts at endpoint startup for development purposes. See Installer Workflow.
This package contains all APIs that enable the generation of SQL installation scripts using code, i.e. without using the NServiceBus.Persistence.Sql.MsBuild NuGet package.
SQL installation scripts are created at compile time by the
NServiceBus. NuGet package. To learn more see controlling script generation.