Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
AWS · DVA-C03

Decoupling and event-driven patterns

DVA-C03 · Lesson 1 of 24 · 4:28

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the DVA-C03 exam (AWS Certified Developer – Associate). In this lesson: tight and loose coupling, synchronous and asynchronous calls, SQS standard and FIFO queues, visibility timeouts and dead-letter queues, SNS fan-out and filter policies, EventBridge rules and Scheduler, S3 event notifications, and how to send results back to the app with a WebSocket API. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

When sales open

When AnyCompany Tickets opens sales for a big concert, thousands of fans order at the same time. Today, the order API calls the payment, ticket, and email services one after the other, so one slow service makes every fan wait, and one failure loses the order. This lesson covers decoupling: tightly and loosely coupled systems, synchronous and asynchronous patterns, and event-driven designs with SQS, SNS, EventBridge, and S3 event notifications.

Tight and loose coupling

In a tightly coupled system, components call each other directly and wait for the answers. A slow or failed component then slows or breaks every caller, and both sides must scale together. In a loosely coupled system, components exchange messages or events through a service in between, like a queue, a topic, or an event bus. Each side can then scale, fail, and be deployed on its own, and a message waits until a consumer is ready.

Synchronous or asynchronous

Choose the pattern from what the caller needs. Synchronous means the caller waits for the result, like a mobile app calling a REST API in API Gateway that invokes a Lambda function, because the app needs the seat map now. Asynchronous means the caller hands off the work and moves on, like the API putting an order in an SQS queue, and returning an order number at once. Event-driven means a producer publishes that something happened, like an order being paid, and EventBridge rules decide who reacts. Asynchronous patterns absorb spikes and survive failures, but the caller must get the result later.

Queues and topics

Amazon SQS keeps messages until a consumer receives and deletes them. A standard queue delivers each message at least once, in best-effort order, while a FIFO queue keeps the order within a message group. A received message stays hidden for the visibility timeout, 30 seconds by default, and comes back if the consumer does not delete it in time. Amazon SNS pushes each message to every subscriber, and with SNS to SQS fan-out, each service gets its own queue. And a subscription filter policy sends a subscriber only the messages that it cares about.

Event-driven patterns

Amazon EventBridge routes events with rules: a rule matches an event pattern, like an order with a status of paid, and sends it to one or more targets, which run in parallel. Amazon S3 event notifications react to objects, like a new ticket PDF, by sending an event to a Lambda function, an SQS queue, an SNS topic, or EventBridge. Through EventBridge, S3 events gain content filtering and many more targets, and they can reach a FIFO queue. And EventBridge Scheduler runs one-time or recurring jobs, like the reminder sent one day before a concert.

Getting results back

With an asynchronous design, the caller still needs the outcome. A common pattern returns a request ID at once, with an HTTP 202 status, and stores the status of the order in DynamoDB, where the app reads it later. Or the backend pushes the result, through a WebSocket API in API Gateway, a mobile push notification from SNS, or an email. And a dead-letter queue keeps the messages that fail again and again, so that a developer can inspect them without blocking the queue.

Recap

Let's recap. Tightly coupled components wait for each other, while loosely coupled ones talk through queues, topics, and event buses. Synchronous calls wait for a result, asynchronous calls hand off work, and event-driven designs publish what happened. SQS keeps messages for one consumer group, with a visibility timeout, and SNS fans out to many subscribers, with filter policies. EventBridge rules route events by pattern, and S3 event notifications react to new objects. And asynchronous results come back by polling a status, or by a push.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. During sales, the order API calls the payment, ticket, and email services one after the other, and requests time out whenever one slows down, although fans only need an order number at once. What should the developer do?

    • Raise the integration timeout of the API to its maximum
    • Call the three services from parallel threads
    • Queue each order in SQS, then return an order number
    • Add retries to every service call in the API
    Show the answer

    Queue each order in SQS, then return an order number

    An SQS queue decouples the API from the slow services, so the API returns an order number at once, and consumers process each order when they are ready. “Raise the integration timeout of the API to its maximum” would only make fans wait longer. “Call the three services from parallel threads” would still wait for the slowest of the three services, and fail with it. And “Add retries to every service call in the API” would add even more waiting to every slow call.

  2. The payment, ticket, and loyalty services must each receive every paid order, and each one must process orders at its own pace. What should the developer use?

    • An SNS topic with an SQS queue for each service
    • One SQS queue that all three services poll
    • A delay queue in front of the three services
    • Direct calls from the order service to each service
    Show the answer

    An SNS topic with an SQS queue for each service

    An SNS topic fans out each order to one SQS queue per service, so every service gets every order, and reads its own queue at its own pace. “One SQS queue that all three services poll” would hand each message to only one of the three services. “A delay queue in front of the three services” would only delay the messages, with no fan-out. And “Direct calls from the order service to each service” would couple the order service tightly to all three.

  3. When a ticket PDF lands in the bucket, a Lambda function adds a watermark, and another team wants the same events, filtered by the venue name in the key, with more consumers to come. What is the simplest design?

    • A function that lists the bucket every minute
    • A notification to one function that calls the other team
    • A CloudTrail trail with data events, read by both teams
    • S3 events sent to EventBridge, with one rule per consumer
    Show the answer

    S3 events sent to EventBridge, with one rule per consumer

    S3 sends its events to EventBridge, where each consumer gets its own rule, with content filtering, and new consumers only add rules. “A function that lists the bucket every minute” would poll the bucket, with delays and wasted calls. “A notification to one function that calls the other team” would make the first function responsible for every other team. And “A CloudTrail trail with data events, read by both teams” would record API activity for audits, without routing events to consumers.