SAA-C03 Practice Question 18: RDS Proxy Lambda Connections
AWS Certified Solutions Architect – Associate (SAA-C03) · Test 2 · question 8 of 10
An API built on Amazon API Gateway and AWS Lambda reads and writes to an Amazon RDS for MySQL DB instance. During flash sales, Lambda scales to several thousand concurrent executions, and each one opens its own database connection. The logs fill with Too many connections errors, and the DB instance's CPU spikes from the constant work of setting up connections.
The team must fix this without throttling API requests and without migrating off RDS for MySQL. Which solution meets these requirements?
Show answer and explanation
Answer:
Amazon RDS Proxy keeps a pool of database connections and reuses them across clients, so thousands of short-lived Lambda executions share a much smaller number of real connections to the DB instance. This removes the memory and CPU cost of opening a new connection for every invocation. You can also cap how many connections the proxy opens to the database. During surges, the proxy queues or throttles client connections it cannot serve right away instead of overloading the database. It works with most applications without code changes, beyond switching the endpoint. It can also take credentials from Secrets Manager or use IAM authentication, and it shortens failover time.
Option A buys headroom but does not fix the pattern. Connections still grow with Lambda concurrency, so a bigger flash sale hits the new limit. You also pay for a larger instance around the clock to handle a problem that only shows up in bursts, and connection setup still eats CPU.
Option C only offloads reads. Writes still go to the primary one connection per execution, and the replica gets its own connection storm on the read side.
Option D would stop the connection storm by rejecting the excess invocations. With API Gateway in front, that turns into throttled API requests, which the stem explicitly forbids.
Reference: Amazon RDS Proxy