- Newest
- Most votes
- Most comments
RDS Proxy establishes a database connection pool and reuses connections in this pool. RDS Proxy queues or throttles application connections that can't be served immediately from the connection pool.
RDS proxy itself does not cache results, it might interact with other layers. You can create an Elasticache from RDS
If the intent is to make your applications more resilient to database failovers, do use RDS multi-AZ with RDS Proxy. As per documentation on Failover
Connecting through a proxy makes your applications more resilient to database failovers. When the original DB instance becomes unavailable, RDS Proxy connects to the standby database without dropping idle application connections. This helps speed up and simplify the failover process. This is less disruptive to your application than a typical reboot or database problem.
RDS Proxy can reduce failover times by up to 66% for RDS Multi-AZ DB instances
I think the poster was looking for a slightly different answer Existing requests will be "maintained" for a period of time until either a failover occurs or the connection times out; a couple minutes at most. A busy system may "fill up" the RDS Proxy for a database. There is a thing called a "Connection Borrow Timeout" RDS Proxy waits for a connection to become available for a specified duration, known as the connection borrow timeout. If no connection becomes available within this period, the proxy returns a timeout error to the application. If there is a single instance, your queries will timeout.
MikeLim's suggestion of a Multi-AZ deployment in this case is good but you could also write the queries to an SQS queue or a Kinesis Topic and have workers process the queries. If the database goes down, all requests will be held on the queue/topic until the DB is back up and they can be processed. The right solution depends on your requirements. The SQS/Kinesis route is not as complex as it sounds once you just do it.
I would avoid using "cache" in this case for clarity, "cache" has a very specific meaning in a database resiliency context that is different than your question.
Thanks, this is exactly what i am looking for
Relevant content
- asked a year ago
- asked 3 years ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 2 years ago
Thanks and I understand it does not cache the result, but does it cache the transactions? It seems like it queues the transaction for the existing connection. So during failover, it preserves the connection and its transactions until the failover process is done. Is this correct understanding?
As per Failover link, most connections stay alive during failovers or other disruptions. Only connections that are in the middle of a transaction or SQL statement are canceled.