IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New And don't forget about sp's providing better performance on the database.
bcnu,
Mikem

I think religion should be treated with ridicule, hatred and contempt. And I claim that right.
Christopher Hitchens.
New That depends
On architecture, caching, data usage patterns, scaling, and a myriad other concerns too.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New For OLTP applications, I disagree, with MS Sql Server anyway.
Sure, you can optimize the server for ad hoc, force parameterization, etc., and vastly improve ad hoc performance, but overall (including network traffic) stored procedures on MS Sql Server for an OLTP application will outperform ad hoc.

Unless you can convince me that this guy ( http://www.sqlbits.com/sessions/event14/Stored_Procedures_vs_Ad-Hoc_SQL_Performance_Showdown ) is completely wrong, I'm sticking with OLTP apps benefit performance-wise over ad hoc.

If I'm wrong about that, what have I missed? (and yes, I am genuinely asking).
bcnu,
Mikem

I think religion should be treated with ridicule, hatred and contempt. And I claim that right.
Christopher Hitchens.
New Performance is the least of my concerns at this point
IMO queries should be written first for correctness, second for clarity, third for performance. (Just like all code.)

Correctness includes returning the right results and maintaining data integrity. You have to do both as an absolute baseline before anything else matters. After that, clarity/readability is far more valuable than performance 90% of the time.
--

Drew
New Until it isn't any more. :-)
But generally I agree. Don't prematurely optimize. Stored procedures are dangerously seductive for that.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Performance != throughput
Which is why I said it depends. A straight through speed test, even a comprehensive one, tells you little about how a system performs under full load.

The database is the hardest piece of architecture to scale simply. When you reach the point where too much is going on for a single server, you start to have problems. If large portions of your logic are in the database, you really have problems.

This isn't theoretical, either. I've seen Oracle databases running on the largest box Sun made at the time moved to RAC and having horrific problems due to intense stored procedure usage.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Interesting
Since all the logic in a proc has to happen somewhere, I would assume doing it outside the DB would take longer on head-to-head, no-load comparisons. As long as the logic happening in the proc has to be atomic, wouldn't that continue to get worse as things scale?

In fairness, I'm not a DBA so I'm assuming there's something in DB world that's like the multiple small compute instances you can do with app servers. I've never built out DB infrastructure at this scale though, so I'm coming from the standpoint that I can't be the only one trying to do this so someone must have solved this.
--

Drew
New I've looked at DB scale out, though not recently.
In a previous job, we ran into questions about how to tackle that kind of problem.

Read-scaling can be done with simple replication, if you don't need transactions. We did that, and that was reliable. It helped I was also one of the web programmers and could build the database abstraction layer to load-balance SQL Selects.

Another method is sharding, which seems to have matured in the last few decades. We would've had to do it ourselves when we looked at the concept and I wasn't sure I was up to doing that! The Wikipedia article has more information.

Wade.
New Eventually the amount of work exceeds the capacity of a single machine to do it
At which point you have a distributed system whether you want it or not, and a distributed database is one of the hardest things to get right.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New sure, lets take the speed out of the cpu and replace it in multiple small connected units, :-)
always look out for number one and don't step in number two
     Are stored procs "hiding functionality"? - (drook) - (23)
         wag, the same as a shared library, you dont know where it came from -NT - (boxley)
         Interesting question. - (Another Scott) - (1)
             Better to manage that sort of problem through services - (malraux)
         Depends on how they're managed. - (malraux) - (10)
             And don't forget about sp's providing better performance on the database. -NT - (mmoffitt) - (9)
                 That depends - (malraux) - (8)
                     For OLTP applications, I disagree, with MS Sql Server anyway. - (mmoffitt) - (7)
                         Performance is the least of my concerns at this point - (drook) - (1)
                             Until it isn't any more. :-) - (malraux)
                         Performance != throughput - (malraux) - (4)
                             Interesting - (drook) - (2)
                                 I've looked at DB scale out, though not recently. - (static)
                                 Eventually the amount of work exceeds the capacity of a single machine to do it - (malraux)
                             sure, lets take the speed out of the cpu and replace it in multiple small connected units, :-) -NT - (boxley)
         Implementation detail, someone else's problem. - (pwhysall)
         Who is responsible for what? - (crazy) - (5)
             I'm coming down on the side of your data integrity comment - (drook) - (4)
                 Sounds like a management problem. - (static) - (2)
                     You think? - (drook) - (1)
                         Not surprised at all. - (static)
                 Someone's going to be writing something that deals with integrity. - (malraux)
         Re: Are stored procs "hiding functionality"? - (mvitale) - (1)
             I used utPLSQL in a former life. - (malraux)

How can he be so skinny and live SO phat?!?
100 ms