All guides
Practice now
D2 · Design for New Solutions

Event-driven architectures: EventBridge, Step Functions and Kinesis

Domain D2 (29%) covers designing new cloud-native solutions. Event-driven architectures are the core pattern for decoupled, scalable systems in AWS at the professional level.

Icon-Architecture/48/Arch_Amazon-EventBridge_48

Enterprise-scale event-driven patterns

📢

Fan-out

One event triggers multiple independent consumers in parallel. SNS → multiple SQS queues or Lambda functions.

Order created → notify inventory + billing + customer email

💃

Event Choreography

Each service reacts to events and emits new events. No central orchestrator. More decoupled but harder to observe.

Microservices that publish and consume from EventBridge without knowing about each other

🎭

Event Orchestration

A central orchestrator (Step Functions) drives the flow by calling services in sequence. Better visibility but tighter coupling.

Step Functions runs Lambda → DynamoDB → SES → notifies the user

Icon-Architecture/48/Arch_Amazon-EventBridge_48

Amazon EventBridge — enterprise event bus

EventBridge is AWS's serverless event bus. It receives events from AWS services, SaaS partners and your own applications, filters them with pattern-based rules, and routes them to targets. Formerly known as CloudWatch Events.

Key components

Event Bus

The channel events flow through. There's a "default" bus by default (AWS service events). You can create custom buses for your own apps and SaaS.

Rules

JSON pattern filters that determine which events go to which targets. Supports advanced content-based filtering.

Targets

20+ targets: , SQS, SNS, Step Functions, Kinesis, ECS Task, SSM, CodePipeline, cross-account event bus and more.

Schema Registry

Registers and versions the schema (format) of events. Auto-generates binding code.

Pipes

Point-to-point integration with transformation and enrichment: source → filter → enrich → target.

EventBridge vs SNS — when to use each

EventBridgeSNS
Content-based filtering on the eventFiltering by message attributes (limited)
Routing to 20+ target typesTargets: Lambda, SQS, HTTP, email, SMS
Schema Registry with code generationNo schema registry
Events from 200+ SaaS partnersAWS production events only
Cross-account and cross-region nativelyCross-account via resource policy
~1s (slower)Sub-second latency (faster)

EventBridge Scheduler

EventBridge Scheduler (not to be confused with cron-type Rules) lets you create one-time or recurring schedules to invoke targets. Supports millions of schedules per account with flexible execution windows. Replaces using CloudWatch Events + Lambda for scheduling.

Icon-Architecture/48/Arch_AWS-Step-Functions_48

AWS Step Functions — workflow orchestration

Step Functions is AWS's orchestration service. It defines workflows (state machines) in Amazon States Language (ASL/JSON) that coordinate multiple AWS services with retry logic, branching, error handling and parallelism.

FeatureStandard WorkflowsExpress Workflows
Max durationUp to 1 yearUp to 5 minutes
Concurrent executions2,000 (default)Over 100,000/sec
Execution semanticsExactly-onceAt-least-once
Cost modelPer state transitionPer duration + number of executions
Auditable historyYes — CloudWatch and Step Functions consoleCloudWatch Logs only
Best forOrders, approvals, critical flowsIoT, streaming, high concurrency

State types in ASL

Task

Invokes an AWS service (Lambda, ECS, , etc.) or runs activities.

Choice

Conditional branching based on state variables.

Parallel

Runs multiple branches in parallel and waits for all to complete.

Map

Iterates over an array, processing each item in parallel.

Wait

Pauses the workflow until a date/time or external signal.

Pass/Fail/Succeed

State manipulation, error handling and termination.

SDK Integrations (Optimized) vs Lambda Invoke

Step Functions has native integrations with 200+ AWS service APIs without needing Lambda as a go-between. For example, invoking DynamoDB:PutItem directly from a Task state. This reduces latency and cost vs using Lambda just to call another service.

Icon-Architecture/48/Arch_Amazon-Kinesis_48

Amazon Kinesis — real-time data streaming

ServiceModelRetentionConsumptionBest for
Kinesis Data StreamsPub/Sub streaming24h–365 daysKCL, Lambda, SDK — you manage the consumersReal-time processing with full consumer control. Multiple consumers of the same stream.
Amazon Data FirehoseManaged ETLNone (direct delivery)Automatic — delivers to S3, Redshift, OpenSearch, SplunkAutomatic ingestion and delivery to analytics destinations with no code.
Managed Service for Apache FlinkStreaming queriesProcesses in real timeFlink (Java, Python, or Flink SQL) over KDS or MSKAnalysis and transformation of streams with SQL or Apache Flink.
Kinesis Video StreamsVideo streamingConfigurableSDK, HLS, DASH, WebRTCIngesting and processing video from cameras/IoT devices.

