DVA-C03 practice question: Architectural patterns and decoupling (1 of 2)
Development with AWS Services A free question from our original DVA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.
A video platform publishes an event whenever a creator's upload finishes.
Three independent teams need every event: thumbnail generation, captioning and recommendations.
Each team must work at its own speed and must keep events that arrive while its service is down for a few hours. The upload service should not need a code change each time a new team starts consuming events.
Which design meets these requirements with the LEAST coupling between the services?
Choose one answer.
AA. Have the upload service call each team's REST endpoint in sequence, and retry any call that fails until it succeeds.
BB. Write each upload event to one Amazon SQS standard queue that all three teams poll.
CC. Publish each upload event to an Amazon SNS topic, and subscribe a separate Amazon SQS queue for each team.
DD. Publish each upload event to an Amazon SNS topic, and subscribe each team's HTTPS endpoint directly.
Show the answer and explanation
Answer: C
A. Wrong: This is synchronous, so the upload service must know every consumer and wait on each one. A team that is down for hours forces the upload service to hold and retry events, and every new consumer needs a code change upstream.
B. Wrong: Teams that poll the same queue compete for messages, so each event would reach only one team. Every team needs its own copy of every event.
C. Right: Correct. This is the fanout pattern: SNS copies each event to every subscribed queue, and each queue holds events until its team reads them. The upload service publishes once and does not know who is listening, so a new team needs only a new subscription.
D. Wrong: Every team is sent the event, but SNS stops retrying an HTTPS endpoint after a limited time and then discards the message. A team that is down for hours can lose events, which a queue per team would prevent.
Explanation
The SNS-to-SQS fanout pattern decouples the producer from its consumers. The upload service publishes once and does not know who is listening. SNS copies the event to every subscribed queue, and each queue holds its messages until its own team reads them, so the teams scale and fail independently.
One publish, one queue per team. A new team subscribes its own queue, and the upload service does not change.
Want more on Architectural patterns and decoupling? The 5 full-length practice sets have 5 more Architectural patterns and decoupling questions, 390 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →