SignalR.Backplane.EFCore
1.1.0
dotnet add package SignalR.Backplane.EFCore --version 1.1.0
NuGet\Install-Package SignalR.Backplane.EFCore -Version 1.1.0
<PackageReference Include="SignalR.Backplane.EFCore" Version="1.1.0" />
<PackageVersion Include="SignalR.Backplane.EFCore" Version="1.1.0" />
<PackageReference Include="SignalR.Backplane.EFCore" />
paket add SignalR.Backplane.EFCore --version 1.1.0
#r "nuget: SignalR.Backplane.EFCore, 1.1.0"
#:package SignalR.Backplane.EFCore@1.1.0
#addin nuget:?package=SignalR.Backplane.EFCore&version=1.1.0
#tool nuget:?package=SignalR.Backplane.EFCore&version=1.1.0
SignalR.Backplane.EFCore
An EF Core–backed backplane for ASP.NET Core SignalR.
Enables horizontal scale-out across multiple application instances with:
- Ack-based delivery
- Subscriber heartbeat tracking
- Configurable cleanup policies
🚀 Installation
dotnet add package SignalR.Backplane.EFCore
⚡ Quick Start
1. Register services in Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSignalR()
.AddBackplaneDbContext<EfBackplaneDbContext>(
options => options.UseSqlite(builder.Configuration.GetConnectionString("Main")),
configure =>
{
configure.StoreSubscriberId = $"{Environment.MachineName}-{Guid.NewGuid()}";
configure.AutoCreate = true;
});
builder.Services.AddOpenApi();
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
}
app.UseHttpsRedirection();
app.MapHub<NotificationHub>("/hubs/notification");
app.MapGet("/randomMessage", async (IHubContext<NotificationHub> hubContext) =>
{
var msg = $"Random-{Guid.NewGuid():N}";
await hubContext.Clients.All.SendAsync("signalr", msg);
return Results.Ok(new { Sent = msg });
});
app.Run();
👉 Run multiple instances of your app pointing at the same database to scale SignalR out across nodes.
Each instance must use a unique SubscriberId
.
🧭 Scale-Out Notes
- Use any EF Core provider as the shared store (Postgres, SQL Server, SQLite for dev/test).
- Ensure each app instance sets a unique
StoreSubscriberId
(e.g.,hostname + GUID
). - If two stores use the same
StoreSubscriberId
, they are treated as instances of the same subscriber — acknowledgements from one apply to all (idempotent). AutoCreate = true
simplifies the first run, but in production run migrations explicitly.- Works seamlessly in containers, Kubernetes, Azure App Service, or VMs — no Redis required.
▶️ Running two instances locally (Kestrel)
Both servers share the same SQLite file for testing:
# Terminal 1
dotnet run --urls "https://localhost:5001"
# Terminal 2
dotnet run --urls "https://localhost:5002"
For production, use Postgres or SQL Server as the shared store.
▶️ Connect a .NET client
using Microsoft.AspNetCore.SignalR.Client;
var connection = new HubConnectionBuilder()
.WithUrl("https://localhost:5002/hubs/notification") // match your server URL
.WithAutomaticReconnect()
.Build();
connection.On<string>("signalr", msg =>
{
Console.WriteLine($"[NotificationHub] Received: {msg}");
});
await connection.StartAsync();
Console.WriteLine($"State: {connection.State}"); // should be Connected
Console.WriteLine("Connected to SignalR NotificationHub.");
Console.ReadKey();
await connection.DisposeAsync();
✅ You’ll see the message arrive regardless of which instance you send it to.
✨ Features
- Horizontal scalability — run multiple SignalR instances against a shared DB
- EF Core backplane — supports Postgres, SQL Server, and SQLite
- Ack-based message delivery — ensures subscribers confirm receipt
- Subscriber heartbeat tracking
- Configurable cleanup — TTL, logical delete, or physical delete
- Multiple hub support — via generic
BusHubLifetimeManager<THub>
📖 Links
📜 License
MIT License © Bill Nice G. Havugukuri
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net8.0
- Microsoft.EntityFrameworkCore (>= 8.0.5)
- Microsoft.EntityFrameworkCore.Relational (>= 8.0.5)
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.1.0 | 145 | 9/15/2025 |