Using DocumentDB with Lambda: connection pooling

0

I would like to implement a modern web app with serverless compute using AWS Lambda and Amazon DocumentDB. How can I manage efficiently connections to the DB? Is there a connection pool mechanism, like the one you have when using Amazon RDS Proxy, to avoid opening and closing connections from every Lambda execution?

Thanks a lot!

AWS
preguntada hace 3 años3375 visualizaciones
1 Respuesta
1
Respuesta aceptada

Best practices are similar to what you would do when connecting to another data store: declare the variable holding the connection to the database outside your handler so it can be re-utilized by subsequent invocations of your function.

You can find a good example here: https://docs.atlas.mongodb.com/best-practices-connecting-to-aws-lambda.

AWS
respondido hace 3 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas