Q40 — AWS SAP-C02 Ch.3
Question 40 of 75 | ← Chapter 3
Q265. A company wants to refactor its retail ordering web application that currently has a load-balanced Amazon EC2 instance fleet for web hosting, database API services, and business logic. The company needs to create a decoupled, scalable architecture with a mechanism for retaining failed orders while also minimizing operational costs. Which solution will meet these requirements?
- A. Use Amazon S3 for web hosting with Amazon API Gateway for database API services. Use Amazon Simple Queue Service (Amazon SQS) for order queuing. Use Amazon Elastic Container Service (Amazon ECS) for business logic with Amazon SQS long polling for retaining failed orders.
- B. Use AWS Elastic Beanstalk for web hosting with Amazon API Gateway for database API services. Use Amazon MQ for order queuing. Use AWS Step Functions for business logic with Amazon S3 Glacier Deep Archive for retaining failed orders.
- C. Use Amazon S3 for web hosting with AWS AppSync for database API services. Use Amazon Simple Queue Service (Amazon SQS) for order queuing, Use AWS Lambda for business logic with an Amazon SQS dead- letter queue for retaining failed orders. ✓
- D. Use Amazon Lightsail for web hosting with AWS AppSync for database API services. Use Amazon Simple Email Service (Amazon SES) for order queuing. Use Amazon Elastic Kubernetes Service (Amazon EKS) for business logic with Amazon Elasticsearch Service (Amazon ES) for retaining failed orders.
Correct Answer: C. Use Amazon S3 for web hosting with AWS AppSync for database API services. Use Amazon Simple Queue Service (Amazon SQS) for order queuing, Use AWS Lambda for business logic with an Amazon SQS dead- letter queue for retaining failed orders.
Explanation
Option C recommends using Amazon S3 for web hosting and AWS AppSync for database API services. Both services are serverless and highly scalable, which helps in reducing operational costs. Amazon SQS is used for order queuing, which provides a highly available and durable messaging service. AWS Lambda is used for business logic, which is also serverless and scales automatically based on the number of requests. An Amazon SQS dead-letter queue is used for retaining failed orders, which ensures that the failed messages are captured and re-processed later. Option A suggests using Amazon S3 for web hosting, Amazon API Gateway for database API services, and Amazon ECS for business logic, with Amazon SQS as the order queuing mechanism. While Amazon ECS is a viable option for running containers in a scalable manner, it adds an additional layer of complexity to the architecture compared to the serverless approach of AWS Lambda. Option B recommends using AWS Elastic Beanstalk for web hosting, Amazon API Gateway for database API services, and AWS Step Functions for business logic, with Amazon MQ as the order queuing mechanism. Although AWS Elastic Beanstalk is a managed service that abstracts provisioning and scaling, it can be more expensive than the serverless approach of Amazon S3 and AWS AppSync. Additionally, using Amazon S3 Glacier Deep Archive for retaining failed orders could result in longer recovery times. Option D suggests using Amazon Lightsail for web hosting and AWS AppSync for database API services, but Amazon SES as the order queuing mechanism is not an ideal choice for capturing and retaining failed orders. Furthermore, Amazon EKS is a complex service that requires significant operational expertise, and Amazon Elasticsearch Service may not be a cost-effective solution for retaining failed orders. While AppSync is no better than API GW in this context, DLQ is better choice than SQS long polling for retaining failed orders. Hints: Refactoring app to use GraphQL APIs (AppSync) + Serverless + DLQ for failed orders.