サービス · Database
Amazon RDS Proxy
A managed connection pool in front of RDS or Aurora, so many clients can share few database connections.
このレッスンはまだ翻訳されていないため、英語で表示しています。
Too many connections errors
- Pools and reuses connections
Lambda opens a connection per call
- Absorbs the burst
Slow, rough failover
- Keeps client connections open
Passwords in code
- IAM authentication and Secrets Manager
| Symptom | What the proxy does |
|---|---|
| Too many connections errors | Pools and reuses connections |
| Lambda opens a connection per call | Absorbs the burst |
| Slow, rough failover | Keeps client connections open |
| Passwords in code | IAM authentication and Secrets Manager |
概要
Every database connection uses memory. Thousands of short-lived connections can overload a database, even when the queries are light. This happens with AWS Lambda, where each function instance opens its own connection, and with applications that scale out fast.
Amazon RDS Proxy sits between the clients and the database. It keeps a pool of open connections and shares them among clients. If there are too many requests, it queues them instead of failing. The application connects to the proxy endpoint with no code changes, apart from the new hostname.
概要
The proxy also helps with failover. When the database fails over to the standby, the proxy keeps the client connections and connects to the new primary, so applications see a shorter outage. It can require IAM authentication from clients and read the database password from AWS Secrets Manager, so no password sits in code.
覚えること
- Pools and shares connections. Protects the database from connection storms.
- Faster, smoother failover for RDS Multi-AZ and Aurora.
- IAM authentication for clients. Database credentials in AWS Secrets Manager.
- Works with RDS (MySQL, PostgreSQL, MariaDB, SQL Server) and Aurora (MySQL and PostgreSQL).
覚えること
- Runs in your VPC and is not publicly accessible. Clients must reach the VPC.
- It does not cache query results. It is not a replacement for ElastiCache.
試験では
- “Lambda functions open too many database connections” points to RDS Proxy.
- “Reduce failover time and keep application connections” points to RDS Proxy.
- “Avoid storing database passwords in the application” points to RDS Proxy with IAM authentication and Secrets Manager.