[ajug-members] Stored Procedures vs Hibernate [Little OT]
Brian Lee
brian_a_lee at hotmail.com
Wed May 3 15:38:50 EDT 2006
I've heard about this whole "avoid premature optimization" routine before
and doubt it a bit. It seems like the domain of people who don't really
understand performance and large scale applications. If you've ever gone
back to try to performance tune an app after the fact, it is made very
difficult by poor design.
Assume that your customers stick around if your app is performing poorly,
trying to go back and replace or change the engine of a running automobile
is very difficult. It is much, much cheaper to do proper design and
performance optimization before construction than to add it after a product
is completed or released.
I see the specter example of some bit-head trying to eke out 1% gain by
using custom byte-array String libs instead of Java String library and of
course this is stupid. But it shouldn't be used to scare people away from
making intelligent design decisions to boost performance.
Stored procedures have their place. For example, if you are trying to
persist a complex object that lives in the db in multiple tables and rows.
This is a perfect example of how using SP is better than trying to do all
the inserts from outside the db in Java. You can still interface to the
StoredProcs using Hibernate. But StoredProcedures really speed up the
process. If you anticipate a high transaction site, then coding this in Java
and redoing in Stored Procs is very expensive time wise.
I think that if you're designing an app without any stored procedures, then
your app is very simple or you're doing something wrong.
Just my two cents...
BTW- I think this is a good sort of topic for the IASA meetings that take
place.
BAL
>From: "Mao, Dean (IHG)" <Dean.Mao at ichotelsgroup.com>
>Reply-To: "General AJUG membership forum (100-200
>messages/month)"<ajug-members at ajug.org>
>To: "General AJUG membership forum (100-200
>messages/month)"<ajug-members at ajug.org>
>Subject: RE: [ajug-members] Stored Procedures vs Hibernate [Little OT]
>Date: Wed, 3 May 2006 14:42:50 -0400
>MIME-Version: 1.0
>Received: from server01.ajug.org ([66.45.18.180]) by
>bay0-mc7-f4.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 3
>May 2006 11:57:03 -0700
>Received: from server01.ajug.org (server01.ajug.org [127.0.0.1])by
>server01.ajug.org (8.12.11.20060308/8.12.11) with ESMTP id
>k43JPJUS013658;Wed, 3 May 2006 15:25:21 -0400
>Received: from ichotelsgroup.com (immx4.ichotelsgroup.com [165.2.141.42])by
>server01.ajug.org (8.12.11.20060308/8.12.11) with ESMTP idk43JPI1e013655for
><ajug-members at ajug.org>; Wed, 3 May 2006 15:25:18 -0400
>Received: from ([10.162.32.58])by immx4.ichotelsgroup.com with ESMTP id
>5202440.2276222;Wed, 03 May 2006 14:42:50 -0400
>X-Message-Info: LsUYwwHHNt1/iMJ99KLTLp10so60Gkw1bTGKv7dfpXc=
>X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
>Content-class: urn:content-classes:message
>X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [ajug-members] Stored
>Procedures vs Hibernate [Little OT]
>Thread-Index: AcZuxjOFl141HGXLTf6rcbXVLk3x2wAAE6swAAalfWA=
>X-MIME-Autoconverted: from quoted-printable to 8bit by server01.ajug.org
>idk43JPI1e013655
>X-BeenThere: ajug-members at ajug.org
>X-Mailman-Version: 2.1.5
>Precedence: list
>List-Id: "General AJUG membership forum (100-200
>messages/month)"<ajug-members.ajug.org>
>List-Unsubscribe:
><http://www.ajug.org/mailman/listinfo/ajug-members>,<mailto:ajug-members-request at ajug.org?subject=unsubscribe>
>List-Archive: <http://www.ajug.org/pipermail/ajug-members>
>List-Post: <mailto:ajug-members at ajug.org>
>List-Help: <mailto:ajug-members-request at ajug.org?subject=help>
>List-Subscribe:
><http://www.ajug.org/mailman/listinfo/ajug-members>,<mailto:ajug-members-request at ajug.org?subject=subscribe>
>Errors-To: ajug-members-bounces at ajug.org
>Return-Path: ajug-members-bounces at ajug.org
>X-OriginalArrivalTime: 03 May 2006 18:57:03.0885 (UTC)
>FILETIME=[5DE973D0:01C66EE3]
>
>Using stored procedures for everything sounds like premature
>optimization to me... And we all know that famous quote by Tony Hoare:
>
>"Premature optimization is the root of all evil"
>
>
>Dean Mao
>Decision Science
>Global Brand Services
>InterContinental Hotels Group
>770.604.8793
>dean.mao at ichotelsgroup.com
>
>-----Original Message-----
>From: ajug-members-bounces at ajug.org
>[mailto:ajug-members-bounces at ajug.org] On Behalf Of Howard Kapustein
>Sent: Wednesday, May 03, 2006 11:32 AM
>To: General AJUG membership forum (100-200 messages/month)
>Subject: RE: [ajug-members] Stored Procedures vs Hibernate [Little OT]
>
> >Yes, but I think what we're talking about here is the prospect of using
>
> >stored procedures for *everything*. This to me seems much, much scarier
>
> >than using them for nothing.
>
>All Fanatics Must Die.
>
><g>
>
>Balance, in all things.
>All stored proc is just as evil as no stored proc, just evil in
>different ways.
>
>[And even 'black' and 'white' aren't necessarily the same degree of
>'evil', to all people, in all cases. YMMV :-]
>
> - Howard
>
>
>
>-----Original Message-----
>From: ajug-members-bounces at ajug.org
>[mailto:ajug-members-bounces at ajug.org] On Behalf Of Rob Worsnop
>Sent: Wednesday, May 03, 2006 11:13 AM
>To: General AJUG membership forum (100-200 messages/month)
>Subject: Re: [ajug-members] Stored Procedures vs Hibernate [Little OT]
>
>On 5/2/06, Howard Kapustein <hkapustein at manh.com> wrote:
> >
> >
> >
> > 1. Resource / Skillset
> >
> > If you've only got Java programmers and no DBAs, you should minimize
>your
> > storedproc coding, and vice versa.
> >
> >
> >
> > 2. Data Size / Data Manipulation / Set Theory -
> > Performance/Scalability
> >
> > If you're dealing with a large amount of data, there's a lot of xref
> > interaction amongst the data and basically it's something that plays
>well
> > into the relational model and set calculus, the STUPIDEST thing you
>could do
> > is write Java code. [Or C++. Or C#. Or Perl. Or...] We used to suffer
>from the
> > 'no storedproc' myopia.
>
>Yes, but I think what we're talking about here is the prospect of using
>stored procedures for *everything*. This to me seems much, much scarier
>than using them for nothing. Moving out a few lines of inefficient
>Hibernate code is a lot less trouble than refactoring a system in which
>nearly half the Java code is shovelling data to and from a JDBC driver.
>And shovelling it, in many cases, in a way that is inconsistent, full of
>errors, and misses optimization opportunities that Hibernate will not.
>
>_______________________________________________
>ajug-members mailing list
>ajug-members at ajug.org
>http://www.ajug.org/mailman/listinfo/ajug-members
>
>_______________________________________________
>ajug-members mailing list
>ajug-members at ajug.org
>http://www.ajug.org/mailman/listinfo/ajug-members
>
>_______________________________________________
>ajug-members mailing list
>ajug-members at ajug.org
>http://www.ajug.org/mailman/listinfo/ajug-members
More information about the ajug-members
mailing list