Front Aurora replicas with an RDS Proxy read-only endpoint for Lambda

Answer Correct answer: A — Create an RDS Proxy with a read-only endpoint for the Aurora cluster and point the Lambda function at the proxy.

A company has an application that uses an Amazon Aurora PostgreSQL DB cluster for the application's database. The DB cluster contains one small primary instance and three larger replica instances. The application runs on an AWS Lambda function. The application makes many short-lived connections to the database's replica instances to perform read-only operations. During periods of high traffic, the application becomes unreliable and the database reports that too many connections are being established. The frequency of high-traffic periods is unpredictable. Which solution will improve the reliability of the application?

  1. Use Amazon RDS Proxy to create a proxy for the DB cluster. Configure a read-only endpoint for the proxy. Update the Lambda function to connect to the proxy endpoint. Correct Answer
  2. Increase the max_connections setting on the DB cluster's parameter group. Reboot all the instances in the DB cluster. Update the Lambda function to connect to the DB cluster endpoint.
  3. Configure instance scaling for the DB cluster to occur when the DatabaseConnections metric is close to the max connections setting. Update the Lambda function to connect to the Aurora reader endpoint.
  4. Use Amazon RDS Proxy to create a proxy for the DB cluster. Configure a read-only endpoint for the Aurora Data API on the proxy. Update the Lambda function to connect to the proxy endpoint.

Community Votes

A
100%

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

Community Insight

RDS Proxy multiplexes many short-lived client connections over a small pool of database connections, and configuring a read-only endpoint on the proxy sends the function's reads to the replicas behind a single endpoint, so the connection count on the database stops scaling with concurrency.

An Aurora PostgreSQL cluster has one small primary and three larger replicas, and a Lambda function makes many short-lived read-only connections to the replicas. Under unpredictable traffic spikes the application becomes unreliable and the database reports too many connections.

Increasing max_connections in the parameter group. That permits more simultaneous connections but every connection still consumes database memory and CPU on the instance, so the instance is pushed further toward resource exhaustion rather than relieved, and it requires a reboot of every instance in the cluster.

Community Discussion (7 comments)

kejam 👍 16 Selected: A
lambda -> rds-proxy -> aurora replica(s) read-only endpoint https://aws.amazon.com/blogs/compute/using-amazon-rds-proxy-with-aws-lambda/ https://aws.amazon.com/about-aws/whats-new/2021/03/amazon-rds-proxy-adds-read-only-endpoints-for-amazon-aurora-replicas/ RDS Data API is used with Aurora Serverless https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html#data-api.limitations
0b43291 👍 2 Selected: A
The other options have limitations or do not address the root cause of the issue: Option B (Increasing max_connections): While increasing the maximum number of connections allowed on the DB cluster may provide a temporary solution, it does not address the underlying issue of inefficient connection management, and it may lead to increased resource consumption and potential performance degradation. Option C (Instance scaling): While instance scaling can help increase the overall capacity of the DB cluster, it does not directly address the issue of too many connections being established. Additionally, it may not be effective if the high-traffic periods are unpredictable and short-lived. Option D (RDS Proxy with Aurora Data API): The Aurora Data API is designed for serverless applications to interact with Aurora Serverless databases using a web services model, not for traditional database connections. It does not address the issue of connection management for the existing application architecture.
AzureDP900 👍 1
Option A allows the application to connect to the replica instances without directly accessing them. This approach helps to: 1) Reduce the number of connections to the primary instance 2) Increase performance by offloading read operations to the replica instances 3) Improve reliability by reducing the load on the primary instance during periods of high traffic
career360guru 👍 1 Selected: A
Option A
duriselvan 👍 2
A is ans lambda -> rds-proxy -> aurora replica(s) read-only endpoint
master9 👍 1 Selected: A
rds-proxy
alexis123456 👍 4
correct Answer is A

Comments & Corrections

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

Expert Analysis

Why the Answer Is Correct

The root problem is that a bursty serverless caller opens and closes a large number of short-lived connections, and each one consumes a connection slot and server resources. RDS Proxy accepts all of those client connections and multiplexes them onto a small managed pool of actual database connections, so the database sees a bounded connection count no matter how many concurrent Lambda executions there are. Configuring a read-only endpoint on the proxy directs the function's read-only operations to the Aurora replicas behind a single endpoint, which also uses the read capacity that is already provisioned. Because the traffic is unpredictable rather than steady, the proxy absorbs the bursts without any capacity pre-provisioning.

Why the Other Options Are Wrong

B: Raising max_connections and rebooting the cluster permits more connections but each additional connection still consumes memory and CPU on the instance, so under a burst the instance becomes more likely to exhaust resources, and the reboot is disruptive. C: Instance scaling on the DatabaseConnections metric would add reader instances, but it reacts after connections are already elevated, requires time to scale, and the function would still be opening a connection per execution, so the connection storm itself is unchanged. D: The Aurora Data API is a separate data plane for the Aurora Serverless data API, and a read-only endpoint is not configured on the RDS proxy in that way, so the option does not describe a valid proxy configuration.

Community Comment Notes

The community voted 100 to 0 for A, and the most-liked comment laid out the path explicitly as Lambda to RDS Proxy to the Aurora replica read-only endpoint, referencing the AWS blog on using Amazon RDS Proxy with AWS Lambda and the announcement of read-only endpoints for RDS Proxy.

Official Reference

Related Analysis

Practice All SAP-C02 Questions

Access 85 questions with complete answers and detailed explanations.

View Full SAP-C02 Practice Test →

← Back to SAP-C02 Study Guide