LISTEN/NOTIFY performance in PostgreSQL
A NOTIFY in the transaction capped PostgreSQL 18.6 and 19 RC1 at about 3,900 commits per second, with 8 clients or 64. Sending notifications in batches after commit brought 64 clients back to 50,000.
Background work for .NET that lives in your database and commits in your transactions.
You request work in the same transaction as the change that needs it, so a rollback leaves nothing behind. There is no broker, no scheduler process and no second database. PostgreSQL is supported today.
await using var transaction = await connection.BeginTransactionAsync(ct);
// INSERT INTO users ...
await jobs.RequestAsync(transaction, Jobs.Welcome, new WelcomeArgs(42), cancellationToken: ct);
await transaction.CommitAsync(ct); // no commit, no job
Jobs, cron schedules, leases on your own tables, reconciliation and signals are built on those three. Each works alone: signals need no framework tables, and leases need no jobs.
Alpha: the API can still change. Install it from NuGet with dotnet add package Corfedo.Work.PostgreSql. The core
and the PostgreSQL store are trimming and Native AOT compatible. Coming from Hangfire, Quartz.NET or TickerQ? The
repository on GitHub has a migration guide for each, along with the
getting-started guide and the design documents.
A NOTIFY in the transaction capped PostgreSQL 18.6 and 19 RC1 at about 3,900 commits per second, with 8 clients or 64. Sending notifications in batches after commit brought 64 clients back to 50,000.