exam questions

Exam AWS Certified Solutions Architect - Professional SAP-C02 All Questions

View all questions & answers for the AWS Certified Solutions Architect - Professional SAP-C02 exam

Exam AWS Certified Solutions Architect - Professional SAP-C02 topic 1 question 473 discussion

An ecommerce company runs an application on AWS. The application has an Amazon API Gateway API that invokes an AWS Lambda function. The data is stored in an Amazon RDS for PostgreSQL DB instance.

During the company’s most recent flash sale, a sudden increase in API calls negatively affected the application's performance. A solutions architect reviewed the Amazon CloudWatch metrics during that time and noticed a significant increase in Lambda invocations and database connections. The CPU utilization also was high on the DB instance.

What should the solutions architect recommend to optimize the application's performance?

  • A. Increase the memory of the Lambda function. Modify the Lambda function to close the database connections when the data is retrieved.
  • B. Add an Amazon ElastiCache for Redis cluster to store the frequently accessed data from the RDS database.
  • C. Create an RDS proxy by using the Lambda console. Modify the Lambda function to use the proxy endpoint.
  • D. Modify the Lambda function to connect to the database outside of the function's handler. Check for an existing database connection before creating a new connection.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
titi_r
Highly Voted 9 months, 2 weeks ago
Selected Answer: C
Some guys got confused whether it's possible to create a DB proxy from the Lambda console Yes, you CAN create a proxy from within the Lambda console: open a function -> Configuration -> RDS databases -> Add Proxy, then select a radio button with two options: - Create a new database proxy - Choose an existing database proxy Said that, "C" is correct.
upvoted 10 times
YOUSSEFSWAID
9 months, 1 week ago
Create a new database not RDS proxy! Use an existing database Create a new database
upvoted 1 times
...
...
oayoade
Highly Voted 10 months, 3 weeks ago
Selected Answer: C
https://repost.aws/knowledge-center/lambda-rds-database-proxy
upvoted 7 times
...
skydev
Most Recent 1 week, 2 days ago
Selected Answer: B
As for me, the correct answer is B. "The CPU utilization also was high on the DB instance" - DB Utilization can be high due to unoptimized queries. Opening a new connection for PG is not a complex operation (it does not consume many resources). Adding connection pooling will not help in this situation, IMHO, because even one unoptimized query is enough to consume all CPU resources on the database layer. ElastiCache will allow query offloading from the DB layer.
upvoted 1 times
...
TomTom
2 months, 2 weeks ago
Selected Answer: A
The first part is a significant increase in Lambda invocation and database connection. So, increasing the Lambda function's memory is the quickest solution. This will allow the function to handle more concurrent requests and reduce cold start times, immediately improving response times.
upvoted 2 times
...
AzureDP900
2 months, 3 weeks ago
Creating an RDS proxy by using the Lambda console and modifying the Lambda function to use the proxy endpoint can help improve performance during peak usage periods like flash sales. This approach has several advantages: C is right Reduced Database Load: By using a connection pool provided by the RDS proxy, you can reduce the number of database connections and queries, which can help decrease CPU utilization and improve overall system performance. Improved Response Times: With an RDS proxy, your application can respond more quickly to user requests, as it doesn't need to wait for database queries to complete.
upvoted 1 times
...
JoeTromundo
3 months, 3 weeks ago
Selected Answer: C
"Step 3 1. Open the Functions page in the LAMBDA CONSOLE. 2. In Functions, choose your Lambda function. 3. Choose Configuration, and then choose ADD DATABASE PROXIES. 4. Enter the following variables: Proxy identifier: The name of the proxy. RDS DB instance: A supported MySQL or PostgreSQL DB instance or cluster. Secret: The Secrets Manager that you created. IAM role: The IAM role that you created. Authentication: Choose Password to connect with database credentials or choose Execution role to use the function's IAM credentials for authentication. 5. Choose Add."
upvoted 2 times
...
zolthar_z
6 months ago
Selected Answer: D
With the current options for my is D, because you can't create a RDS Proxy from Lmabda function console, unless the C is misspelled and the answer is only AWS Console
upvoted 1 times
...
Helpnosense
7 months, 1 week ago
Selected Answer: D
Vote D because answer C is incorrect without mention increasing db server qty increase behind proxy. No improvement by just changing endpoint from db to db proxy. D can help by reusing the db connection instead of one connection per thread. Lambda by default is parallel run inside the handler.
upvoted 1 times
...
iulian0585
8 months, 1 week ago
Selected Answer: D
C, is wrong Creating Proxy: Within the RDS console, find the "Proxies" section and click on "Create proxy".
upvoted 2 times
...
TonytheTiger
9 months, 1 week ago
Selected Answer: C
Option C: Read AWS Blog - Using Amazon RDS Proxy w/ AWS Lambda https://aws.amazon.com/blogs/compute/using-amazon-rds-proxy-with-aws-lambda/ Read Section " Create and attach a proxy to a Lambda function " Next, use the Lambda console to Add a Database proxy to a Lambda function. Sign into the AWS Lambda console and open the Lambda function you would like to enable RDS Proxy. This Lambda function needs to be configured for access to the same VPC and Subnets as your RDS database.
upvoted 3 times
...
YOUSSEFSWAID
9 months, 2 weeks ago
C, is wrong Creating Proxy: Within the RDS console, find the "Proxies" section and click on "Create proxy".
upvoted 2 times
...
teo2157
9 months, 3 weeks ago
Selected Answer: D
A) Incorrect because the issue is at database level B) Partially correct but there's one step missed because you have to modify endpoint for the lambda function C) This is the tricky one, it's almost correct and the best option except for one comment, it's said "Create an RDS proxy by using the Lambda console" the RDS proxy is not created in the lambda console but in the RDS console.... D) Totally correct, https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html Said that, going for D but I found this question very tricky....
upvoted 1 times
teo2157
8 months, 1 week ago
I've changed my mind as it's possible to create an RDS proxy by using the Lambda console and regarding the D option, this will improve the lambda performance but not the RDS so going for option C definitely.
upvoted 1 times
...
...
pangchn
10 months, 2 weeks ago
Selected Answer: C
BCD all looks good. I vote for C
upvoted 3 times
pangchn
10 months, 2 weeks ago
not B, redis is NOSQL so no relevant to this question
upvoted 1 times
pangchn
10 months, 2 weeks ago
umm, NVM https://newsletter.simpleaws.dev/p/elasticache-redis-cache-rds
upvoted 2 times
...
...
...
djangoUnchained
10 months, 2 weeks ago
Almost answered C before realizing it was a trap. You don't create RDS Proxies from the LAMBDA console, it is done from the RDS console. D is the best answer.
upvoted 2 times
gustori99
10 months, 2 weeks ago
It's not a trap. It _is_ possible to create the RDS Proxy from within the lambda console.
upvoted 3 times
...
...
Dgix
10 months, 3 weeks ago
Selected Answer: C
C, for the reasons oayoade links to. D is a trap: moving the DB connection outside of the handler obviates the need for keeping track of DB connections. However, C is an even better alternative.
upvoted 4 times
...
CMMC
10 months, 3 weeks ago
Selected Answer: D
check to re-use any existing DB connection across multiple invocations of Lambda function
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago