AWS Solutions Architect · Design High-Performing Architectures · medium

Hundreds of AWS Lambda functions scale concurrently during market open and connect to an Amazon RDS for PostgreSQL instance. During peak bursts, the database exhausts its connection limit and rejects new connections. Which change resolves the connection exhaustion with minimal application code changes?

Published · Last updated · checked before publication — how we verify questions

Options

  • ACreate three Amazon RDS Read Replicas and update the Lambda functions to distribute write queries across them
  • BDeploy Amazon RDS Proxy in front of the RDS for PostgreSQL instance and point the Lambda functions to the proxy endpointCorrect answer
  • CPlace an Amazon ElastiCache for Memcached cluster in front of RDS and route all database transactions through it
  • DMigrate the RDS instance to a Multi-AZ standby deployment so connection limits double across both Availability Zones

Answer: B. Deploy Amazon RDS Proxy in front of the RDS for PostgreSQL instance and point the Lambda functions to the proxy endpoint

Amazon RDS Proxy pools and shares established database connections across concurrent Lambda execution environments, preventing connection spikes from overwhelming the PostgreSQL engine and requiring only an endpoint change. Read replicas do not pool write connections, ElastiCache caches reads rather than pooling relational connections, and provisioned concurrency alone still opens one connection per execution environment.

Why the other options are wrong

  • A. Create three Amazon RDS Read Replicas and update the Lambda functions to distribute write queries across them — RDS Read Replicas accept read traffic only and neither accept writes nor pool connections to the primary instance.
  • C. Place an Amazon ElastiCache for Memcached cluster in front of RDS and route all database transactions through it — ElastiCache caches key-value query results and cannot pool relational connections or execute PostgreSQL transactions.
  • D. Migrate the RDS instance to a Multi-AZ standby deployment so connection limits double across both Availability Zones — An RDS Multi-AZ standby instance is passive for failover only and does not double active connection capacity.

All Design High-Performing Architectures questions and the topic overview →

AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.