How to use MongoDB in your serverless app

Link to chapter —

We had a lot of connectivity issues when saving a moderate stream of data when we used the MongoClient to connect to an Atlas Mongo cluster. The issue was we’d lose the connection for a few minutes to even an hour or two even though we tried to cache and reuse it as suggested here and by Atlas.

Fortunately, we are seeing much better results after we dropped the MongoClient and replaced it with Atlas’ Data API

Oh that’s interesting. Let me pass that feedback along and find out what the right approach is.