Re:Ask HN: Have you ever chosen Postgres over Mongo and regr...
by tonious on Tuesday July 10, 2018 @09:49AM
(#17498033)
IMHO, this is more of an indictment of the ORM (sounds like sequelize) than anything else.
[ Parent
| on HN ]
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr...
by kevinoid on Tuesday July 10, 2018 @09:55AM
(#17498090)
Partly it is. I had issues with both sequelize and any-db. However, since not using them resulted in a lot of bespoke SQL and object mapping, I found MongoDB preferable to SQL without these libraries as well.
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr...
by flexd on Tuesday July 10, 2018 @11:05AM
(#17498701)
So the whole problem could have been avoided if you had chosen a more mature programming language at the time time? Perl, Python and PHP all had perfectly good SQL libraries at the time, as well as a lot of other languages that have been around a long time.
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr...
by kevinoid on Tuesday July 10, 2018 @11:37AM
(#17498998)
That's a fair criticism. There are a lot of tradeoffs in language choice. For this project the choice was out of my hands, but in retrospect I don't think Node was necessarily a bad choice. Node worked well for a lot of things we did. Was the cost spent struggling with SQL outweighed by the other benefits? It's hard to say for sure.
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr...
by piva00 on Tuesday July 10, 2018 @10:52AM
(#17498585)
I don't really get what was the problem on creating your own queries though. If the ORM layer sucked you don't really need it, queries and object mappers (if you needed some kind of typed objects) is powerful enough without making you have to learn the ORM's quirks and gotchas.
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr...
by kevinoid on Tuesday July 10, 2018 @11:28AM
(#17498918)
Sure, but I found that I was wasting a lot of time writing dead-simple SQL queries and object mapping that could have been better spent writing application code (and was after switching to MongoDB).
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr...
by piva00 on Wednesday July 11, 2018 @04:00AM
(#17505211)
So instead of writing dead simple SQL queries (that mostly you could copy-paste if you don't want the complexity of dynamically generating them) it was easier and simpler to switch the whole data layer?
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr...
by EpicEng on Tuesday July 10, 2018 @01:01PM
(#17499971)
Why wouldn't you auto generate the simple SQL stuff? It's a no brainier really. It's so easy to dynamically create simple selects, updates, etc.
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr...
by kevinoid on Tuesday July 10, 2018 @01:47PM
(#17500466)
I played around with that a little, but it seemed like once you start trying to auto-generate SQL from objects you are basically writing a simple ORM. So you either spend time writing queries, spend time building an ORM, spend time fixing an existing ORM, or some combination of those.
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr...
by EpicEng on Tuesday July 10, 2018 @04:41PM
(#17501949)
Sure, but it's about finding that sweet spot. I dislike large ORMs
The majority of queries are simple and trivial to auto generate. The more entities you add the more value you get from it.
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr...
by grncdr on Thursday July 12, 2018 @01:50PM
(#17516982)
I'm really confused why you would put any-db in the same category as Sequelize... it's not anything like an ORM and never wanted to be. It's the wrong tool for any job that isn't "writing a DB-agnostic SQL generator"