
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
A company is designing an application. The application uses an AWS Lambda function to receive information through Amazon API Gateway and to store the information in an Amazon Aurora PostgreSQL database.
During the proof-of-concept stage, the company has to increase the Lambda quotas significantly to handle the high volumes of data that the company needs to load into the database. A solutions architect must recommend a new design to improve scalability and minimize the configuration effort.
Which solution will meet these requirements?
A
Refactor the Lambda function code to Apache Tomcat code that runs on Amazon EC2 instances. Connect the database by using native Java Database Connectivity (JDBC) drivers.
B
Change the platform from Aurora to Amazon DynamoDB Provision a DynamoDB Accelerator (DAX) cluster. Use the DAX client SDK to point the existing DynamoDB API calls at the DAX cluster.
C
Set up two Lambda functions. Configure one function to receive the information. Configure the other function to load the information into the database. Integrate the Lambda functions by using Amazon Simple Notification Service (Amazon SNS).
D
Set up two Lambda functions. Configure one function to receive the information. Configure the other function to load the information into the database. Integrate the Lambda functions by using an Amazon Simple Queue Service (Amazon SQS) queue.
Explanation:
Correct Answer: D
Why Option D is correct:
Decoupling for Scalability: Using Amazon SQS (Simple Queue Service) to decouple the receiving Lambda function from the database loading Lambda function allows each component to scale independently. The receiving function can handle incoming API requests without being blocked by database operations.
Queue-based Buffering: SQS provides a reliable buffer between the API Gateway and the database. When high volumes of data arrive, messages can accumulate in the queue, preventing data loss and allowing the database loading function to process them at its own pace.
Automatic Scaling: Lambda functions can scale automatically based on the number of messages in the SQS queue. The database loading function will scale up to process the backlog when needed.
Minimal Configuration: This solution requires minimal configuration changes - just adding an SQS queue and modifying the Lambda functions to use it.
Handles High Volume: SQS can handle virtually unlimited throughput, making it suitable for high-volume data scenarios.
Why other options are incorrect:
A: Moving to EC2 instances with Apache Tomcat increases operational overhead, requires managing servers, and doesn't inherently solve the scalability issue. It also increases configuration effort rather than minimizing it.
B: Switching from Aurora PostgreSQL to DynamoDB with DAX is a major architectural change that may not be appropriate if the application requires relational database features. DAX is for DynamoDB acceleration, not PostgreSQL, and this approach requires significant code changes.
C: Using Amazon SNS instead of SQS is problematic because SNS is a pub/sub service that doesn't provide message queuing with persistence. If the database loading function fails or is busy, messages could be lost. SNS doesn't buffer messages like SQS does.
Key AWS Services Used:
This architecture follows the AWS best practice of decoupling components using queues to handle variable loads and improve resilience.