DEV Community

Cover image for MongoDB, Mongoose, and MongoDB Atlas (Cloud Service)
Damilola Emmanuel Olowookere
Damilola Emmanuel Olowookere

Posted on • Edited on

MongoDB, Mongoose, and MongoDB Atlas (Cloud Service)

If you, like me, like short, succinct tech articles (like my previous write-up on a JS spread syntax gotcha and use cases of VueJs mixins); and you like daring tech adventures, then you are going to love this piece of The Three < insert-anything-here™️ > - eers.

IMHO, MongoDB is not just a document store, but one that is great for fast bootstrapping, especially at the ideation stage of a project. This is because at this stage, there may be no concrete decision about db schema, etc.; and things may be changing very fast with respect to db schema.

I recently used MongoDB in a project; and being my first time of using it in production, I must say it really helped in bootstrapping. This advantage of MongoDB was made more obvious to me this time around because I used it alongside PostgreSQL in this same project. The overhead I had in swapping things around in PostgreSQL was relatively higher than in MongoDB.

The part of Mongoose in all these is the awesomeness and ease it brings to using Mongoose in NodeJS apps. However, I find that it does not play nice with MongoDB Atlas, especially that a weird behaviour is not documented.

Specifically, when you need to use Mongoose to connect to a remote MongoDB Atlas db instance, you must set your authSource and ssl connection parameters appropriately, so that you won't spend a decade debugging and wiring things up.

So, there it is. I hope you enjoy this piece. See you in the next one!

Top comments (0)