What should a solutions architect do to improve the architecture of this application?
Set the Lambda function’s runtime timeout value to 15 minutes.
Configure an S3 bucket replication policy. Stage the documents in the S3 bucket for later processing.
Deploy an additional Lambda function. Load balance the processing of the documents across the two Lambda functions.
Create an Amazon Simple Queue Service (Amazon SQS) queue. Send the requests to the queue. Configure the queue as an event source for Lambda.
Explanations:
Setting the Lambda function’s runtime timeout to 15 minutes may allow it to process larger documents, but it does not address the issue of potentially overwhelming the Lambda function with too many simultaneous invocations. If too many documents are uploaded at once, Lambda may still struggle to keep up, leading to dropped events.
Configuring an S3 bucket replication policy is useful for maintaining copies of documents across regions or accounts but does not help with the immediate processing of documents. This option does not address the need for reliable document processing in a timely manner.
Deploying an additional Lambda function may help with scaling, but simply adding another function does not provide a reliable mechanism for handling bursts of document uploads. Without proper orchestration, both functions could still be overwhelmed by spikes in upload traffic.
Creating an Amazon SQS queue to send requests for processing allows for better handling of bursts of document uploads. By decoupling the upload process from the processing function, documents can be queued and processed at a manageable rate, ensuring that none are lost due to overloading the Lambda function. This improves the reliability and scalability of the application.