Storage providers
Where data is stored, and replacing the file system provider.
The file system provider
By default NetlyDB stores everything - WAL files, snapshot generations, index generations and file content - on the
local file system under StorageRoot. It is the provider the engine's durability guarantees are stated and
tested for.
Replacing the provider
UseStorageProvider<T>() selects a different IStorageProvider. A provider declares its
capabilities - durable flush, atomic replacement, append, conditional write, exclusive lease - and writable startup
refuses a provider that cannot meet what the engine requires, instead of running with weaker guarantees than it claims.
- durable flush
- atomic replacement
- append
- conditional write
- exclusive lease
// The default provider is the local file system under StorageRoot.
builder.Services.AddNetlyDB(o => o.StorageRoot = "/var/lib/myapp/netlydb");
// A custom provider implements the storage-provider contract and is selected on the builder.
builder.Services.AddNetlyDB()
.UseStorageProvider<MyStorageProvider>("root");
Azure Blob Storage
The bundled AzureBlobStorageProvider is read-only: it is supported for reading, backup and
experimentation, and a writable start on it is refused. It needs the Azure.Storage.Blobs package in your
application.
Roadmap
Writable remote providers need a lease-based ownership protocol that does not exist yet. Storage-provider expansion is Planned roadmap work.