Download ITK 478: Position Paper

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Microsoft Access wikipedia , lookup

Data vault modeling wikipedia , lookup

Concurrency control wikipedia , lookup

Database wikipedia , lookup

Business intelligence wikipedia , lookup

Versant Object Database wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Clusterpoint wikipedia , lookup

Transcript
ITK 478: Position Paper
Akash Sharma
Hiren Nagar
How should the business logic be developed? Should it be as a middle-tier application?
Or as a DBMS stored procedures?
I. Introduction:
The architecture of an application is divided into three main logics:
1. Presentation logic: The front end logic for data access (viewable to users) that
resides on the client side
2. Business Logic: Algorithms that translates the request for data and retrieves it that
resides on the application server
3. Data Logic: The set of iterative algorithms, which maintains data and its security
that resides on the Database Server
Initially it was only one machine that handled the presentation, business and data
logic, (see figure 1 below), also called one-tier architecture. Later, with the advent of
client-server architecture, servers supporting client server model of application
architecture replaced mainframes.
Fig 1: one-tier architecture
This paper discusses about the business logic of an application and presents different
opinions on the issue. There are two approaches on placing business logic in architecture,
in a separate tier called middle-tier, or as stored procedure in relational database. The
paper presents views on both the approaches and supports deploying business logic in
middle-tier.
1
ITK 478: Position Paper
Akash Sharma
Hiren Nagar
Fig 2: The interaction of the client, application server and the database server. Source [4]
The business logic tier also called Application tier enables the translation of the requests
from the users. (See fig 2) “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”. [2]
Thus we are of the view that, the business logic must be hosted in a separate tier. There
are several advantages and reasons to take such a position, against having the business
logic as the stored procedures in the Data tier.
II. Counter Argument
Stored procedure is a subroutine available to the presentation layer to access database.
These procedures are stored in databases and contain business logic of the application.
The presentation layer makes a call to the procedure to execute the query and return the
retrieved results to user.
A.
Summarizing counterclaims [1,5,6]
The stored procedures are executed on the database server and have direct control over
the data being accessed. Thus, it minimizes utilization of network resources and
reduces the network traffic. These procedures can also be stored pre-compiled in some
circumstances, which in turn, provides faster access to database and improves
efficiency of the overall system. The pre-compiled stored procedures can be directly
2
ITK 478: Position Paper
Akash Sharma
Hiren Nagar
executed and need not be compiled every time, on request from client to produce a
faster response.
Another benefit of using stored procedure is security. Implementing certain
authenticating features in the stored procedures restrict unauthorized access to the
database.
B.
Refuting counterclaims and providing weaknesses in the approach [1,5,6]
The stored procedures do have above benefits to offer but some of these benefits are
also present with the other approach of implementing business logic.
The following are some of the features, the approach lacks:
Scalability: It is not feasible to implement the business logic in the database tier as
stored procedures, for the applications involving intensive processing on data being
accessed.
The database servers may get excessively loaded with the processing
requests and affect the overall performance of the application.
Maintenance and Agility: The application may need to undergo major changes when
there occurs a need to either modify the business logic in the database server or the
technology supporting the business logic. The application looses portability with this
approach of implementation.
Business logic as separate layer:
The database servers are the backbone of any
application and there should not be any compromise as far as its performance is
concerned. And, placing business logic does affect the efficiency of the database server.
Moreover, the database is only meant for storing data and should not contain any
processing logic.
III. Argument
We support the business logic to be hosted in the mid tier as a separate entity using the
three tier architecture as shown below.
3
ITK 478: Position Paper
Akash Sharma
Hiren Nagar
FIG 3: Separate business logic in the three-tier.
Source: [2]
The three tier architecture consists of the (fig 3):
1. Presentation tier
2. Business logic tier
3. Data tier
Initially during the start of distributed systems in the last decade, the three-tier
architecture began to gain acceptance. “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” [3]. There were
several advantages that made the organizations adapt to such network architecture.
 With the separation of the business logic from the other two, it could 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” [3].
 With the increase in the web application, 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
4
ITK 478: Position Paper
Akash Sharma
Hiren Nagar
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”. [3]
 “The middle tier server improves performance, flexibility, maintainability,
reusability, and scalability by centralizing process logic”. [3]
IV. Conclusion
The benefits of placing business logic in the middle tier with its several weaknesses of it
being in the relational database, has been discussed. 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.
References:
[1] SQL Stored Procedures. URL: http://msdn2.microsoft.com/en-us/library/aa174792
%28SQL.80%29.aspx, Microsoft Corporation, Last Accessed: Feb 19, 2007
[2] Peacock Robert. (2000, May). Distributed Architecture Technologies. Pp. 58-60. IT
Pro.IEEE. URL: http://csdl.computer.org/dl/mags/it/2000/03/f3058.pdf, Last Accessed:
Feb 17, 2007
[3] Sadoski Darleen. Dorda Santiago. (2000, Feb). Three Tier Software Architectures,
URL: http://www.sei.cmu.edu/str/descriptions/threetier_body.html, Carnegie Mellon
Software Engineering Institute, Last Accessed: Feb 17, 2007
5
ITK 478: Position Paper
Akash Sharma
Hiren Nagar
[4] Behravanfar Reza. (2001). Separation of Data and Presentation for the Next
Generation Internet Using the Four-Tier Architecture. TOOLS’01. IEEE Computer
Society. URL:http://csdl.computer.org/dl/proceedings/tools/2001/1251/00/12510083.pdf,
Last Accessed: Feb 18, 2007
[5] 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
[6] 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, Microsoft Corporation, Last Accessed: Feb 19, 2007
6