Shared db connection pool in lambdas - do you ever close the connection explicitly?

This page summarizes the projects mentioned and recommended in the original post on /r/aws

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • pgx

    PostgreSQL driver and toolkit for Go

  • Just doing some testing with Golang postgres library pgx's connection pools, and I figure I could set this up outside of the main() function to share the connection pool with concurrent lambda executions. One thing I can't figure out though is I don't think I can safely, and explicitly call a close() on the connection. Is this normal to just let the connection time out if the lambda is not being used? If the connection times out before the lambda shuts off, then how can I re-establish a globally available connection pool? I imagine this is a potential problem for any db that's not accessible over HTTP(s)?

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts