Amazon RDS Proxy for AWS Lambda
aws.amazon.com
aws.amazon.com
The result format is a bit clunky but there's all the column information you'd expect.
I found this golang database interface which ended up dropping in as expected with a few tweaks.
https://github.com/Clever/rds/tree/birthday
My bill for Aurora Serverless Postgres last month was less than a dollar.
This proxy is probably an offshoot of the serverless proxy.
https://www.jeremydaly.com/aurora-serverless-the-good-the-ba...
Free til the end of 2019, 0.015 per vCPU (of the underlying RDS instance) per hour the proxy is enabled. So it is not scaled down to 0 when not in use. For comparison, a t3.micro (2 vCPU, 1gb ram) is 0.0104 per hour. If you're a big project it might be worth it, but just keep in mind rolling your own proxy or using the RDS serverless APIs are cheaper options.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide...
If I'm using Aurora Serverless right now and want to switch over to RDS Proxy I'm going to have to rewrite my calls.
However I do wish they’d include how this will evolve alongside last years announced data API.
For load blanacing we used ELBv1, we also tried to use NLB, but 350 second timeout, and broken behavior when after timeout it just silently closes the connections was a no-no. ELBv1 doesn't silently close connections, and idle timeout can be set to 1h. After that we configured pgbouncer to close idle connections after 55 minutes. ELBv1 also doesn't have the timing issues with health checks.
IMO NLB is maybe performant, but that's the only good thing about it, in every other category it is crap and for this use case ELBv1 isn't a bottleneck.
If you will plan to revise your setup, be aware that pgbouncer is single threaded so throwing multicore machines at it won't do much good. If CPU ends up being a bottleneck it is better to use a large single core instance and then adding more instances. The only problem with that is that as you're adding more instances you're increasing number of connections to the database, but you could have additional process that could monitor ASG and set the number of instances and dynamically adjust number of server-side connections (doesn't require restarting pgbouncer).
BTW: Since version 1.12.0 you can also run multiple pgbouncer instances listening on the same port so that can help make a better use of extra cores if you chose multicore instances.
Would love to see this come out for Postgres and come to Google Cloud :)
JDBC doesn’t provide connection pooling out of the box. There are connection pooling libraries that layer into JDBC. Most frameworks and application servers do bundle a connection pool out of the box.
Lambda is just a different paradigm than a single monolithic app with a connection pool. I assume that’s what you’re getting at. :)
There are other use cases though. Tools like pgBouncer are fairly useful in a large enterprise where a single database has multiple clients. They provide a single point to coordinate failovers and manage resource limits. I generally prefer a 1:1 relationship between an application and a database, but sometimes you have to play the cards you’re dealt.
This does nothing to solve the issue however. There are many use cases where you can't delay handling requests.