StudyToCert

All certifications / Developer Associate / Lessons

AWS Certified Developer – Associate DVA-C02 · Domain 1: Development with AWS Services

Architectural patterns: event-driven, microservices, fan-out, choreography vs orchestration, loosely coupled and stateless designs

▶ Watch the overview video

Last reviewed October 6, 2026 · Leer en español

Explain it simpler

Imagine a restaurant where the waiter takes your order and then stands in the kitchen until the chef, the dessert cook and the dishwasher are all finished before serving the next table. One slow person stops everything. Better restaurants pin the order ticket on a rail and move on; each station picks up the ticket when ready. That is loose coupling: parts of a program pass notes through something in between, such as a queue (a waiting line for messages), instead of waiting on each other. Event-driven means parts announce what happened, like order placed, and whoever cares reacts. Stateless means a worker does not keep your details in its head, so any worker can serve you because the details are written down in a shared place.

It is Black Friday morning at Larkspur Outfitters, and Dev, the only developer on call, watches the checkout dashboard turn red. The email provider the shop uses for receipts is down, and because the checkout function calls it directly and waits, every order is now failing. Customers are adding items to carts and then giving up. Payment and shipping are perfectly healthy, yet they are stuck behind one slow dependency that has nothing to do with taking money. Dev's manager asks the obvious question: why does a broken receipt email stop the whole store from selling anything, and how do we make sure it never happens again?

Coupling is the idea underneath almost every architecture question on the AWS Certified Developer – Associate (DVA-C02) exam. Most scenarios describe an application built from small pieces that talk to each other and ask which design keeps it reliable and easy to change. Coupling measures how much one component needs to know about, and wait for, another. A tightly coupled system breaks as a whole when one part is slow or down, because callers block on it. A loosely coupled system puts something in between, such as a queue, a topic, an event bus or a stable API contract, so each part can fail, scale and be deployed on its own. When you read an exam scenario, ask first: if this component disappears for ten minutes, what else stops?

Event-driven architecture is the most common way to loosen coupling. Instead of calling each other directly, components announce that something happened, such as an order being placed or a file being uploaded. The producer emits an event and moves on; any number of consumers react to it, and the producer does not need to know who they are. On AWS the usual carriers are Amazon Simple Queue Service (SQS) for work queues, Amazon Simple Notification Service (SNS) for publish/subscribe, Amazon EventBridge for routing events by their content, and Amazon Kinesis Data Streams for ordered, high-volume streams. Many AWS services can also emit events themselves: an object landing in Amazon S3 or an item changing in an Amazon DynamoDB table can trigger an AWS Lambda function directly, with no polling code of your own.

Microservices apply the same thinking to the whole application. You split it into small services, each owning one business capability and its own data store, deployed independently and reached only through its API or its events. The payoff is that the inventory team can release on Tuesday without coordinating with the payments team, and the busy search service can scale out while the quiet account service stays small. The cost is real: more network calls, more things to monitor, and the need to handle partial failure when one service is down while others are up. A common exam distractor is a design where two services share one database table. It looks efficient, but a schema change for one service now breaks the other, which quietly couples them again.

Fan-out means one message is delivered to many consumers in parallel. The classic AWS pattern is SNS to multiple SQS queues. A producer publishes once to a topic, and each subscribed queue gets its own copy of the message. An email service, an analytics service and an inventory service then each pull from their own queue at their own pace. If the email service is slow or offline, its messages simply wait in its queue, while the other two keep working, and nothing is lost when it comes back. This is better than SNS pushing straight to each service, because the queue is a buffer that absorbs outages and bursts. EventBridge rules with several targets achieve a similar result and add content-based filtering, so a rule can send only events whose detail matches a pattern to a given target.

Choreography and orchestration are two ways to coordinate a multi-step business process such as take payment, reserve stock, then ship. In choreography there is no central controller. Each service listens for events and emits new ones, like dancers who each know their own part of the routine. The payment service hears OrderPlaced and later emits PaymentTaken; the warehouse hears PaymentTaken and emits Shipped. It is very loosely coupled, and services can evolve independently, but the overall flow lives nowhere in particular, so it is hard to see, test and debug when an order gets stuck halfway.

In orchestration, one coordinator calls each step in turn, tracks state, and handles retries and compensation. On AWS the coordinator is typically AWS Step Functions, whose console shows each execution as a diagram with the failed step highlighted. Choose orchestration when the process needs visibility, strict ordering, error handling with compensating actions such as a refund when shipping fails, or a human approval step. Choose choreography when services should simply react to events and you value independence over a single picture of the flow. Exam wording such as visual workflow, track the state of each order or roll back earlier steps points toward Step Functions.

