Browse the documentation

Configuration

NetlyDBOptions and their defaults.

Configuring NetlyDB

Pass a delegate to AddNetlyDB to configure NetlyDBOptions. Every option is optional; the defaults suit embedded, single-node use.

builder.Services.AddNetlyDB(options =>
{
    options.StorageRoot = "/var/lib/myapp/netlydb";
    options.EnableConsoleLogs = false;
    options.ShardCount = 4;
    options.QueryLogRetention = TimeSpan.FromDays(7);
})
.AddNetlyDBCollection<Order>();

Core options

OptionDescriptionDefault
StorageRoot The directory this database lives in. Resolved once at startup, so two databases in one process cannot share files. null
Durability Synchronous acknowledges a write after its durable commit; Asynchronous acknowledges earlier. Synchronous
CommitTimeout How long a synchronous write waits for its durable commit before the outcome is reported as indeterminate. 30s
SnapshotRetention Superseded snapshot generations kept per collection (PreviousGenerations, MaxAge). 1 generation
DataClasses How replaceable each collection's data is; decides whether an unreadable artifact may be rebuilt or must stop writable startup. Critical
QueryBounds Per-query limits: parser depth, tokens, path depth, literal length, IN-list size, result-set size. QueryBounds.Default
QueryHistoryRetention How much of a query the recent-query history keeps. Literals are replaced unless you opt in. ShapeOnly
EnableConsoleLogs Writes structured log events to the console. true
MinimumLogLevel Lowest level emitted; keeps high-frequency replication traces off by default. Information
EnableGrpcHosting Hosts the gRPC listener used by cluster replication. A single-node application can turn it off. true
GrpcPort Port of the gRPC replication listener. 9025
BrokerHost / BrokerPort Internal event broker used for logging and operational events. localhost / 9023
ShardCount Number of in-memory shards per collection. Not a distribution across machines. 4
EventLogRetention How long event log entries are kept. 30 days
QueryLogRetention How long query history entries are kept. 3 days
EnableTtlCleanup Background removal of documents whose time-to-live has expired. true
SelfAddress Cluster nodes: the address peers use to reach this node. null
Port Cluster nodes: the control-channel port. 0
ClusterBindAddress Cluster nodes: the address to listen on, when it differs from SelfAddress. New in 1.1. null
NodeFocus Performance tuning mode for the node. Speed

Option groups

GroupCoversSee
SecurityAPI keys and hashes, API authentication requirement, JWT bearer, TLS and certificates, cluster secret, cluster TLS, cluster database id, Management UI sign-in, encryption at rest.Authentication, Encryption
LicenseLicense key, license file, environment variable name, grace period.Licensing
MemoryOpt-in per-collection memory limits and the over-limit policy.Embedded model
CompressionAt-rest compression, algorithm and size threshold.Persistence
ValidationPer-collection schema rules.Collections
DataClasses, SnapshotRetentionHow replaceable each collection is; how many superseded snapshots are kept.Persistence
QueryBounds, QueryHistoryRetentionQuery parser limits; what recent-query history keeps.Diagnostics
An unhandled error has occurred. Reload X

Reconnecting

Restoring the connection to the server...

Still trying

Next attempt in seconds

Connection lost

We could not reach the server.