Back to journalNotes from the craft

System Design

Event-Driven Systems: Start with the Boundary

Understand events, commands, consumers, and idempotency before introducing queues or asynchronous workflows into a production system.

Nyi Nyi Zin

Software developer & lifelong learner

Event-Driven Systems: Start with the Boundary

An event describes something that happened

An event such as OrderPlaced should be a durable fact, not an instruction disguised as a fact. Commands ask a component to do something; events tell other components what has already happened.

Asynchronous work needs ownership

Every consumer should have a clear responsibility, retry policy, and failure destination. A queue does not remove complexity; it moves the complexity into delivery guarantees, monitoring, and recovery.

Make consumers idempotent

Messages can be delivered more than once. Consumers should use a stable event ID or business key to avoid sending duplicate emails, charging a customer twice, or applying the same state transition repeatedly.

Observe the whole journey

Track correlation IDs, queue age, processing latency, retry counts, and dead-letter messages. Without these signals, asynchronous failures remain invisible until users report them.

System Design

Written by

Nyi Nyi Zin

I build for the web, mobile, and everything behind the scenes. This is where I share what I learn along the way.

More about me