Excalibur.LeaderElection.Postgres
10.0.0-alpha.10
dotnet add package Excalibur.LeaderElection.Postgres --version 10.0.0-alpha.10
NuGet\Install-Package Excalibur.LeaderElection.Postgres -Version 10.0.0-alpha.10
<PackageReference Include="Excalibur.LeaderElection.Postgres" Version="10.0.0-alpha.10" />
<PackageVersion Include="Excalibur.LeaderElection.Postgres" Version="10.0.0-alpha.10" />
<PackageReference Include="Excalibur.LeaderElection.Postgres" />
paket add Excalibur.LeaderElection.Postgres --version 10.0.0-alpha.10
#r "nuget: Excalibur.LeaderElection.Postgres, 10.0.0-alpha.10"
#:package Excalibur.LeaderElection.Postgres@10.0.0-alpha.10
#addin nuget:?package=Excalibur.LeaderElection.Postgres&version=10.0.0-alpha.10&prerelease
#tool nuget:?package=Excalibur.LeaderElection.Postgres&version=10.0.0-alpha.10&prerelease
Excalibur.LeaderElection.Postgres
PostgreSQL implementation of leader election for the Excalibur framework. Uses advisory locks (pg_try_advisory_lock) for distributed coordination with automatic failover and session-based locking.
Part Of
This package is included in the following metapackages:
| Metapackage | Tier | What It Adds |
|---|---|---|
Excalibur.Postgres |
Complete | Everything for PostgreSQL: ES + Outbox + Inbox + Saga + LE + Audit + Compliance + Data |
Tip: Install
Excalibur.Postgresfor a production-ready PostgreSQL stack with a single package reference.
Features
- Advisory lock-based leader election -- lightweight, session-scoped locks that auto-release on connection loss
- Health-based leader election -- extends standard LE with health-aware candidate tracking and voluntary step-down
- Factory pattern -- create multiple independent leader elections with different lock keys
- Telemetry integration -- OpenTelemetry metrics and traces via
TelemetryLeaderElectiondecorator - Health checks -- ASP.NET Core health check integration
Quick Start
services.AddPostgresLeaderElection(options =>
{
options.ConnectionString = "Host=localhost;Database=myapp;";
options.LockKey = 12345;
});
Or using the builder pattern:
services.AddExcalibur(x => x.AddLeaderElection(builder =>
{
builder.UsePostgres(options =>
{
options.ConnectionString = connectionString;
});
}));
Schema
Advisory-lock leader election needs no table — the lock lives in the PostgreSQL lock manager.
The health-based variant records candidate health in a table, which it creates automatically on
first use. For a deployment that provisions schema separately, or runs without table-creation
rights, the canonical DDL ships in the package as
scripts/001_CreateLeaderElectionHealthSchema.sql. It is derived from the statement the store
issues at runtime, so a database provisioned either way has the same shape. Defaults: schema
public, table leader_election_health (both configurable via
PostgresHealthBasedLeaderElectionOptions).
The script only ever creates the table if it is missing; it does not alter an existing one.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Ben.Demystifier (>= 0.4.1)
- CloudNative.CloudEvents (>= 2.8.0)
- CloudNative.CloudEvents.SystemTextJson (>= 2.8.0)
- Cronos (>= 0.12.0)
- Dapper (>= 2.1.72)
- Excalibur.Dispatch.LeaderElection.Abstractions (>= 10.0.0-alpha.10)
- Excalibur.LeaderElection (>= 10.0.0-alpha.10)
- FluentValidation (>= 12.1.1)
- FluentValidation.DependencyInjectionExtensions (>= 12.1.1)
- IdentityModel (>= 7.0.0)
- JsonNet.ContractResolvers (>= 2.0.0)
- Medo.Uuid7 (>= 3.2.0)
- MemoryPack (>= 1.21.4)
- Microsoft.ApplicationInsights (>= 3.1.0)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Caching.Memory (>= 10.0.10)
- Microsoft.Extensions.Configuration (>= 10.0.10)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.10)
- Microsoft.Extensions.Configuration.CommandLine (>= 10.0.10)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.10)
- Microsoft.Extensions.Configuration.Json (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Hosting (>= 10.0.10)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Http (>= 10.0.10)
- Microsoft.Extensions.Logging (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging.Console (>= 10.0.10)
- Microsoft.Extensions.ObjectPool (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.10)
- Microsoft.IdentityModel.Tokens (>= 8.17.0)
- Npgsql (>= 10.0.2)
- OpenTelemetry (>= 1.15.3)
- OpenTelemetry.Api (>= 1.15.3)
- OpenTelemetry.Extensions.Hosting (>= 1.15.3)
- Polly (>= 8.6.6)
- System.IdentityModel.Tokens.Jwt (>= 8.17.0)
- System.IO.Hashing (>= 10.0.7)
- System.Threading.RateLimiting (>= 10.0.7)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Excalibur.LeaderElection.Postgres:
| Package | Downloads |
|---|---|
|
Excalibur.Postgres
Complete PostgreSQL metapackage for Excalibur: event sourcing, inbox, sagas, leader election, audit logging, compliance, and data access in a single package reference. The outbox is not registered -- its PostgreSQL store requires an application-supplied Excalibur.Data.IDb. PRE-RELEASE: the public API is not frozen and may change between pre-release builds. Not recommended for production use. Known issues: https://docs.excalibur-dispatch.dev/docs/known-issues |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.0-alpha.10 | 31 | 9/6/2026 |
| 10.0.0-alpha.9 | 58 | 8/31/2026 |
| 10.0.0-alpha.8 | 70 | 8/14/2026 |
| 10.0.0-alpha.7 | 64 | 8/13/2026 |
| 10.0.0-alpha.6 | 68 | 8/11/2026 |
| 10.0.0-alpha.5 | 60 | 8/10/2026 |
| 10.0.0-alpha.4 | 59 | 8/10/2026 |
| 3.0.0-alpha.216 | 81 | 6/30/2026 |
| 3.0.0-alpha.215 | 76 | 6/23/2026 |
| 3.0.0-alpha.214 | 80 | 6/23/2026 |
| 3.0.0-alpha.208 | 72 | 6/11/2026 |
| 3.0.0-alpha.207 | 71 | 6/11/2026 |
| 3.0.0-alpha.205 | 74 | 6/10/2026 |
| 3.0.0-alpha.204 | 75 | 6/8/2026 |
| 3.0.0-alpha.203 | 67 | 6/8/2026 |
| 3.0.0-alpha.202 | 69 | 6/8/2026 |
| 3.0.0-alpha.201 | 65 | 6/8/2026 |
| 3.0.0-alpha.199 | 74 | 6/8/2026 |
| 3.0.0-alpha.198 | 67 | 5/28/2026 |
| 3.0.0-alpha.197 | 83 | 5/28/2026 |
Release notes and versioning policy: https://docs.excalibur-dispatch.dev/docs/migration/version-upgrades