3 ms·
In 2 past jobs as a non ruby person in ruby shops i was trying to convince them to write raw sql queries instead of relying on activerecord, but with no luck. I
by higeorge13 4y ago
In 2 past jobs as a non ruby person in ruby shops i was trying to convince them to write raw sql queries instead of relying on activerecord, but with no luck. I won’t argue about performance but most of the times didn’t even know what and how many queries were being generated..
- cutler 4y agoBut ... Rails console.
- weatherlite 4y agoThere has to be a really good reason for that. It's just like joining a Spring shop and telling everyone to not use JDBC (or whatever the name of the ORM in Java land)...that's not gonna fly well usually. For a good reason imo.
- higeorge13 4y agoThe good reason was that queries were not optimal and when we came up with optimal ones which were not following the access pattern or syntax that activerecord introduces, then the excuse was “…but activerecord…”. If i was a dev i would appreciate some data guy’s opinion in queries, indices, etc while my db crashes every now and then, but it’s either a power play/politics thing to ignore the new guy or the ‘i know activerecord/hibernate/kafka/whatever’ thing and i won’t bother sith anything else that will solve the problem.
- weatherlite 4y agoIt's a tradeoff. Everything is a tradeoff...I think ORMs like ActiveRecord do make the code easier to reason about in most cases and are worth the performance hit. All abstractions cost us performance..we could be all writing on bare metal C/C++ but not many web shops want to do that.
- kaba0 4y agoThere isn’t really a good reason to avoid ORMs in the general case. You can log the actual queries just fine. In my opinion bad performance comes from inadequate knowledge of a sharp edged tool