SAP-C02 Exam QuestionsBrowse all questions from this exam

SAP-C02 Exam - Question 472


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?

Show Answer
Correct Answer: C

During a flash sale, the application experienced increased API calls which led to higher Lambda invocations and database connections, resulting in high CPU utilization in the RDS instance. Using an RDS proxy can help optimize the performance by managing a pool of database connections efficiently. This way, Lambda functions can reuse existing connections instead of opening new ones frequently, reducing the load on the database and improving overall performance. Therefore, creating an RDS proxy and modifying the Lambda function to use the proxy endpoint is the best solution. Additionally, it is indeed possible to create an RDS proxy from the Lambda console, ensuring seamless integration.

Discussion

11 comments
Sign in to comment
oayoadeOption: C
Mar 19, 2024

https://repost.aws/knowledge-center/lambda-rds-database-proxy

titi_rOption: C
Apr 26, 2024

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.

YOUSSEFSWAID
May 3, 2024

Create a new database not RDS proxy! Use an existing database Create a new database

DgixOption: C
Mar 20, 2024

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.

djangoUnchained
Mar 22, 2024

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.

gustori99
Mar 25, 2024

It's not a trap. It _is_ possible to create the RDS Proxy from within the lambda console.

pangchnOption: C
Mar 26, 2024

BCD all looks good. I vote for C

pangchn
Mar 26, 2024

not B, redis is NOSQL so no relevant to this question

pangchn
Mar 26, 2024

umm, NVM https://newsletter.simpleaws.dev/p/elasticache-redis-cache-rds

YOUSSEFSWAID
Apr 22, 2024

C, is wrong Creating Proxy: Within the RDS console, find the "Proxies" section and click on "Create proxy".

TonytheTigerOption: C
Apr 30, 2024

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.

iulian0585Option: D
May 30, 2024

C, is wrong Creating Proxy: Within the RDS console, find the "Proxies" section and click on "Create proxy".

CMMCOption: D
Mar 19, 2024

check to re-use any existing DB connection across multiple invocations of Lambda function

teo2157Option: D
Apr 15, 2024

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....

teo2157
May 28, 2024

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.

HelpnosenseOption: D
Jun 30, 2024

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.