Event-Driven Best Practices
Design events that age well and systems that recover gracefully.
1 min read
Designing good events
- Name them in the past tense, e.g.
OrderPlacedorSummaryCreated. They describe facts, not commands. - Include enough context for typical consumers, like IDs, timestamps, and key fields, but not entire documents.
- Version your schema (e.g.
"version": "1"indetail) so you can evolve it without breaking consumers. - Use the schema registry to discover and document event shapes.
Reliability
- Configure retry policies and a DLQ on targets.
- Make consumers idempotent, because events can occasionally be delivered more than once.
- Archive important buses so you can replay after an incident.
Organization
- Use a custom bus per application or domain, and keep the default bus for AWS service events.
- Events can be sent across accounts and Regions by targeting another account's bus, which is great for central logging or security teams.
Note
Events vs. commands: an event says "this happened" and doesn't care who reacts. If you need a reply or a guaranteed sequence of steps, use a queue, an API call, or Step Functions.
Key takeaways
- Name events in the past tense, include useful context, and version schemas.
- Add retries, DLQs, idempotent consumers, and archives for reliability.
- Use custom buses per app, and cross-account buses for central teams.
Check your understanding
Pick an answer to see the explanation.
1. Which is the better event name?
Next in “Make it production-ready”
You finished EventBridge. Continue with the Step Functions tutorial