On Thu, Mar 3, 2011 at 12:23 PM, Steve Staples <sstap...@mnsi.net> wrote:

> On Thu, 2011-03-03 at 11:30 -0700, Nathan Nobbe wrote:
> > Hey gang,
> >
> > (Yes Tedd, I like your style, when it pertains to how you address the
> list
> > :))
> >
> > I have a new curiosity that's arisen as a result of a new contract I'm
> > working on, I'd like to bounce around some thoughts off the list and see
> > what you folks think if interested.
> >
> > The topic at hand is stored procedures.  Frankly, I've hardly ever even
> seen
> > these in use, and what I'm trying to figure out are good rules of thumb
> as
> > to where / when / how they are best used in application development.
> >
> > Also, bear in mind that personally I tend to favor OO paradigms for
> > application development so would prefer feedback that incorporates that
> > tendency.
> >
> > Initial thoughts are
> >
> > Bad:
> > . Not well suited for ORM, particularly procedures which return multiple
> > result sets consisting of columns from multiple tables
> > . Greater potential for duplicated logic, I think this comes down to a
> well
> > defined set of rules for any given application, read: convention required
> > for success
> > . Scripting languages are vendor specific, and likely most application
> > developers have a limited understanding thereof
> >
> > Good:
> > . Better performance
> > . <Fill in blank on convincing bullets here>
> >
> > I've also done some reading on MSSQL vs. MySQL and found that the former
> > offers much more features.  I've also read that most databases only see
> > roughly 40% of the feature sets being used for typical applications in
> the
> > wild, and would agree from personal experience it is accurate.
> >
> > >From my standpoint MySQL is popular because the features it offers are
> the
> > features folks are really looking, one of those 80/20 things...
> >
> > I stumbled into this link on a google search, it's from '04 but looks to
> be
> > relevant to this day
> >
> >
> http://www.codinghorror.com/blog/2004/10/who-needs-stored-procedures-anyways.html
> >
> > Your thoughts appreciated,
> >
> > -nathan
>

Hi Steve,

Thanks for the response.


> Would this not be a better suited question for the mysql mailing list?
>

Well they may be able to share some more database-centric advantages with
me, however, I'm interested in the merit of stored procedures from an
application perspective.  Something that Paul touched on for example would
be who is writing these procedures.  In my experience having DBA's get their
hands into application design is bad.  Also, if 1 out of 10 devs is decent
at writing stored procedures, doesn't that jeopardize the stability /
effectiveness of the team?


> regardless, I use stored procedures and functions on my mysql server
> here at work, in regards to our radius accounting packets.
>
> I will say, that it was WAY easier to send the packet dump to mysql in a
> "call()" statement, than it was to try and do all the programming
> necessary to insert the packet, calculate user usage, is the packet
> there already, etc etc etc on the radius server.  Doing it this way, we
> have 4 radius servers that just fire the same thing over to the mysql,
> and if there is a change, i do it on the mysql server, and not have to
> do the same thing on 4 different servers.
>

That makes a lot of sense in the context of Radius / MySQL communication.
 Why add another layer there, and it is food for thought in future
endeavors.  I'm more interested in how they might fit into a LAMP stack
running some hosted application though.


> views, stored procedures, triggers and functions really do have their
> purpose within mysql/mssql (and whichever sql server you are using if
> they support them), and most of the times they are forgotten about
> and/or overlooked.
>

I have seen how these tools, in particular triggers and views fit into the
equation in an application design.  Again, I think this is something which
can be marginalized if there is not a solid convention in place describing
what is to be implemented in the database layer as opposed to the
application layer.

take a look at this article:
> http://www.tonymarston.net/php-mysql/stored-procedures-are-evil.html
>

Will do.


> Good luck, and I think you may get more response from
> my...@lists.mysql.com


Considering this as well, thanks for the response!

-nathan

Reply via email to