Direct Table Access vs Stored Procedures in n-tier arcitecture [duplicate]
Possible Duplicate:
What are the pros and cons to keeping SQL in Stored Procs versus Code
What is the drawbacks and benifits of using direct table access vs stored procedures to access data components
I 开发者_开发技巧am currently designing an application in an n-tier enviroment.
Also in regard with: Security Performance application deployment issues
Which of the two methods is recommended
Generally SPs are better. But that depends on your requirement. If you are going to stick with a specific DBMS them there are many advantages of SPs.
Look here for more details.
I would agree that this is a duplicate of this question, but one thing I would add to the discussion is that DBAs often insist on stored proc access because it gives them control over access to the data. Views are often also used for this reason. When you grant direct table access you have to open the table up from a security perspective.
Depending on whether your apps log in as applications or if they log the users in directly (I've seen it done both ways) and depending on whether your app is mostly write (i.e. transactional system) or mostly read (i.e. reporting system) you (or your DBA - or auditor) may not want to leave access wide open.
精彩评论