Decoupling with queues and events · Chapter 3 of 3
How EventBridge routes events by pattern
EventBridge decouples systems by routing JSON payloads based on their content, but unmatched events vanish silently unless you configure archives or dead-letter queues.
FoundationsBuilds the idea from nothing. No prior AWS assumed.
Content based routing on the event bus
How does EventBridge decouple systems using event patterns?
The event bus evaluates custom JSON rules in parallel to determine which targets should receive the event.
- 01
The serverless event bus
EventBridge acts as a central bus that receives event payloads from producers and routes them to subscribers. Unlike SNS topics, consumers do not subscribe to the whole bus; they subscribe to specific event patterns.
- 02
Matching content instead of topics
EventBridge rules inspect the structure and values within the JSON event payload. You can match events based on fields like source, detail-type, or nested numeric values, routing them only to matching targets.
- 03
The schema drift challenge
Because EventBridge does not enforce schema validation on publish, a change in the producer’s JSON structure can break routing rules. If a rule expects a field that the producer renamed, the rule will fail silently.
Check yourself
What happens to an event sent to an EventBridge bus if no active rules match its content?
Under the hoodThe same thing from underneath: limits, failure modes, numbers.
Delivery guarantees and event archiving
How does EventBridge handle delivery failures and historical replays?
The event bus evaluates custom JSON rules in parallel to determine which targets should receive the event.
- 01
Delivery retry guarantees
EventBridge guarantees at least once delivery. If a target is unavailable, EventBridge retries the delivery with exponential backoff and jitter for up to 24 hours before dropping the event.
- 02
Archiving and replaying events
You can configure EventBridge to archive events on a bus indefinitely or for a set period. If a downstream consumer fails or a code bug is deployed, you can replay the archived events to restore state.
- 03
The scale limit of rules
Whilst EventBridge scales to support massive event volumes, there are quotas on the number of rules per event bus. Designing rules that are too specific can exhaust these limits quickly.
The numbers
- Maximum rules per bus
- 300 rulesThe default limit per event bus, which can be increased via service quotas.
- PutEvents request entry size
- Less than 1 MB totalThe calculated sizes of all entries in one request must sum to less than 1,048,576 bytes. This is not a raw JSON body length limit.
- Maximum archive duration
- IndefiniteArchives can store events forever, billed based on storage size and write operations.
- Retry duration limit
- 24 hoursThe maximum duration EventBridge will retry delivering a failed event before sending it to a dead-letter queue.
Check yourself
A downstream service was offline for 6 hours, causing EventBridge to fail deliveries. What feature allows you to re-process those events once the service recovers?
Official references & further reading
These lessons simplify selected behaviors for learning. Verify current service limits, Region support and production requirements with the official references. Experiments describe their own assumptions.
Report an error or suggest a clearer explanation →