4 ms·
IMHO stored procedures are evil and they shouldn’t have place in modern development. They are old solution for client server world.
by galkk 2y ago
IMHO stored procedures are evil and they shouldn’t have place in modern development. They are old solution for client server world.
- mbreese 2y agoSometimes you need to have atomic updates for a function. Stored procedures aren’t inherently evil, but are a hold over from when DB admins were a thing and they didn’t trust app developers. Don’t worry, just wait another 5-10 years, they’ll be back in vogue again.
- ako 2y agoI don’t get this mentality, they’re just code that lives closed to your data, and can do bulk processing on data in your database way more efficiently than anything living in the application layer.
- FpUser 2y ago>"can do bulk processing on data in your database way more efficiently than anything living in the application layer." Not necessarily. All depends on particulars. Very complex processing of reasonably sized chunk of data especially when can be done in multiple threads / distributed can be way more efficient. I've head very real case: consulting company was hired by TELCO to write the code that will take content of the database and create one huge file containing invoices to clients. Said file would then be sent to a print house that can print the actual invoices, and mail those to clients. They tried to do it with stored procedures and had failed miserably - it would run for a couple of days give or take and then crash. I was called for help. Created 2 executables. On is a manager and the other is multithreaded calculator that did all the math. Calculator was put on 300 client care workstations as a service. Dispatcher would do initial query from accounts table for current bill cycle, split account id's into few arrays and send those arrays to calculators. Calculators would suck needed data in bulk from a database, do all the calculations and send the results back to dispatcher for merging into final file. TELCO people were shocked when they realized that they can have print file in less than 2 hours.
- LunaSea 2y ago- References are triggers - Audit tables are often implemented thanks to triggers - Soft deletes can be easily implemented thanks to triggers
- LaGrange 2y agoWe live in a client-server world.