# Domain Events Are Easy. Until One Fails Silently.

DevFeed: [Domain Events Are Easy. Until One Fails Silently.](<https://devfeed.tech/articles/domain-events-are-easy-until-one-fails-silently-95407.md>)

Original publisher: [Read original article](<https://thetshaped.dev/p/domain-events-production-failures-nodejs-typescript>)

Author: The T-Shaped Dev

Published: 2026-10-22T12:09:33Z

Content type: tutorial

Language: en

Sources: [The T-Shaped Dev](<https://devfeed.tech/sources/the-t-shaped-dev.md>)

Topics: [event driven](<https://devfeed.tech/topics/event-driven.md>), [Publish-subscribe pattern](<https://devfeed.tech/topics/pubsub.md>), [Transactions](<https://devfeed.tech/topics/transactions.md>), [await](<https://devfeed.tech/topics/await.md>)

Tags: [3](<https://devfeed.tech/tags/3.md>), [about](<https://devfeed.tech/tags/about.md>), [accounting](<https://devfeed.tech/tags/accounting.md>), [agents](<https://devfeed.tech/tags/agents.md>), [aggregate](<https://devfeed.tech/tags/aggregate.md>), [alert](<https://devfeed.tech/tags/alert.md>), [all](<https://devfeed.tech/tags/all.md>), [also](<https://devfeed.tech/tags/also.md>), [analytics](<https://devfeed.tech/tags/analytics.md>), [api](<https://devfeed.tech/tags/api.md>), [app](<https://devfeed.tech/tags/app.md>), [async](<https://devfeed.tech/tags/async.md>), [bus](<https://devfeed.tech/tags/bus.md>), [domain](<https://devfeed.tech/tags/domain.md>), [event](<https://devfeed.tech/tags/event.md>), [events](<https://devfeed.tech/tags/events.md>), [node](<https://devfeed.tech/tags/node.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [production](<https://devfeed.tech/tags/production.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

## AI overview

Domain events move independent side effects out of a core operation, but an in-process Node.js event bus does not make delivery durable or isolate runtime latency. Use an async bus that awaits handlers and logs rejected results from `Promise.allSettled`; otherwise failures can disappear, and plain `EventEmitter` does not await async handlers. Buffer events during a database transaction and emit only after commit to avoid announcing rolled-back changes. To survive a crash after commit, save an outbox row or job in the same transaction and relay it separately; make handlers safe to rerun using an event ID. Awaiting handlers adds their latency to the request, while fire-and-forget widens the crash window and may not finish on serverless. Events fit when one business fact fans out to growing independent side effects; keep essential work such as seat reservation in the transaction. The excerpt refers to an outbox follow-up for further details.

## Source excerpt

Every tutorial stops at the typed event bus. Here are the 3 production failures it skips, and the fix for each in Node.js.