# Serverless Express + MongodB

**URL:** <https://forum.serverless.com/t/serverless-express-mongodb/17572>\
**Category:** Serverless Architectures\
**Tags:** aws, dynamodb\
**Created:** [August 31, 2022, 11:15pm UTC](https://forum.serverless.com/t/serverless-express-mongodb/17572 "2022-08-31T23:15:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eran](https://avatars.discourse-cdn.com/v4/letter/e/5f8ce5/32.png) [@Eran](https://forum.serverless.com/u/Eran)\
**Post date:** [August 31, 2022, 11:15pm UTC](https://forum.serverless.com/t/serverless-express-mongodb/17572/1 "2022-08-31T23:15:53Z")

</div>

Hello.

We have an Express Typescript app running that heavily relies on MongoDB.

We’re looking to migrate to serverless but would really like to keep using MongoDB if it makes sense. I saw a bunch of tutorials but they all init the mongo connection in the global scope which could be a problem as so many of our endpoints use mongo. I also haven’t seen any documentation on how to keep a connection pool open and share across lambdas.

I’m wondering if anyone solved this problem? Would really love to hear your thoughts

Eran
