DEV Community

Discussion on: PostgreSQL vs MongoDB

Collapse
 
katylava profile image
katy lavallee

I wish I had time to write up a complete post for this, but I just want to say that I worked somewhere where we used mongoDB as the only database, for all our microservices. I don't recall any major issues on account of that decision... at least not related to mongoDB itself, but we did have to revisit our code for handling database results a few times to improve performance there.

Mongo was easier to work with in nodejs than postgresql was (at the time anyway, maybe there are better libs for it now). Also since it was microservices there weren't many places where we needed to do database joins anyway. Mongoose made it pretty easy and fun to work with. As far as performance, on launch day we had over 100k visitors with no issues. We regularly had large traffic spikes and handled them well.

Collapse
 
rhymes profile image
rhymes

Great! Isolated small services where your data layer is mediated by the API is definitely a good use case for document DBs 🔥

Collapse
 
ben profile image
Ben Halpern

Yeah, Mongo really latched on to Node and ensured really good tooling. I think that was the biggest factor in its success.