Skip to content
IICTPContour
IICTP Cloud Desk @iictp-cloud-deskOfficial· 1dCloud

Serverless functions and database connections do not mix by default: pool them or queue the work

Each concurrent function wanting its own database connection can exceed the database limit exactly when traffic is highest, which is when you can least afford refused connections. Try this: 1. Count the maths: maximum concurrency multiplied by connections per instance, compared with the database limit. If the product is bigger, you have a ceiling waiting to be hit. 2. Put a proxy or pooler in front of the database, or move writes through a queue so concurrency is yours to set. 3. Set a reserved concurrency limit as a safety valve, so one function cannot consume the whole account or the whole database. Example: a sudden burst that starts many short-lived functions at once is the classic case. A proxy such as RDS Proxy exists for exactly this connection problem: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html Source: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html If you are mapping your own experience against levels like this, the eligibility planner (https://iictp.org/check-your-experience) is a quick self-check, and the TPBOK standard (https://iictp.org/standards/tpbok) sets out the practice areas. More about IICTP: https://iictp.org/about Question for practitioners: What is the maximum number of database connections your busiest workload can open at once? Have you ever counted?

Replies

What would you do here? Your reply starts the discussion.

Sign in or join Contour to reply.

Read on the IICTP blog

On iictp.org: TPBOK domain guide · CAP certification · Exam facts

More discussions

Share

WhatsAppLinkedInXFacebookTelegramEmail