Stateless design is what lets all of this scale out. A stateless compute unit keeps no session or user data in its own memory or local disk between requests, so any Amazon EC2 instance, container or Lambda execution environment can serve any request and can be replaced at any moment without losing anything. State lives in an external store such as DynamoDB, Amazon ElastiCache or S3. Warning signs of a stateful design include sticky sessions on a load balancer, a shopping cart held in a server variable, or data kept only in a Lambda function's /tmp directory. Each of these breaks when the instance is terminated or when a second instance receives the user's next request.

Putting it together, the exam usually rewards the design that buffers between components, lets each scale independently, and keeps state outside compute. Read the clues: one event, several independent reactions, slow consumers must not block others, which suggests SNS fan-out into SQS or EventBridge with multiple targets. An ordered business process with retries, compensation and visibility suggests Step Functions. Any instance can handle any request suggests externalized session state in DynamoDB or ElastiCache.

Think of it like this A loosely coupled system works like the order rail in a busy diner kitchen. The server clips a ticket to the rail and goes back to the floor; the grill, the fryer and the dessert station each pull the ticket when they are ready, and a slow dessert station never stops burgers from going out. Fan-out is the server printing three copies of the ticket, one per station. The analogy stops working in one way that matters: a real ticket can be lost, while an SQS queue keeps each message durably until a consumer deletes it.

Key terms

Loose coupling
Designing components so they interact through an intermediary or stable contract, letting each fail, scale and deploy independently.
Fan-out
Delivering one published message to many subscribers in parallel, for example an SNS topic with several SQS queue subscriptions.
Choreography
Coordination where each service reacts to events and emits new ones with no central controller.
Orchestration
Coordination where a central workflow engine, such as Step Functions, invokes each step and manages state and errors.
Stateless service
A service that keeps no client state between requests, storing it externally so any instance can handle any request.
Event-driven architecture
A design in which components emit events about things that happened and other components react, rather than calling each other directly.
Microservice
A small, independently deployable service that owns one business capability and its own data, reached through an API or events.
Real-world example

An online shop's checkout Lambda function publishes an OrderPlaced message to an SNS topic. Three SQS queues subscribe: one feeds the payment service, one the warehouse service and one the email service. When the email provider has an outage, messages simply wait in its queue while payments and shipping continue normally.

Common mistakes

You decide

Rivermint Pharmacy's prescription service must, after each new prescription, notify the patient by SMS, update a reporting database and alert the pharmacist's tablet app. The reporting database is sometimes slow during nightly maintenance, and the team does not want that to delay patient notifications. Which design fits best?

Show the answer

Publish one message per prescription to an SNS topic and subscribe a separate SQS queue for each of the three consumers. Each consumer processes at its own pace, and when the reporting database is slow, its messages wait in its queue without delaying SMS or tablet alerts. A single Lambda function that calls all three in sequence would couple them.

A loan application process at Brookfield Lending checks credit, waits up to three days for an underwriter's approval, then either funds the loan or sends a decline letter. Auditors want to see exactly which step each application is on. Choreography or orchestration?

Show the answer

Orchestration with an AWS Step Functions Standard workflow. It keeps a visible execution history per application, supports a long human approval wait, and centralizes branching and error handling, none of which choreography provides on its own.

Exam tip: When a question says one event must trigger several independent processes and a slow consumer must not affect the others, look for SNS fan-out to SQS queues (or EventBridge with multiple targets). When it stresses a visible, ordered workflow with error handling, pick Step Functions orchestration.

Check yourself

Why is SNS publishing to several SQS queues more resilient than SNS invoking several services directly?

Each queue buffers messages for its consumer, so a slow or failed consumer can catch up later without losing messages or delaying other consumers.

When would you choose orchestration over choreography?

When the process needs a central view of state, strict ordering, retries or compensation for failed steps, or human approval, which a Step Functions state machine provides.

What makes a web tier stateless?

It stores session and user data in an external store such as DynamoDB or ElastiCache instead of instance memory or local disk, so any instance can serve any request.

Two services exchange data by reading and writing the same DynamoDB table. What is the design problem?

They are coupled through shared data, so a change by one can break the other; each microservice should own its data and share it through an API or events.

Study Developer Associate for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the Developer Associate study plan