3 ms·
I have a separate problem with stored procedures - it's pushing more and more work into the single hardest piece of software to scale - your database.
by falcolas 13y ago
I have a separate problem with stored procedures - it's pushing more and more work into the single hardest piece of software to scale - your database.
- jhugg 13y agoApologies for the curt response, but VoltDB is an existence proof that this isn't necessarily true.
- gaius 13y agoIt depends what you mean by scale. A serious corporate database might have a hundred applications connecting to it, written in a dozen different languages, and the guys who wrote the oldest one retired before the current guys were out of college. How many times do you want to re-implement the same validation logic? How many apps do you want to have to change and test when something in the business changes? How many great engineers can you hire when you mention that legacy maintenance is a big part of the job? For the 99.999% of people who will never need to worry about Google or Facebook's "scale", stored procedures are absolutely the only sane way to build large systems.
- y0ghur7_xxx 13y ago> pushing more and more work into the single hardest piece of software to scale - your database. I never understood this argument. Maybe you can elaborate a bit? Almost all our apps use sp for data lifting work (most of the so called "business logic"), and we never got scaling problems. Well, we don't have that much users or data either, but how many users/data do you have that your stored procs could not keep up with? What numbers are we talking about? What makes the db slow is throwing bad sql at it, not Stored Procs.
- falcolas 13y agoTerabytes and 5-6 thousand queries per second. > What makes the db slow is throwing bad sql at it, not Stored Procs Absolute statements are absolutely wrong. :) Particularly with DBs like PostgreSQL where you can (and people do) run Python scripts as stored procs. Great way to slow down your DB.
- y0ghur7_xxx 13y ago> Terabytes and 5-6 thousand queries per second. That is not much info :) Just for reference: a simple query by pk index on my veryveryvery low end pc¹ on a table with 1mil rows takes about 0.04 ms (so says pgsql analyze). That is 25000 queries per second. What type of app are we talking here where the db needs to scale? Something like reddit? Stackoverflow? Just curious. Never saw such a beast where a DB server needs that much power. Where I work we have 200 apps on the same DB server, and it's idling most of the time. ¹i5 CPU 2.40GHz with 2GB of RAM > run Python scripts as stored procs. Great way to slow down your DB. There is more than one way to shoot yourself in the foot :)