How Do You Stop Lambda from Overloading a Private RDS PostgreSQL Database?

SAA-C03 By islever Editorial Last updated

Short answer

B Point the Lambda client driver at the RDS Proxy endpoint and deploy the functions inside a VPC so connections are pooled and PostgreSQL is not overloaded.

Question

A company’s ecommerce website has unpredictable traffic and uses AWS Lambda functions to directly access a private Amazon RDS for PostgreSQL DB instance. The company wants to maintain predictable database performance and ensure that the Lambda invocations do not overload the database with too many connections. What should a solutions architect do to meet these requirements?
  1. Point the client driver at an RDS custom endpoint. Deploy the Lambda functions inside a VPC.
  2. Point the client driver at an RDS proxy endpoint. Deploy the Lambda functions inside a VPC. Correct Answer
  3. Point the client driver at an RDS custom endpoint. Deploy the Lambda functions outside a VPC.
  4. Point the client driver at an RDS proxy endpoint. Deploy the Lambda functions outside a VPC.

Key Takeaways

The question tests two linked facts — that only RDS Proxy pools and multiplexes Lambda connections to RDS, and that a private RDS instance is reachable only from Lambda functions attached to the VPC — and the trap is treating an RDS custom endpoint as if it performed connection pooling.

Unpredictable traffic hitting Lambda functions that talk directly to a private Amazon RDS for PostgreSQL instance can exhaust the database's connection limit. This page establishes that pointing the client driver at the RDS Proxy endpoint while deploying the Lambda functions inside a VPC (option B) is the correct design.

Common mistake: Picking a custom endpoint (options A or C) because 'custom' sounds purpose-built for this scenario; custom endpoints only route traffic to specific instances in a cluster and never pool connections, so unpredictable Lambda bursts would still overwhelm PostgreSQL's max_connections.

Expert Analysis

Why the Answer Is Correct

Each Lambda invocation or warm container opens its own database connection, so an unpredictable ecommerce traffic spike can spawn hundreds of concurrent sessions and exhaust the PostgreSQL instance's connection limit. RDS Proxy sits between the functions and the DB instance, maintaining a warm pool of connections it hands out and reuses, which keeps database performance predictable and absorbs sudden bursts without overloading the instance. The second half of option B is just as mandatory: because the DB instance is private, the functions must be deployed inside the VPC with subnets and security groups that can reach it. Community commenters converged on the same reasoning — ogerber explains that a Lambda "outside of a VPC can't access an RDS instance that's inside a VPC", and Kezuko simply states the functions have to be inside the VPC to reach the database. Option B is therefore the only choice that solves both the connection-exhaustion problem and the network-reachability problem.

Why the Other Options Are Wrong

Option A gets the VPC placement right but pairs it with an RDS custom endpoint, which exists to route traffic to particular instances in a cluster, not to pool or multiplex connections — Lambda bursts would still create unlimited sessions. Options C and D place the Lambda functions outside the VPC, which makes the private RDS instance unreachable regardless of which endpoint the driver points at, so they fail the question immediately. Option D is doubly wrong because it combines the incorrect endpoint type with the incorrect network placement. Custom endpoints also are not the mechanism that delivers predictable database performance under spiky, unpredictable invocation patterns; only a connection proxy does that.

Community Comment Notes

Every recorded learner vote (100 total) selected option B, and the comments explain why rather than just repeating the answer. ogerber cites the AWS re:Post knowledge-center guidance and quotes that a Lambda function "outside of a VPC can't access an RDS instance that's inside a VPC", tying both halves of the answer to official documentation. Kezuko reinforces the VPC requirement in one line, and Moon239 notes this scenario repeats from SAA-C02 question 802, which signals the pattern is worth memorizing as a rule rather than a one-off. Take the consensus as a study signal, but the deciding logic remains RDS Proxy for pooling plus in-VPC Lambda for reachability.

Official Reference

Exam Strategy

When a question pairs Lambda (or any bursty, serverless compute) with a relational database and mentions too many connections, unpredictable traffic, or predictable performance, RDS Proxy is almost always the intended answer. Then verify the placement half of the option: a private RDS instance can only be reached from inside its VPC, so reject any choice that leaves the functions outside the VPC.

Frequently Asked Questions

Why doesn't an RDS custom endpoint fix Lambda connection exhaustion?

Custom endpoints only route traffic to chosen instances within a cluster; they don't pool, queue, or multiplex client connections, so spiky Lambda invocations would still overwhelm the PostgreSQL instance.

Why must the Lambda functions be inside a VPC in this scenario?

The RDS for PostgreSQL instance is private and has no public endpoint, so functions outside a VPC cannot reach it; attaching them to VPC subnets with proper security groups is mandatory.

More SAA-C03 FAQ →

Community Votes

B
100%

100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 3 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 3

  1. ogerber 👍 10 Answered B
    Option B. Reduce number of connection to RDS -> RDS Proxy. "A Lambda function that's outside of a VPC can't access an RDS instance that's inside a VPC." https://repost.aws/knowledge-center/connect-lambda-to-an-rds-instance
  2. Kezuko 👍 5 Answered B
    Have to be inside VPC in order to access the RDS instance for Lambda
  3. Moon239 👍 3
    Same as question 802 in SAA-C02

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Practice All SAA-C03 Questions

Access 120 questions with complete answers and detailed explanations.

View Full SAA-C03 Practice Test →

← Back to SAA-C03 Study Guide