Messaging, integration and business applications

Decoupling one component from another: a queue that holds work until a worker takes it, a topic that tells every subscriber at once, and a state machine that remembers where a multi-step process got to.

Lesson 10 of 11 in objective 3. Cloud technology and services, part of AWS Certified Cloud Practitioner (CLF-C02).

Three integration services, and the question each one answers. Amazon SQS — The question it answers: Who has to do this work?; Who receives a message: One consumer, which then deletes it; Reach for it when: A slow or restarting worker must not fail the caller. Amazon SNS — The question it answers: Who needs to know this happened?; Who receives a message: Every subscriber gets its own copy; Reach for it when: Several unrelated parties react to one event. AWS Step Functions — The question it answers: What happens next, and did it work?; Who receives a message: Nobody — it calls each step itself; Reach for it when: A sequence with retries, branches and a state worth inspecting Amazon SQS Amazon SNS AWS Step Functions The question it answers Who has to do this work? Who needs to know this happened? What happens next, and did it work? Who receives a message One consumer, which then deletes it Every subscriber gets its own copy Nobody — it calls each step itself Reach for it when A slow or restarting worker must not fail the caller Several unrelated parties react to one event A sequence with retries, branches and a state worth inspecting
Three integration services, and the question each one answers.

A queue holds work until somebody does it

Amazon SQS is a pull-based queue: producers write messages, a consumer polls for them, and a message stays until it has been processed and deleted. A visibility timeout stops two workers picking up the same message, and a dead-letter queue collects whatever repeatedly fails so it can be looked at rather than lost. The value is loose coupling — either side can be slow, restarting or scaling while the other carries on.

That is why a checkout calling a fulfilment service directly and waiting for an answer is the shape a queue fixes. With the queue in the middle, a spike or an outage in fulfilment becomes a growing backlog instead of failed checkouts and lost orders. The two options offered against it are both real improvements to something else: retries with a longer timeout leave checkout coupled to fulfilment's health and make the customer wait longer before being told it failed, and a larger instance simply raises a ceiling that the next spike goes over in the same way.

A topic tells everybody, once

Amazon SNS is publish-and-subscribe: one message is delivered to every subscriber, and a subscriber can be an email address, an AWS Lambda function, an SQS queue or an HTTPS endpoint. That is the fan-out pattern, and its virtue is that the publisher knows nothing about the destinations — adding a fifth one next month is a subscription rather than a change to the code that publishes.

The misreading the exam tests is using a queue for this. A message on a queue is processed by ONE consumer and then deleted, so four pollers on one queue would each get a share of the messages rather than all of them getting every message. Publishing to a topic whose subscribers are queues is the classic combination, because each consumer then gets its own buffer. Amazon EventBridge does a related job with content-based routing rules and a much wider set of AWS and third-party targets.

When the sequence itself is the problem

When functions invoke each other directly, the orchestration is scattered through the code and nowhere is the state of one application written down — which is precisely the complaint in a stem that says nobody can tell where a stalled request stalled. AWS Step Functions moves the sequence out into a state machine: the order, the retries, the branch when a check comes back negative and the wait for a human approval are all declared outside the functions, and every execution leaves a visible history.

The distractors here are the other integration services doing what they are good at, in the wrong place. More Lambda functions is more of the same scattering. A queue between each pair of steps decouples them beautifully and expresses no sequence and no branching, so one application's state ends up spread across six queues with nothing joining it up. A scheduler starts things at a time, and timing is not the problem.

A workflow whose state lives outside the functions doing the work. In order: Validate (the state machine calls the function and records what came back), then Credit check (retries are configured here rather than written into the code), then Branch on the result (a negative check takes a different path), then Await approval (the execution waits for a person with nothing of yours running), then Notify, then archive (the history shows which step every application reached). Validate the state machine calls the function and records what came back Credit check retries are configured here rather than written into the code Branch on the result a negative check takes a different path Await approval the execution waits for a person with nothing of yours running Notify, then archive the history shows which step every application reached
A workflow whose state lives outside the functions doing the work.

Applications you buy rather than build

This part of the syllabus also names business applications that are bought whole rather than assembled: Amazon Connect is a cloud contact centre, and Amazon SES sends bulk and transactional email. Their exam value is simply recognising what each one is for, so that an option naming SES in a question about four different destinations can be rejected as solving one quarter of the problem.

The pattern across the whole objective is the same one: each service answers a specific question, and a wrong answer is nearly always a service that answers a neighbouring question well. Sort them by the question and the options stop looking alike — what happens next is Step Functions, who does the work is SQS, who needs to know is SNS, and which of many targets should receive this event is EventBridge.

Worth carrying in

Amazon SQS
Pull-based queue. One consumer per message, held until deleted. Buffers a slow worker.
Visibility timeout
Hides a message while one consumer works on it, so two do not take the same one.
Dead-letter queue
Where messages go after repeatedly failing, so they can be examined rather than lost.
Amazon SNS
Publish and subscribe. Every subscriber gets a copy: email, Lambda, SQS, HTTPS.
Amazon EventBridge
Event routing with content-based rules to a wide set of AWS and third-party targets.
AWS Step Functions
A state machine outside the code: order, retries, branching, waits, and a visible history.
Amazon Connect
A cloud contact centre, bought rather than built.
Amazon SES
Bulk and transactional email sending.

What the exam does with this

Objective
3. Cloud technology and services
Share of the exam
34% (the whole objective)
Questions in this lesson
3
Signed for by a person
0

Partly checked. None of the 3 questions here has been read against the cited source by a person. 3 questions have been checked against their cited clause by an automated pass — which is not the same thing, and is not a signature.

Only questions a person has signed for are used in mock exams here. That is the whole difference between the two kinds of checking above.

Questions in this lesson

Drill this lesson

A lesson is one sitting: the trainer draws a short run from these questions alone and spaces the ones you get wrong.

Practise Messaging, integration and business applications

The rest of objective 3