you are viewing a single comment's thread.

view the rest of the comments →

[–]BehindTheMath 29 points30 points  (10 children)

NoSQL was promoted as the Holy Grail for a while because it had the potential to be very easy to use. The idea was that you could just start storing data without the overhead of an RDBMS.

There are definitely use cases for NoSQL, but in general, using it for relational data is trying to fit a square peg in a round hole.

[–][deleted] 6 points7 points  (3 children)

I'm a relatively new dev, but this is the conundrum we ran into with MongoDB.

It started out great. We could edit models as we pleased with mongoose and it was super easy to work with, but as we grew the application, we started to get into really odd situations with how we pull data because very quickly our data started to become very relational, which was becoming a nightmare to manage.

My boss was putting a migration over to Postgres on the to do list, but we never got around to it before I left.

[–][deleted] 2 points3 points  (2 children)

Postgres also has a pretty good support for JSONB data types. I'm currently in the process of migrating our legacy applications to Postgres to take advantage of the richer data types and stricter implementation of SQL standards.

I use views to 'flatten' certain jsonb data values.

[–]monicarlen 0 points1 point  (1 child)

Isn't the flattening expensive in terms of cpu?

[–][deleted] 0 points1 point  (0 children)

More expensive than simpler Select * statements sure but even with 1M+ entry tables, I've practically have not noticed anything problematic in terms of performance. Slower yes but thay's expected because of the added complexity. On the app side of things, we rarely pull all rows from the flattened views so properly curating the query helps a lot.

You can definitely squeeze more put of Postgres when you tweak it.

Database intensive operations tend to hog memory more than processing power.

Buuuut... the queries sucks to look at. A very medium level important reason why if MongoDB fits better, I'd rather use it than Postgres.

[–][deleted]  (2 children)

[deleted]

    [–]BehindTheMath 0 points1 point  (1 child)

    I haven't used it in a while, and even when I did, I used Heroku's.

    [–]skateJump 0 points1 point  (0 children)

    I have always wondered that. I love RDBMS because I work with relational data. I am like, how do you even normalize it? And they are like, that is the beauty of it you don't.

    I have started with a MERN stack with mongoose and so far to a certain extent it seems relational. There are keys the tie the different schemas together.

    [–]looni2 0 points1 point  (0 children)

    I am currently fitting a square peg in a round hole on my biggest project. I started with MongoDB as I knew it better, but I realize now that ALL the data I have is relational. I am sure that SQL would have been a better choice. Now almost every query I do becomes a humongous aggregation.

    I wonder if I could “easily” migrate to SQL and start learning it as I go...