Raven DB is a high-performance document database. Both local and cloud instances/clusters are supported. Redakt offers Raven DB integration through a NuGet package.
Installation
The Raven DB database module is part of the Raven DB provider package. Install the package with the NuGet package manager or the Package Manager Console.
PM> Install-Package Redakt.Providers.RavenDb
Service registration
Register Raven DB services in the ConfigureServices()
method of your project's Startup.cs
file by adding an AddRavenDbDataStore()
call to the Redakt builder instance. The order in which services are added to the Redakt builder is not important.
public void ConfigureServices(IServiceCollection services)
{
// ... framework and other services here
var builder = services.AddRedakt();
builder.AddRavenDbDataStore(); // Optionally pass Action<RavenDbOptions> parameter.
// ... other Redakt services
}
Configuration settings
The Raven DB database module is configured through the appsettings.json
file. All configuration settings are required. See the example below.
{
"Redakt": {
"DataStore": {
"RavenDB": {
"DocumentStoreUrl": "<your raven db store url>",
"Database": "<your raven db database name>"
}
}
}
}
Additionally, an Action<RavenDbOptions> configuration delegate may be passed to the AddRavenDbDataStore() call. Configuration set through this delegate overrides values in the appsettings.json file.
Document Store Url
Required. Sets the URL to the Raven DB instance/cluster in URI format.
Database
Required. Sets the Raven DB database name. A Raven DB database is not automatically created by Redakt, therefore a database has to exist before starting your Redakt application for the first time.