An analogy with web services vs. remoting just occurred to me that I
though might be close to your heart, Frans.


For many applications, the database is the bottleneck.  There is no
doubt that if you want the absolute best possible performance you can
get out of most databases (and certainly out of Oracle and SQL Server),
then you should use stored procedures.  Databases keep getting better at
dealing with ad hoc queries, but the fact is, stored procedures always
do better, for a number of reasons.  (Including one fundamentally
unavoidable one: for any non-trivial SQL, it takes less network
bandwidth to send a message to the database asking it to execute a
stored procedure than it does to send the full query as ad hoc SQL.  No
amount of improvement in database technology will change that.)  The
difference ranges from the marginal to the substantial, but if you need
to improve performance, anything is welcome.

So, if the database is the bottleneck, and performance is a concern, ad
hoc SQL would be a bad idea, and you would be absolutely insane to use
an ORM.  You should be using stored procedure.

And yet, I avoid using stored procedures.  Am I wrong to do that?  I
avoid them because I think they couple my business logic code too
tightly to my database.  They constrain the flexibility of my design.  I
only use them if I really have no other option to achieve the necessary
performance, and I'll try really hard to find acceptable alternatives
first.  But would you advise me to change my policy, and always use
stored procedures even when I don't absolutely need that last ounce of
performance?


Likewise, if the bottleneck in a system is the remote API, then by all
means, use whatever remoting technology is fastest.

Does that mean you should always use the fastest possible remoting
technology, regardless of how it might reduce the flexibility of your
design?  That would be pretty much the equivalent of telling people that
they should always use stored procedures for all their database work
because stored procedures are fastest.  And I think that would be bad
advice.  What do you think?


-- 
Ian Griffiths - DevelopMentor
(RSS: http://www.interact-sw.co.uk/iangblog/ )

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to