Kinesis Data Streams — capacity concepts

    ShardUnit of capacity: 1 MB/s write, 2 MB/s read. Scale by adding shards.
    Partition KeyDetermines which shard each record goes to. Same partition key = same shard = guaranteed order.
    ProvisionedModeManual shard scaling. Predictable for known workloads.
    On-Demand ModeAuto-scales with traffic. No shard management. More expensive per MB.
    Enhanced Fan-OutEach registered consumer gets 2 MB/s dedicated (not shared). For multiple consumers of the same stream.

Kinesis vs SQS — design decision

Do multiple consumers need to read the same data?

→ Kinesis (native fan-out)

Do you need guaranteed order within a key?

→ Kinesis (same shard)

Do you need to replay historical data?

→ Kinesis (retention up to 365 days)

Must each message be processed exactly once?

→ SQS (exactly-once with deduplication)

Simple point-to-point decoupling?

→ SQS (simpler to manage)

Real-time time-series analysis?

→ Managed Service for Apache Flink + KDS

Icon-Architecture/48/Arch_Amazon-Simple-Notification-Service_48

and — advanced patterns

SNS — advanced patterns for SAP-C02

SNS Message Filtering

Each SQS/Lambda subscription can have a JSON filter policy. It only receives messages matching the message attributes. Avoids routing every message to every consumer.

SNS FIFO + SQS FIFO

For fan-out with guaranteed order and exactly-once delivery. SNS FIFO → multiple SQS FIFO queues. Each queue receives messages in the same order.

SNS + DLQ

SQS subscriptions can have a Dead Letter Queue for messages that can't be delivered after multiple attempts.

SQS — high-level features

Long PollingWaitTimeSeconds > 0: the Lambda/consumer waits until messages exist. Reduces empty calls and cost.
Visibility TimeoutTime a message stays invisible after being received. If the consumer fails, the message reappears. Must be longer than the processing time.
Message Retention1 minute to 14 days (4 days default). If the message isn't deleted within that window, it's discarded.
DLQ (Dead Letter Queue)After N failed attempts, the message moves to the DLQ for analysis. maxReceiveCount is configurable.
FIFO DeduplicationMessageDeduplicationId prevents duplicates for 5 minutes. ContentBasedDeduplication uses a hash of the body.
Icon-Architecture/48/Arch_Amazon-EventBridge_48

When to use each messaging/eventing service

ScenarioRecommended serviceReason
Decouple microservices with independent workersSQSSimple queue, at-least-once, easy to scale with Lambda or ASG
Fan-out: one event → multiple parallel processorsSNS + SQS (fan-out pattern)SNS distributes the same message to multiple SQS queues
React to AWS service events (EC2 stop, S3 upload)EventBridge (default bus)Default bus receives native events from 200+ AWS services
Integrate with Salesforce, Zendesk, DatadogEventBridge (SaaS bus)EventBridge has native integrations with 200+ SaaS partners
Orchestrate a multi-step process with retry and compensationStep FunctionsFlow visualization, automatic retry, exactly-once with Standard
Process a real-time clickstream/IoT streamKinesis Data StreamsRetention, replay, multiple consumers, order by partition key
Deliver logs/events to S3 or Redshift without codeAmazon Data FirehoseManaged delivery with optional Lambda transformation
Analyze a real-time stream with SQLManaged Service for Apache FlinkManaged Flink SQL over KDS or MSK
Icon-Architecture/48/Arch_Amazon-EventBridge_48

Common exam traps

Trap: "EventBridge and CloudWatch Events are different services"

Reality: They're the same service. EventBridge is the evolution of CloudWatch Events. The concepts are identical; EventBridge just has more features.

Trap: "Step Functions Standard always guarantees exactly-once"

Reality: Standard guarantees exactly-once for activity and Lambda invocations. Express is at-least-once. Both have configurable retries.

Trap: "Amazon Data Firehose supports multiple consumers like Kinesis Streams"

Reality: FALSE. Firehose delivers to a single destination (S3, Redshift, OpenSearch, etc.). For multiple consumers of the same stream, use Kinesis Data Streams.

Trap: "SQS FIFO always guarantees exactly-once"

Reality: FIFO guarantees exactly-once within the 5-minute deduplication window using MessageDeduplicationId. Without that ID configured, duplicates can occur.

Did you get this topic?

Test what you just learned

An e-commerce company processes 50,000 orders per hour. When an order is created, they need to: (1) update inventory, (2) generate the invoice, (3) send a confirmation email, and (4) publish the event to the Data Warehouse. All in parallel. Operations must be idempotent. What is the most appropriate architecture?

Ready to test "Event-Driven Architectures: EventBridge, Step Functions and Kinesis"?

Put what you learned to the test with original SAP-C02 exam questions.

Start SAP-C02 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.