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
質問済み 3年前3373ビュー
1回答
1
承認された回答

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
回答済み 3年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