1 min readDec 13, 2018
Good point, Tirumarai, connections to the database are definitely a concern. That said, there are some great strategies I like to lean towards first:
- Use a read replica for queries to separating read and write workloads, Postgraphile has a plugin for this but it is easy to implement yourself
- Choose an instance size that better suits your needs
- Protect the database by limiting concurrency on the Lambda, which throttles calls and returns 429s if the limit is hit
Connection pooling is a great failsafe, but users will feel the latency if Lambdas are waiting around for a connection to be available in the pool.