Tuesday, January 27, 2026

Amazon EventBridge | Overview.


Amazon EventBridge - Overview.

Scope:

  • Intro,
  • Core Concepts,
  • Key Benefits,
  • Link to official documentation,
  • Insights.

Intro:

    • 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. 
Core Concepts
    • 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. 
Key Benefits
    • 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. 
Link to official documentation:
https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html
twtech-Insights:

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
    Via PutEvents API

  • SaaS Partners
    (Stripe, Auth0, Datadog, PagerDuty, etc.)

NB:

Each event is a JSON document.

 Event Bus

A logical container for events.

Three types:

  1. Default Event Bus

    • Automatically receives AWS service events

  2. Custom Event Bus

    • For application-specific or domain-driven architectures

  3. 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:

{ "source": "aws.ec2", "detail-type": "EC2 Instance State-change Notification", "time": "2026-01-27T10:15:30Z", "region": "us-east-2", "resources": [], "detail": { "instance-id": "i-1234567890", "state": "running" } }

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

{ "source": ["aws.ec2"], "detail": { "state": ["stopped"] } }

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)

Event Source Event Bus Event Rule (Pattern Matching) Target(s)

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):

{ "instanceId": "$.detail.instance-id", "state": "$.detail.state" }

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
This is for:

    • 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

ServiceBest 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




No comments:

Post a Comment

Amazon EventBridge | Overview.

Amazon EventBridge - Overview. Scope: Intro, Core Concepts, Key Benefits, Link to official documentation, Insights. Intro: Amazon EventBridg...