Q21 — AWS SAA-C03 Ch.5

Question 21 of 65 | ← Chapter 5

Q321. A company is developing a new machine learning (ML) model solution on AWS.The models are developed as independent microservices that fetch approximately 1 GB of model data from Amazon S3 at startup and load the data into memory. Users access the models through an asynchronous API. Users can send a request or a batch of requests and specify where the results should be sent. The company provides models to hundreds of users. The usage patterns for the models are irregular. Some models could be unused for days or weeks. Other models could receive batches of thousands of requests at a time.Which design should a solutions architect recommend to meet these requirements?

Correct Answer: D. Direct the requests from the API into an Amazon Simple Queue Service (Amazon SQS) queue. Deploy the models as Amazon Elastic Container Service (Amazon ECS) services that read from the queue.Enable AWS Auto Scaling on Amazon ECS for both the cluster and copies of the service based on the queue size

Explanation

This approach uses Amazon ECS to deploy the models as containers, which can fetch data from Amazon S3 at startup and load it into memory. The API sends requests to an SQS queue, which triggers the Amazon ECS service to process the request. AWS Auto Scaling can be enabled on Amazon ECS for both the cluster and the service based on the size of the SQS queue. This allows you to scale up or down in response to demand, ensuring that there are enough resources available to handle incoming requests. Option A, directing requests to an NLB and deploying models as AWS Lambda functions, may not be the best fit for this scenario as the amount of model data to load may exceed the memory limits of a Lambda function.Option B, directing requests to an ALB and deploying models as Amazon ECS services with App Mesh, may introduce additional complexity and cost overheads due to the use of App Mesh. Option C, deploying models as AWS Lambda functions triggered by SQS events, may not provide enough control over the underlying infrastructure to optimize performance and cost.