4 of the 13 questions we have for this objective, shown with the answer and the reasoning.
Design architectures built for the cloud
Morland Imaging processes medical image uploads with worker applications on Amazon EC2 instances in an Auto Scaling group. Workers poll an Amazon SQS queue named scans-in, and each scan takes about 2 minutes to process. Uploads arrive unpredictably, from near zero overnight to 6,000 per hour during clinic hours. The business objective is that every scan finishes within 10 minutes of upload at the lowest cost, and a worker must never be terminated while processing a scan. CPU utilization varies widely between scan types.
Which three actions should the solutions architect take? Each correct answer presents part of the solution.
- ACreate scheduled actions that set a fixed capacity of 20 instances during clinic hours and 2 instances overnight.Arrivals are unpredictable, so fixed schedules either waste money when uploads are low or miss the latency objective during peaks.
- BPublish a custom CloudWatch metric for backlog per instance, calculated as ApproximateNumberOfMessagesVisible for scans-in divided by the number of InService instances.Backlog per instance changes in proportion to capacity, which is what a target tracking policy needs. Queue depth alone does not change when instances are added.
- CCreate a target tracking scaling policy on the backlog-per-instance metric with a target of about 5 messages, based on an acceptable latency of 10 minutes divided by 2 minutes per scan.The acceptable backlog per instance is the latency objective divided by processing time per message. Tracking that target keeps the fleet just large enough to meet the 10-minute objective.
- DHave each worker enable instance scale-in protection for itself while it processes a scan and disable it when idle.Instance scale-in protection stops Auto Scaling from selecting a protected instance during scale-in, so instances in the middle of a scan are not terminated.
- ECreate a target tracking scaling policy on average CPU utilization of 60 percent.CPU varies by scan type and does not reflect how many scans are waiting, so the group could stay small while the queue grows past the 10-minute objective.
Why: Elastic architectures should scale on the metric that represents the business objective, not on a convenient infrastructure metric. For queue-driven workers, AWS recommends a backlog-per-instance metric and a target value derived from acceptable latency divided by per-message processing time, here 10 minutes divided by 2 minutes, or about 5 messages per instance. Scale-in protection, set by the worker while busy, prevents interrupting work in progress. CPU-based and scheduled scaling are real options that do not track queue backlog, so they cannot guarantee the latency objective at the lowest cost.
Design architectures built for the cloud
Larchmont News serves its site through Amazon CloudFront at peaks of more than 100,000 requests per second. For every viewer request, it must normalize the URL to lowercase, add a request header that tells the origin which variant to serve, and assign the viewer to an A/B test variant based on a cookie, all in well under a millisecond. The logic needs no network calls and no access to the request body.
Which solution should the solutions architect use to minimize latency and cost?
- AAWS WAF rules on the distribution that rewrite the URL and set the cookie.WAF can inspect, block and add custom headers to requests, but it does not rewrite URLs or run A/B assignment logic.
- BCloudFront Functions associated with the viewer request event.CloudFront Functions run lightweight JavaScript at edge locations with sub-millisecond start-up, scale to very high request rates and cost less than Lambda@Edge, which suits header and URL manipulation.
- CLambda@Edge functions associated with the viewer request event.Lambda@Edge supports network calls and the request body, but it runs in Regional edge caches with higher latency and cost, which this simple logic does not need.
- DAn AWS Lambda function behind an Application Load Balancer set as the CloudFront origin.Sending every request to an origin adds a round trip and defeats caching for the A/B variants.
Why: Edge compute on CloudFront comes in two forms. CloudFront Functions handle viewer request and response events with very short, simple JavaScript such as URL rewrites, header changes, cache key normalization and cookie-based routing, at sub-millisecond latency and high scale. Lambda@Edge handles heavier work such as network calls, request bodies and origin events. When the scenario stresses sub-millisecond logic, huge request rates and no network access, CloudFront Functions is the fit.
Design architectures built for the cloud
Saltmarsh Brokerage is replacing a migrated IBM MQ queue manager that carries account ledger updates between two applications. Both applications are being rewritten during the migration to use the AWS SDK, so no JMS or other broker protocol needs to be preserved. Updates for the same account must be processed in the order they were sent and must not be applied twice, while updates for different accounts can be processed in parallel. Peak volume is 1,500 messages per second, and the team wants a fully managed, serverless service with no broker instances to size, patch, or fail over.
Which solution should the solutions architect recommend?
- AAmazon EventBridge with a rule that sends updates to an AWS Lambda functionEventBridge routes events by content but does not guarantee ordering or exactly-once delivery to targets.
- BAn Amazon SQS standard queue with consumers that sort messages by timestampStandard queues provide at-least-once delivery and best-effort ordering, so duplicates and reordering can occur, and sorting in the consumer cannot reliably fix ordering across consumers.
- CAn Amazon MQ for ActiveMQ active/standby broker with a JMS queue and message groups keyed on the account IDAmazon MQ can provide ordered JMS delivery and suits migrations that must keep a broker protocol, but it runs broker instances that must be sized and that receive maintenance windows, and protocol compatibility is not required here.
- DAn Amazon SQS FIFO queue that uses the account ID as the message group ID and a deduplication ID for each updateFIFO queues preserve order within a message group and discard duplicates within the deduplication interval. Using the account ID as the group keeps per-account order while letting different accounts process in parallel.
Why: When an existing messaging system enforces ordering and deduplication, the managed replacement must provide the same guarantees. SQS FIFO queues provide ordering per message group and exactly-once processing within the 5-minute deduplication interval, and message groups allow parallelism across keys, which matches the per-account requirement. Throughput of 1,500 messages per second is within FIFO limits, especially with high throughput mode. The deciding constraint between SQS FIFO and Amazon MQ is protocol: Amazon MQ is the right choice when applications must keep JMS, AMQP, or MQTT without code changes, but these applications are being rewritten to the AWS SDK and the team wants no brokers, which points to SQS. Standard queues and EventBridge favor scale and flexibility over strict ordering.
Design architectures built for the cloud
Fenwick Journeys is building a trip-booking feature that reserves a flight, a hotel and a rental car through three separate microservices. If any reservation fails, the reservations already made must be cancelled. A fraud review step can hold a booking for up to 6 hours before payment is captured. Other teams must be able to react to completed bookings without changes to the booking workflow, and support staff need a visual history of each booking's steps.
Which solution meets these requirements?
- AAn AWS Step Functions Express workflow started directly by the web API that calls the three services in sequence, uses Catch fields for compensating cancels, and publishes completion events to Amazon EventBridge.Express workflows have a maximum duration of 5 minutes, so they cannot wait up to 6 hours for fraud review. They also do not support the task token callback pattern, and their execution history is available only through CloudWatch Logs rather than the built-in execution history of Standard workflows.
- BA chain of Amazon SQS queues where each service reads from one queue and writes to the next, with dead-letter queues for failures.A queue chain has no central place to run compensations in reverse order or to show the state of a booking, so cancellation logic would be scattered across services.
- CAn AWS Step Functions Standard workflow with Catch-based compensating cancel tasks, a task token callback for fraud review, and a BookingCompleted event sent to Amazon EventBridge.Standard workflows run for up to a year with execution history, Catch fields run the saga's compensating cancel tasks in reverse order, and the task token pattern pauses until the fraud review responds. Publishing a BookingCompleted event to an EventBridge event bus lets other teams subscribe with their own rules.
- DA single AWS Lambda function that calls the three services and sleeps until fraud review completes, then calls an Amazon SNS topic.Lambda functions time out after 15 minutes, so a single function cannot wait 6 hours, and orchestration and compensation logic would all be custom code.
Why: Long-running business transactions that span services are commonly implemented with the saga pattern, where each step has a compensating action that runs if a later step fails. AWS Step Functions Standard workflows are well suited: they support long waits, error catching that routes to compensation steps, callbacks with task tokens, and a visual execution history. Publishing the outcome to EventBridge decouples downstream consumers from the workflow. The 6-hour wait is the deciding constraint that rules out Express workflows and single Lambda functions.