News for hackers. Stuff that matters.
Re:What ORMs have taught me: just learn SQL (2014) by platz on Sunday June 26, 2016 @07:26PM (#11983323)
I also do think putting too much logic in stored procs is a danger, and was/is a scourge for some shops. But was curious if that is the primary objection.
Re:What ORMs have taught me: just learn SQL (2014) by snuxoll on Monday June 27, 2016 @04:11AM (#11984794)
I try to avoid anything but mapping or querying data in sprocs, but sometimes they are a better place to put logic that is needed to ensure consistency. Your database will outlive your application, or you will eventually need to integrate data from a third party system - as a result your database engine is always the last line of defense to protect your data, and if that means using a sproc than so be it. I'll admit, I've written some business logic into stored functions in PostgreSQL, but it's mostly a background job to update cached data because it is much faster to do it in the database than pulling a bunch of records down to a service and sending them back up.