Installation
Add the SDK, register NetlyDB, and know what an embedded host starts.
Requirements
- .NET 10.
NetlyDB.SDKtargetsnet10.0. - Supported environments: Linux x64, Windows x64 and macOS on Apple silicon. Android arm64 is a build target only: it compiles, and nothing has run it. No other environment is claimed.
- Memory for the data you store: collections are held in memory and persisted to disk.
Add the package
dotnet add package NetlyDB.SDK
NetlyDB.SDK is the one package you install. The engine, hosting, licensing, the REST API, the MCP server
and the Management UI ship inside it. The optional modules need a few third-party packages that the SDK does not pull
in; see Packages.
Quick start
A console application that stores a document and reads it back. This is the quick start shipped with the package; it is compiled and run against every release before publication.
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using NetlyDB.Core.Stores;
using NetlyDB.SDK.Extensions;
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddNetlyDB(options => options.StorageRoot = "netlydb-data");
using var host = builder.Build();
await host.StartAsync();
var people = host.Services.GetRequiredService<IDocumentStore>().GetCollection<Person>("People");
var id = people.Add(new Person { Name = "Ada", Age = 36 }) ?? throw new InvalidOperationException("Not stored.");
Console.WriteLine($"Stored {people.GetById(id)!.Data.Name}");
await host.StopAsync();
public class Person
{
public Guid Id { get; set; }
public string Name { get; set; } = "";
public int Age { get; set; }
}
The data lives under netlydb-data, relative to the working directory. Start the host before using a
collection: NetlyDB's hosted services - license enforcement, time-to-live cleanup and the memory governor among them -
run as part of it.
What an embedded host starts
Embedded means no separate server process. It does not mean no network listener at all. With default options,
AddNetlyDB() starts:
- an internal event broker on
localhost:9023(BrokerHost,BrokerPort), used for logging and operational events; - a gRPC listener on port
9025(EnableGrpcHosting,GrpcPort), used by cluster replication.
A single-node application that does not replicate can turn gRPC hosting off with
options.EnableGrpcHosting = false. The optional modules - REST API, Management UI and MCP server - open
their own ports only when you register them.