EntglDb.AspNet 1.0.3

dotnet add package EntglDb.AspNet --version 1.0.3
                    
NuGet\Install-Package EntglDb.AspNet -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EntglDb.AspNet" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EntglDb.AspNet" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="EntglDb.AspNet" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EntglDb.AspNet --version 1.0.3
                    
#r "nuget: EntglDb.AspNet, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EntglDb.AspNet@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EntglDb.AspNet&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=EntglDb.AspNet&version=1.0.3
                    
Install as a Cake Tool

EntglDb.AspNet

ASP.NET Core integration for EntglDb with health checks, hosted services, and multi-cluster support.

Features

  • Single & Multi-Cluster Modes: Flexible deployment options
  • Health Checks: Built-in health endpoints for monitoring
  • Hosted Services: Automatic lifecycle management
  • OAuth2 JWT Support: Optional authentication for secure sync
  • Respond-Only Mode: Server doesn't initiate outbound sync

Installation

dotnet add package EntglDb.AspNet

Quick Start - Single Cluster

var builder = WebApplication.CreateBuilder(args);

// Add EntglDb with SQLite persistence
builder.Services.AddEntglDbSqlite(options =>
{
    options.BasePath = "/var/lib/entgldb";
    options.UsePerCollectionTables = true;
});

// Add ASP.NET integration (single-cluster mode)
builder.Services.AddEntglDbAspNetSingleCluster(options =>
{
    options.NodeId = "server-01";
    options.TcpPort = 5001;
    options.RequireAuthentication = false;
});

var app = builder.Build();

// Map health check endpoint
app.MapHealthChecks("/health");

app.Run();

Multi-Cluster Mode

builder.Services.AddEntglDbAspNetMultiCluster(options =>
{
    options.BasePort = 5001;
    options.ClusterCount = 10;
    options.RequireAuthentication = true;
    options.OAuth2Authority = "https://auth.example.com";
    options.OAuth2Audience = "entgldb-api";
    options.NodeIdTemplate = "server-{ClusterId}";
});

With PostgreSQL

builder.Services.AddEntglDbPostgreSql(
    "Host=localhost;Database=EntglDb;Username=user;Password=pass");

builder.Services.AddEntglDbAspNetSingleCluster(options =>
{
    options.NodeId = "prod-server-01";
    options.TcpPort = 5001;
});

OAuth2 Authentication

When authentication is enabled, clients must provide valid JWT tokens:

builder.Services.AddEntglDbAspNetSingleCluster(options =>
{
    options.RequireAuthentication = true;
    options.OAuth2Authority = "https://auth.example.com";
    options.OAuth2Audience = "entgldb-api";
});

Health Checks

EntglDb registers health checks that verify:

  • Database connectivity
  • Latest timestamp retrieval

Access health status:

curl http://localhost:5000/health

Response:

{
  "status": "Healthy",
  "results": {
    "entgldb": {
      "status": "Healthy",
      "description": "EntglDb is healthy. Latest timestamp: 1234567890"
    }
  }
}

Deployment Modes

Single-Cluster Mode

Best for:

  • Dedicated database servers
  • Simple deployments
  • Development/testing environments

Each server instance manages one database/cluster.

Multi-Cluster Mode

Best for:

  • Multi-tenant SaaS applications
  • Shared hosting environments
  • Cloud deployments

One server instance can manage multiple isolated databases/clusters, each on a different port.

Server Behavior

EntglDb ASP.NET servers operate in "respond-only" mode:

  • ✅ Accept incoming sync connections
  • ✅ Respond to sync requests
  • ❌ Do NOT initiate outbound sync
  • ❌ Do NOT perform UDP discovery

This design makes servers:

  • Predictable: No surprise network activity
  • Secure: Controlled network surface
  • Scalable: Stateless request handling

Configuration Options

SingleClusterOptions

Property Type Default Description
NodeId string MachineName Unique node identifier
TcpPort int 5001 TCP port for sync
EnableUdpDiscovery bool false Enable UDP discovery
RequireAuthentication bool false Require OAuth2 JWT
OAuth2Authority string? null OAuth2 authority URL
OAuth2Audience string? null Expected audience claim

MultiClusterOptions

Property Type Default Description
BasePort int 5001 Starting port number
ClusterCount int 1 Number of clusters
RequireAuthentication bool true Require OAuth2 JWT
OAuth2Authority string? null OAuth2 authority URL
OAuth2Audience string? null Expected audience claim
NodeIdTemplate string "{ClusterId}" Node ID template

Monitoring & Observability

EntglDb logs important events:

info: EntglDb.AspNet.HostedServices.TcpSyncServerHostedService[0]
      Starting TCP Sync Server...
info: EntglDb.AspNet.Services.NoOpDiscoveryService[0]
      NoOpDiscoveryService started (passive mode - no UDP discovery)
info: EntglDb.AspNet.HealthChecks.EntglDbHealthCheck[0]
      EntglDb is healthy. Latest timestamp: 1234567890

Production Checklist

  • Use PostgreSQL or SQL Server (not SQLite) for production
  • Enable authentication in multi-tenant scenarios
  • Configure health checks for load balancer
  • Set up proper logging and monitoring
  • Use connection pooling for database
  • Configure proper firewall rules for TCP port
  • Use HTTPS for OAuth2 authority
  • Set unique NodeId per instance
  • Test failover scenarios

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 35 2/19/2026
1.0.2 31 2/19/2026
1.0.1 61 2/18/2026
1.0.0 73 2/18/2026
0.9.1 91 1/28/2026
0.8.6 85 1/27/2026
0.8.5 87 1/26/2026
0.8.4 98 1/22/2026
0.8.3 86 1/22/2026
0.8.2 84 1/21/2026
0.8.1 82 1/21/2026
0.8.0 87 1/21/2026