7 ms·
I started doing a demo rewrite of my app in Postrgres from Mongodb. The reality is that even though Portgres seems more stable etc, making queries in Mongodb is
by lexx 6y ago
I started doing a demo rewrite of my app in Postrgres from Mongodb. The reality is that even though Portgres seems more stable etc, making queries in Mongodb is much easier and fun.
Postgres JSON operators are cryptic and made my head hurt every time I wanted to accomplish something more complex.
To express it differently, if mongo and postgres where identical operationally, I would choose mongo every day. More friendly and fun. But there are so many horror stories that I am still not sure that it is the right choice for a safe production environment.
- kfk 6y agoI don’t know I was exited to use json for a couple of months but then I needed the same data for analytics and I quickly missed sql.
- deleted 6y ago[deleted]
- tbrock 6y agoToday it’s just fine. I think a decade ago it was pretty risky but databases take 10 years to do properly.
- ryanschneider 6y agoAre there tools for auto converting mongo queries to postgres’ query format? The mongo drivers are Apache licensed so in theory someone could use them as the basis for a driver that speaks to postgres instead, right? I see tools like that showing up in my search results but since I have no experience with them I won’t link to any, if anyone here does have such experience sharing their results would be appreciated.
- deleted 6y ago[deleted]
- ComputerGuru 6y agoThe thing is, 99% of all JSON-in-DB uses people are advertising (insofar as traditional RDBMS are concerned) are incorrect or at least suboptimally designed. It’s extremely convenient but at the same time, it’s a major cop-out. Designing a database correctly (in the right denormalized form, with the right indexes, with correct relationships, with optima choice of primary keys, etc) is hard work, but it’s critical work to properly take advantage of all the algorithms and optimizations baked into the database engine. I see lots of people migrate from mongo and co to Postgres because they realize it’s a more appropriate data store but I also find them trying to hold on to as much of the original mongo approach as possible rather than just throwing in the towel and embracing traditional db interfacing. JSON support in Postgres is really not intended to replace - even as a stopgap - what nosql was used for.
- GordonS 6y ago> Postgres JSON operators are cryptic and made my head hurt every time I wanted to accomplish something more complex. I first started working with JSONB columns in Postgres around 2 years ago, I think, and had the same initial impression - the operators are certainly quite alien compared to more typical SQL, and it took me a while to figure out how to do more complex things. I kept at it though, and now it all feels more natural. I haven't touched Mongo for about 10 years, so it wouldn't be fair of me to compare, but I love the performance and power of JSONB in Postgres. And having all this right alongside regular relational tables in the sr database is fantastic. I often work with TimescaleDB too, which again just works alongside everything else, in one database - Postgres really is an incredible database!
- lexx 6y agoI honestly wonder, for a team that is unfamiliar with both psql JSONB and mongodb, which of those two would be easier to learn? And later on, which of those two would make the team more productive? I think this is the most important. To be fair, I use mongoDB for 8 years now compared to less that 1 year of psql JSONB, so I can't really answer objectively.
- winrid 6y agoWe used mongo where each DB instance had about a 1gb/s of conti uous read/write traffic, and each instance used around 1TB of memory. So it will probably work for you. There were some issues, some our fault, some Mongo's, but I think anything will have teething problems at that scale. Just make sure you don't treat it like a bucket. Use well defined schemas and indexes, like with any DB.
- jd_mongodb 6y agoThere aren't "so many horror stories" there are the same small number of ancient horror stories replayed over and over.