180 likes | 499 Views
Position Paper. How should the business logic be developed? As middle-tier application? or as a DBMS stored procedures?. Akash Sharma Hiren Nagar. Introduction. Presentation logic: The front end logic for data access (viewable to users) that resides on the client side
E N D
Position Paper How should the business logic be developed? As middle-tier application? or as a DBMS stored procedures? Akash Sharma Hiren Nagar
Introduction • Presentation logic: The front end logic for data access (viewable to users) that resides on the client side • Business Logic: Algorithms that translates the request for data and retrieves it that resides on the application server • Data Logic: The set of iterative algorithms, which maintains data and its security that resides on the Database Server
There are two approaches on placing business logic in architecture, in a separate tier called middle-tier, or as stored procedure in relational database. • PCs contain the presentation logic and perform simple validation, the business logic executes on the business servers, and centralized data stores and legacy functionality reside on traditional servers. The three separate logic areas use abstract interfaces to communicate.
Presentation tier Business logic tier Data tier Argument
Technology support • Three tier architectures readily allow different tiers to be developed in different languages, such as a graphical user interface language or light internet clients (HTML, applets) for the top tier; C, C++, Smalltalk, Basic, Ada 83, or Ada 95 for the middle tier; and SQL for much of the database tier
Can be easily reused without affecting the other two levels of the architecture. • Each tier has a separate interface and work in different environments, thus giving each tier the flexibility of updating, renewing (upgrading) or replacing independently without affecting the other two tiers. This improves scalability and flexiblity . • The three tier architecture can support the website’s database on the data tier with the web-pages on the presentation tier.
It is even easier to manage the security and control the access limits of different users, with all the data stored in the data tier. It is notable that recently, “mainframes have been combined as servers in distributed architectures to provide massive storage and improve security. Migrating a legacy system to three tier architecture can be done in a manner that is low-risk and cost-effective. • The middle tier server improves performance, flexibility, maintainability, reusability, and scalability by centralizing process logic.
Supporting documents • http://csdl.computer.org/dl/mags/it/2000/03/f3058.pdf • http://www.sei.cmu.edu/str/descriptions/threetier_body.html • http://csdl.computer.org/dl/proceedings/tools/2001/1251/00/12510083.pdf
Counter Argument Stored procedure is a subroutine available to the presentation layer to access database. The business logic should be developed as stored procedure in the database server.
Counterclaims • Reduce Network Traffic • - Direct control over data being accessed, reduces • communication • Faster Execution (Pre-compiled SQL statements) • - Stored pre-compiled SQL Statements, produces faster • response • Security • - Security features are implemented in stored procedure, • restricts unauthorized access to the database
Weaknesses with the approach • Scalability • Not a good idea to implement stored procedures for applications requiring intensive processing • This will put excessive load on data server hence, affects efficiency of database server • lacks scalability • Maintenance and Agility • If business logic changes, application needs to undergo a major change • This approach lacks portability
Business logic as separate layer • Business logic as stored procedure in the database impacts the performance of the database server • Security is at risk with stored procedures in database tier.
Supporting Documents • Carpentiere Christa. (2004, March). An Evaluation of Stored Procedures for the .NET • Developer. URL: http://msdn2.microsoft.com/en-us/library/ms973918.aspx , Microsoft • Corporation, Last Accessed: Feb 19, 2007 • Crocker Angela, Olsen Andy, Jezierski Edward. (2002, August). Designing Data • Tier Components and Passing Data through Tiers. URL: http://msdn2.microsoft.com/ • en-us/library/ms978496.aspx • SQL Stored Procedures. URL: http://msdn2.microsoft.com/en-us/library/aa174792 • %28SQL.80%29.aspx
Conclusion Although there are some advantages with implementing business logic as stored procedures but those advantages are also offered by middle-tier along with other features(discussed in the counter arguments) which stored procedures fail to offer. Thereby, we support deploying business logic in middle tier.