# Event-Driven Architecture

Event-driven architecture is a software design approach in which components publish events and other components react to them through loosely coupled communication.

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/event-driven-architecture

> An event records something that has happened, such as an order being placed, a file being uploaded, or a monitoring threshold being crossed. By separating event producers from consumers, this architecture lets cloud applications process work independently, absorb traffic spikes, and deliver notifications without requiring every component to respond at the same time.

Practice exams covering Event-Driven Architecture: [ANS-C01 AWS Certified Advanced Networking - Specialty](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty), [CLF-C02 AWS Certified Cloud Practitioner](https://blowstack.com/practice-exams/aws-certified-cloud-practitioner), [SOA-C03 AWS Certified CloudOps Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate), [DEA-C01 AWS Certified Data Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-data-engineer-associate), [DVA-C02 AWS Certified Developer - Associate](https://blowstack.com/practice-exams/aws-certified-developer-associate), [DOP-C02 AWS Certified DevOps Engineer - Professional](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional), [AIP-C01 AWS Certified Generative AI Developer - Professional](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional), [MLA-C02 (beta) AWS Certified Machine Learning Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-machine-learning-engineer-associate), [SAA-C03 AWS Certified Solutions Architect - Associate](https://blowstack.com/practice-exams/aws-certified-solutions-architect-associate).

## 6 key aspects of Event-Driven Architecture

Event-driven architecture combines loose coupling, asynchronous delivery, deliberate messaging patterns, and explicit reliability controls so components can react independently to changes.

1. **Producers and consumers are loosely coupled**: Producers publish facts without needing to know every consumer's implementation. New consumers can subscribe or receive routed events without adding direct calls to the producer.
2. **Asynchronous processing and buffering**: Consumers process events independently of the originating request. Queues can absorb bursts, but engineers must monitor backlog and processing latency to ensure consumers eventually catch up.
3. **Distinct delivery patterns**: Use competing consumers for shared background work, publish-subscribe for fan-out, and event routing for selecting targets by event attributes. Multiple recipients needing independent copies generally require separate subscriptions or queues.
4. **Explicit delivery and failure handling**: Choose delivery and ordering guarantees deliberately rather than assuming them. Use idempotent handlers, bounded retries, and dead-letter handling where supported to manage duplicate deliveries and persistent failures.
5. **Eventual consistency and clear contracts**: Different components may reflect an event at different times. Define stable event schemas, version changes carefully, and design user interfaces and workflows to represent pending processing.
6. **End-to-end operational visibility**: Carry event and correlation identifiers through the processing chain. Monitor failed deliveries, queue age, consumer errors, and notification outcomes rather than treating successful publication as successful completion.

## Cloud services for Event-Driven Architecture

A producer can publish an event to EventBridge for content-based routing, or to SNS when the primary need is distributing messages to subscribers. SNS can fan out to separate SQS queues so each downstream application buffers and processes its own copy independently. Lambda can consume queued messages or handle supported event deliveries, then call SES when processing requires a transactional email. Separately, CloudWatch alarms can publish to SNS to notify operators about failures or resource thresholds. Select the service by responsibility: monitoring detects conditions, messaging transports or routes information, consumers perform work, and notification channels reach people.

- **[Amazon EventBridge](https://blowstack.com/tools/cloud-services-hub/amazon-eventbridge)**: EventBridge event buses receive events from applications, AWS services, and supported external sources, then use rules to route matching events to targets. It is useful when different event types or attributes should trigger different downstream actions.
- **[Amazon CloudWatch](https://blowstack.com/tools/cloud-services-hub/amazon-cloudwatch)**: CloudWatch monitors operational signals and evaluates alarms. Alarm actions can publish to SNS, separating detection of an operational condition from delivery of the resulting notification.
- **[AWS Lambda](https://blowstack.com/tools/cloud-services-hub/aws-lambda)**: Lambda runs event-handling code without provisioning servers. Functions can receive events through supported integrations, including SNS and EventBridge, or process SQS messages through an event source mapping.

## Event-Driven Architecture exam questions

Real practice exam questions on Event-Driven Architecture, with the correct answer and its explanation.

### Question 1 (CLF-C02)

**Question:**

A company wants to automatically run an AWS Lambda function whenever an Amazon EC2 instance enters the stopped state. The solution must use the state-change events that EC2 generates, without polling instances or writing code to publish notifications. Which solution best meets these requirements?

**Correct answer:** Create an Amazon EventBridge rule that matches EC2 state-change events with a state of stopped, and configure the Lambda function as the target.

**Explanation:** EventBridge receives EC2 state-change events and can match their contents with a rule. The rule can route matching events to Lambda without polling instances or requiring custom notification-publishing code.

### Question 2 (MLA-C02 (beta))

**Question:**

A retailer uses an Amazon EventBridge rule to start an AWS Step Functions Standard workflow whenever a new labeled dataset is ready. The workflow first preprocesses the dataset and then submits an Amazon SageMaker training job. Each workflow execution always runs preprocessing before reaching the training task.

Occasionally, the training job submission is rejected with a transient API throttling error before a training job is created. The workflow then fails, even though EventBridge successfully delivered the event. The EventBridge target's dead-letter queue remains empty.

The retailer wants future executions to retry these transient submission failures automatically without rerunning successful preprocessing. Which change meets this requirement?

**Correct answer:** Add a bounded Retry policy with exponential backoff to the training task state, matching the transient throttling error returned by the integration.

**Explanation:** A Step Functions task-level Retry policy handles the failure where it occurs. It retries the training submission within the existing execution, preserving the successful preprocessing output and avoiding another preprocessing run.

### Question 3 (AIP-C01)

**Question:**

A travel company stores confirmed bookings in an Amazon Aurora PostgreSQL database. It wants to generate a personalized itinerary for each confirmed booking by invoking a foundation model in Amazon Bedrock. Booking confirmation must not wait for itinerary generation, and an inference outage must not prevent customers from completing bookings.

Every committed booking must eventually have an itinerary after transient failures recover. Rolled-back bookings must not trigger itinerary generation. Application processes and message publishers can crash at any point, including between a database commit and a messaging API call. Duplicate inference attempts are acceptable, but only one itinerary may be committed for each booking ID. The company does not use distributed transactions between its database and messaging services.

Which architecture meets these requirements?

**Correct answer:** Insert the booking and an outbox record in the same database transaction. Have a relay publish committed outbox records to an Amazon SQS queue and mark them delivered only after successful publication, retrying unacknowledged records. Have workers invoke Amazon Bedrock, conditionally commit one itinerary per booking ID, and acknowledge messages only after the result is durably stored.

**Explanation:** The database transaction atomically commits both the booking and the durable obligation to publish its event. Rolled-back transactions expose neither record to the relay. Publishing before marking delivery can produce duplicates after a crash, but it does not silently lose committed work. Workers can retry after recovery, and a unique constraint or equivalent conditional write ensures that only one itinerary is committed per booking ID.

### Question 4 (SOA-C03)

**Question:**

A company has a maintenance application that updates existing Amazon EC2 instances. After each successful update, two existing AWS Lambda functions must react: one updates the instance's operational tags, and the other updates an inventory system. Neither action depends on the other, and a failure in either action must not prevent delivery to the other function.

The maintenance application must publish a single completion event instead of invoking the functions directly. The company also wants to add future consumers without changing the maintenance application. All required permissions can be configured.

Which design meets these requirements?

**Correct answer:** Publish completion events to a custom Amazon EventBridge event bus. Create two rules that match the completion events, with each rule targeting one of the Lambda functions.

**Explanation:** Both matching rules route the event to their respective targets independently. Failure of one consumer does not block delivery to the other. Additional consumers can be connected through new rules without modifying the maintenance application.

### Question 5 (DOP-C02)

**Question:**

A company operates a REST API in Amazon API Gateway. During incidents, an approval service records revised stage-level throttling settings in a configuration repository and publishes a ConfigurationApproved event containing the stage identifier, revision number, rate limit, and burst limit. The repository provides strongly consistent reads of the latest approved revision for each stage.

Approval events can be duplicated or delivered out of order. During testing, an event for revision 42 arrives after revision 43 has already been applied and restores the older settings. The company requires the stage to converge to its latest approved configuration after all events have been processed. Event delivery order must not determine the final configuration.

An existing configuration executor serializes all changes for each stage, retries failed changes, and is the only component permitted to modify stage throttling. The approval service must remain independent of remediation consumers, and additional consumers must be addable without modifying the approval service.

Which solution meets these requirements?

**Correct answer:** Publish approval events to an Amazon EventBridge event bus and route them to an AWS Lambda consumer that submits work to the executor. Within each serialized execution, read the latest approved settings from the repository and apply those settings instead of the values carried by the triggering event.

**Explanation:** EventBridge decouples the approval service from independently added consumers. Reading the latest approved configuration inside the serialized execution makes each event a reconciliation trigger rather than an instruction to restore its historical values. A delayed or duplicate event therefore reapplies the latest approved settings instead of overwriting them with an older revision.

### Question 6 (DEA-C01)

**Question:**

A data platform publishes DatasetValidated events to an Amazon EventBridge custom event bus. An existing rule invokes a production AWS Lambda function for every matching event. An EventBridge archive has retained these events for the past 30 days, and all original deliveries succeeded.

A data engineer has deployed a separate Lambda function with corrected analytics logic. The engineer must process the archived events from a specific 2-day period with this function without rerunning dataset validation or invoking the production function again for those historical events. Live event processing must continue unchanged. All required permissions are configured.

Which solution meets these requirements?

**Correct answer:** Create a rule on the original event bus that matches DatasetValidated events with the replay-name of a new replay and targets the corrected function. Replay the archived 2-day period to the original bus, selecting only the new rule as the replay destination's matching rule.

**Explanation:** EventBridge replay resends archived events to their original event bus and can restrict processing to selected rules. Selecting only the new rule prevents historical events from invoking the production target. Matching the replay-name also keeps live events from invoking the corrected function through this rule.

### Question 7 (ANS-C01)

**Question:**

A company has a provisioning application that creates AWS Transit Gateway VPC attachments. After verifying that an attachment is available, the application publishes a custom AttachmentReady event containing the attachment ID and its approved network profile.

Two independent automation functions must process every event. One configures transit gateway route-table associations and propagations. The other registers the attachment in a network inventory. Either function might be unavailable for several hours, during which its work must remain buffered without delaying the other function. The company also wants to add future consumers without changing the provisioning application. All components operate in one AWS account and Region.

Which architecture meets these requirements?

**Correct answer:** Publish the events to an Amazon EventBridge custom event bus. Create a matching rule for each automation, with a separate Amazon SQS queue as each rule's target. Configure each AWS Lambda function to consume its own queue, with appropriate retention and retry settings.

**Explanation:** EventBridge routes each matching event to both independently configured queues. Each queue buffers work for its own consumer, so one consumer's outage or backlog does not block the other. Additional consumers can be added through new rules and targets without modifying the provisioning application.

### Question 8 (DVA-C02)

**Question:**

A warehouse application records stock adjustments and publishes an AdjustmentRecorded event for each adjustment. A separately deployed inventory service consumes these events to update stock balances. During traffic spikes, events must be buffered rather than forcing the publishing service to wait for inventory processing.

Adjustments for the same warehouse-and-product pair must be processed in the order published. Adjustments for different pairs must be processed concurrently by multiple worker instances. The publisher sends events for each pair in the required order, and the workers handle duplicate events idempotently.

Which messaging design best meets these requirements?

**Correct answer:** Send events to an Amazon SQS FIFO queue using the warehouse-and-product pair as the message group ID. Have workers process each group's messages sequentially, process different groups concurrently, and delete messages after successful processing.

**Explanation:** The queue buffers events and decouples publishing from inventory processing. Using the warehouse-and-product pair as the message group ID preserves the required ordering within each pair while allowing different pairs to be processed concurrently.

### Question 9 (SAA-C03)

**Question:**

A company ingests supplier files into Amazon S3 at unpredictable intervals. Each uploaded file must undergo two independent transformations: one produces an analytics dataset, and the other produces a compliance dataset. Each transformation normally takes less than 10 seconds. Under normal operating conditions, both transformations must begin within 1 minute of an upload. Either transformation might be unavailable for up to 48 hours, during which pending work must remain available without delaying the other transformation. The upload application must not coordinate processing or be modified.

Which solution meets these requirements?

**Correct answer:** Publish S3 object-created notifications to an Amazon SNS topic. Subscribe two Amazon SQS queues to the topic, with one queue for each transformation. Configure 4-day message retention and separate AWS Lambda consumers that handle duplicate notifications idempotently.

**Explanation:** SNS distributes each upload notification to both queues. Separate SQS queues provide independent buffering and retry behavior, so an unavailable transformation does not block the other. Four-day retention covers a 48-hour outage, and Lambda consumers can begin processing promptly without changes to the upload application. Idempotent processing accommodates duplicate notifications.

## Practice Event-Driven Architecture in a full exam

Questions on Event-Driven Architecture in each practice exam, with every answer option and an explanation for each:

- [SAA-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-associate): 12 questions
- [DOP-C02](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional): 11 questions
- [AIP-C01](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional): 8 questions
- [DEA-C01](https://blowstack.com/practice-exams/aws-certified-data-engineer-associate): 8 questions
- [DVA-C02](https://blowstack.com/practice-exams/aws-certified-developer-associate): 4 questions
- [MLA-C02 (beta)](https://blowstack.com/practice-exams/aws-certified-machine-learning-engineer-associate): 3 questions
- [CLF-C02](https://blowstack.com/practice-exams/aws-certified-cloud-practitioner): 2 questions
- [SOA-C03](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate): 2 questions
- [ANS-C01](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty): 1 question

## What is Event-Driven Architecture

Event-driven architecture organizes application behavior around events: records of changes or occurrences that other components may need to act on. A producer publishes an event, an intermediary transports or routes it, and one or more consumers respond. For example, an order service can publish an OrderPlaced event without directly calling every fulfillment, reporting, and notification component. Each consumer handles its own responsibility independently.

An event describes a fact, whereas a command requests an action. OrderPlaced is an event; SendReceipt is a command. Both can travel through messaging infrastructure, but using a queue does not automatically make an application event-driven. The defining idea is that components react to published occurrences rather than relying entirely on direct, coordinated calls.

Cloud implementations commonly use queues, publish-subscribe topics, and event buses. A queue buffers messages until workers can process them, helping absorb bursts and isolate producers from processing delays. Workers sharing one queue generally compete for messages; that queue does not broadcast every message to every worker. Publish-subscribe messaging distributes messages to multiple subscriptions, while an event bus routes events to targets according to rules. Separate queues for separate subscribers can combine fan-out with independent processing and failure recovery.

For service-selection questions, distinguish delivering background work from sending notifications. Amazon Simple Queue Service, or Amazon SQS, suits queued work that consumers retrieve and process. Amazon Simple Notification Service, or Amazon SNS, suits publishing messages to subscribers, including supported application endpoints and human notification channels such as email or SMS. Amazon EventBridge suits routing events from applications, AWS services, and supported external sources based on event content. These services overlap in some capabilities, but their primary purposes differ.

An operational alert illustrates how responsibilities fit together. Amazon CloudWatch evaluates a metric alarm, such as sustained high CPU utilization, and an alarm action can publish a notification to an SNS topic. Confirmed email subscribers can then receive the alert. CloudWatch performs the monitoring and alarm evaluation; SNS delivers the notification. For application-generated transactional email, such as a formatted order receipt, Amazon Simple Email Service is generally more appropriate than an SNS email subscription.

Asynchronous processing introduces trade-offs. An order may be accepted before inventory, reporting, and customer notifications finish updating, so users and downstream systems must tolerate temporary differences in state. Delivery guarantees and ordering depend on the chosen service and configuration. Many messaging paths can deliver duplicates, so consumers should be idempotent: processing the same event again must not create another charge or shipment. Configure retries, dead-letter queues where supported, and monitoring so persistent failures do not disappear unnoticed.

Reliable designs also need event identifiers, versioned schemas, correlation identifiers, appropriate access permissions, and limits on sensitive payload data. If a database update and event publication must remain consistent, use an approach such as a transactional outbox rather than assuming two separate writes succeed together. Event-driven architecture does not guarantee immediate processing, exactly-once business effects, or lower costs. It improves decoupling and independent scaling, but adds distributed tracing, failure-handling, and operational complexity; straightforward synchronous calls can remain preferable when an immediate answer is required.

## Learn Event-Driven Architecture in lessons

11 short lessons on Event-Driven Architecture in 7 certification courses.

- CLF-C02: Event-Driven Architecture: delivering events to independent consumers (Premium), https://app.blowstack.com/lessons/event-driven-architecture-delivering-events-to-independent-consumers-clf-c02
- MLA-C02 (beta): Event-Driven Architecture: event-triggered workflows (Premium), https://app.blowstack.com/lessons/event-driven-architecture-event-triggered-workflows-mla-c02
- AIP-C01: Event-Driven Architecture: decoupled enterprise integration (Premium), https://app.blowstack.com/lessons/event-driven-architecture-decoupled-enterprise-integration-aip-c01
- SOA-C03: Event-Driven Architecture: event-triggered resource automation (Premium), https://app.blowstack.com/lessons/event-driven-architecture-event-triggered-resource-automation-soa-c03
- DOP-C02: Event-Driven Architecture vs Message Queuing (Premium), https://app.blowstack.com/lessons/event-driven-architecture-vs-message-queuing-dop-c02
- DEA-C01: Serverless versus Event-Driven Architecture (Premium), https://app.blowstack.com/lessons/serverless-versus-event-driven-architecture-dea-c01
