NYCPHP Meetup

NYPHP.org

[nycphp-talk] Database vs. Code

matt at atopia.net matt at atopia.net
Mon Nov 30 02:17:13 EST 2009


Tim,

That's how we have things now. We are doing an MVC setup for our main site. But the problem is that our other interfaces aren't programmed in the same setup or language.  Which is why I was thinking stored procedures would be nice because we could have a createUser procedure, for instance, which creates a new account, and can be called no matter what the front end code is. 

M 



------Original Message------
From: Tim Lieberman
Sender: talk-bounces at lists.nyphp.org
To: NYPHP Talk
ReplyTo: NYPHP Talk
Subject: Re: [nycphp-talk] Database vs. Code
Sent: Nov 30, 2009 02:14

Stored procedures have their place, but should generally be abstracted.

If you have multiple developers, make one of them in charge of  
providing an API for the front-end developers.  You probably want to  
pick one of the more experienced developers, since everyone else's  
code will be talking to his.

If you're playing in an MVC setup, this API is the model.

The person responsible for the API might choose to use stored  
procedures or not.  If she changes her mind later, none of the front- 
end people need to know, or care.

-TIm

On Nov 30, 2009, at 2:00 AM, matt at atopia.net wrote:

> Hi all,
>
> I'm working on a new project and I'm having a bit of trouble  
> deciding what should go in the code vs. Database for this project.
>
> The database is a forum type schema, so there are a lot of  
> transactions going on. For instance, when a record is inserted into  
> a post table, two counters elsewhere also need to be updated. I was  
> going to use triggers for this functionality, but we have 3 front  
> ends to the site as well. So that has made me want to use stored  
> procedures, but that will limit us to this specific database  
> software (mysql).
>
> What balance have people found to work well for projects where there  
> are multiple front ends and multiple developers?  Do stored  
> procedures work well for things like that?
>
> Thanks,
>
> Matt
>
> _______________________________________________
> New York PHP Users Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/Show-Participation

_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/Show-Participation



More information about the talk mailing list