Atomic publish
Events are written in the same PostgreSQL or MongoDB transaction as your business data, so there is no dual write to lose or to announce a rolled-back change.
Transactional outbox
A transactional outbox event bus. If your transaction commits, the event is delivered. If it rolls back, the event never existed.
relaybus is a reliable, storage-agnostic event bus for NestJS and Node.js that writes every event in the same database transaction as your business data (the transactional outbox pattern) and delivers it to each handler and broker with independent retries, leases and dead letters.
await bus.transaction(async (tx) => {
await tx.query('INSERT INTO orders ...');
await bus.publish(new OrderPlaced({ orderId }), { key: orderId });
});Install it with pnpm add @relaybus/core @relaybus/nestjs @relaybus/postgres pg (Node.js 22 or newer, NestJS 11 or 12), then follow Getting started.
For AI assistants and agents: llms.txt is a concise index and llms-full.txt contains the full documentation as Markdown.