Amazon EventBridge - Overview.
Scope:
- Intro,
- Core Concepts,
- Key Benefits,
- Link to official documentation,
- Insights.
- Amazon EventBridge is a serverless event bus service that enables twtech to build event-driven applications at scale using events from its applications, third-party software as a service (SaaS) applications, and other AWS services.
- Amazon EventBridge provides a simple, consistent way to ingest, filter, transform, and deliver events to various targets for processing.
- Events: An event signifies a change in an environment or system, such as an object being added to an Amazon S3 bucket or a change in an EC2 instance's state.
- Event Buses: Event buses act as routers that receive events and deliver them to specified targets.
- Rules: Rules define what EventBridge does with the events delivered to an event bus. There are two types:
- Event Patterns: Rules that match specific data patterns within an event's structure.
- Schedules: Rules that run on a predefined schedule (e.g., using cron expressions) to invoke targets at specific times.
- Targets: When an event matches a rule, EventBridge sends the event's JSON message to one or more designated targets, such as AWS Lambda functions, Amazon SNS topics, Amazon SQS queues, or API destinations.
- Decoupling: EventBridge allows for the decoupling of application components, making the system more resilient and easier to maintain.
- Integration: It simplifies integration with a wide array of AWS services and SaaS partners without requiring custom code.
- Scalability and Reliability: The service is designed for low-latency, high-throughput event processing and offers high reliability for event delivery.
- Content-Based Filtering: It supports precise filtering using comparison operators and ranges of values within the event data, reducing the need for downstream custom filtering logic.
https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html
1. What EventBridge Really Is
Amazon EventBridge is a serverless event bus that enables event-driven architectures by routing events from producers to consumers using rules.
Think of it as:
A smart event router with schema awareness and SaaS integrations
It evolved from CloudWatch Events, but now supports:
- Multiple event buses
- Cross-account routing
- Schema registry
- SaaS event sources (e.g., Salesforce, Zendesk)
- Fine-grained filtering & transformations
2. Core Architecture Components
Event Sources (Where events originate from).
Types:
-
AWS Services
EC2, S3, Lambda, ECS, Step Functions, CodePipeline, etc. -
Custom Applications
ViaPutEventsAPI -
SaaS Partners
(Stripe, Auth0, Datadog, PagerDuty, etc.)
NB:
Each event is a JSON document.
Event Bus
A logical container for events.
Three types:
-
Default Event Bus
-
Automatically receives AWS service events
-
-
Custom Event Bus
-
For application-specific or domain-driven architectures
-
-
Partner Event Bus
-
Dedicated to SaaS integrations
-
Best Practice:
- Use one event bus per domain (e.g.,
orders-bus,billing-bus)
Events (Structure)
- An EventBridge event has a predictable shape:
Key fields:
- source → Who emitted the event
- detail-type → What kind of event it is
- detail → The payload you actually care about
Rules
- Rules decide which events go where.
Each rule has:
- Event pattern (filter)
- Target(s)
Event Pattern Sample
NB:
✔ Only matches EC2 stop events
✘ No code needed
Targets
- Where matched events are delivered.
Common targets:
- AWS Lambda
- Step Functions
- SNS / SQS
- Kinesis Data Streams
- ECS tasks
- API Destinations (HTTP endpoints)
NB:
- 🎯 One rule → multiple targets allowed
3. Event Flow (End-to-End)
Key characteristics:
- Push-based (no polling)
- Fully managed
- Near real-time (typically milliseconds)
4. Advanced Features (Where EventBridge Shines)
⭐ Schema Registry
- Automatically discovers event schemas
- Generates code bindings (Java, Python, TS)
- Helps teams avoid breaking changes
NB:
- 💡 Great for large orgs with multiple producers/consumers
Event Transformations (Modify events without Lambda Sample):
This approach Reduces:
- Lambda glue code
- Cost
- Latency
Cross-Account Event Routing
- EventBridge supports resource-based policies.
Use cases:
- Centralized monitoring account
- Security event aggregation
- Multi-account microservices
Archive & Replay
- Store events for debugging or backfills
- Replay historical events to rules
- Disaster recovery
- Reprocessing failed logic
- Auditing
5. Reliability, Limits & Guarantees
Delivery Guarantees
- At-least-once delivery
- Possible duplicates → consumers must be idempotent
Retry & DLQ
- Automatic retries
- Dead-letter queues (SQS or SNS)
Quotas (High level)
- 10,000 rules per bus (soft limit)
- Event size ≤ 256 KB
- ~100K events/sec per bus (region-dependent)
6. EventBridge vs Alternatives
| Service | Best For |
|---|---|
| EventBridge | Event routing, SaaS integration, decoupling |
| SNS | Fan-out notifications |
| SQS | Durable message queues |
| Kinesis | High-throughput streaming |
| Kafka | Complex streaming & ordering |
NB:
- EventBridge is not a stream processor
- It’s an event router & integration layer
7. Common Design Patterns
Event-Driven Microservices
- Producers emit domain events
- Consumers subscribe independently
- Zero coupling
Automation & Ops
- React to AWS service events
- Trigger remediation workflows
SaaS Integration
- Receive third-party events
- Route internally without custom polling
Choreography (vs Orchestration)
- EventBridge for loose coupling
- Step Functions when control flow matters
8. Security & IAM Model
- IAM controls PutEvents
- Resource policies control cross-account access
- Targets assume execution roles
🔐 Always:
- Restrict
PutEvents - Validate event source
- Use least privilege
9. Cost Model (Simple & Predictable)
- Charged per event published
- Free tier included
- No charge for rules or targets
NB:
- 💡 Cheaper than Lambda glue for routing logic
10. When NOT to Use EventBridge (Avoid it if twtech needs):
- Strict ordering
- Exactly-once delivery
- Massive streaming analytics
- Stateful processing