zhammer / morning-cd-listens

Morning.cd listens microservice
MIT License
0 stars 0 forks source link

Postgres connections persist after lambda execution #13

Open zhammer opened 5 years ago

zhammer commented 5 years ago

After deploying #12 and running another playlists backlog job, I still see a bunch of lingering connections on RDS. Honestly not sure what exactly I need to do to close connections from sqlalchemy.

zhammer commented 5 years ago

Honestly maybe I should just use DynamoDB. This is from a thread re: aurora serverless coldstarts. Given how micro each datastore is, I don't really need the SQL features.

https://forums.aws.amazon.com/thread.jspa?threadID=288043

I agree cold starts to AS is a pita.

But that’s said all RDBMS are such a bad fit with lambda based apps. The state fullness in connection pools make it an anti pattern to use lambda and rdbms. Also the need to deploy in Vpc to get to the dB makes it a bad fit.

With Serverless you really do best in going with dynamo which is an amazing db.

Aurora Serverless has its sweet spot in dev and test environments where you have server or container based legacy. In this case you can easily have a heat up endpoint which can be used before testing.

zhammer commented 5 years ago

from dynamodb landing page

MICROSERVICES DATA STORE Build flexible and reusable microservices using DynamoDB as a serverless data store for consistent and fast performance.

zhammer commented 5 years ago
zhammer commented 5 years ago

Not going with DynamoDB. Just moved db out of vpc in #14. Also trying NullPool

zhammer commented 5 years ago

this is actually becoming more of a problem since the website now polls for new listens, so more persisted connections