Professional Documents
Culture Documents
All projects are broadly divided into two types of applications 2 tier and 3 tier
architecture. Basically high level we can say that 2-tier architecture is Client
server application and 3-tier architecture is Web based application.
Two-Tier Architecture:
1
Figure 7.1 Two-Tier Architecture
The above figure shows the architecture of two-tier. Here there is direct
communication between client and server, there is no intermediate between
client and server.
Let’s consider that first Person is making Railway Reservation for Mombasa to
Nairobi by Rift Valley Railways at Counter No. 1 and at same time second
Person is also try to make Railway reservation of Mombasa to Nairobi from
Counter No. 2
If staff from Counter No. 1 is searching for availability into system & at the
same time staff from Counter No. 2 is also looking for availability of ticket for
same day then in this case there might be good chance of confusion and chaos
occurs. There might be chance of to lock the Railway reservation that reserves
the first.
But reservations can be made anywhere from the Kenya, then how is it
handled?
In this application the Staff user is an end user who is using Railway
reservation application software. He gives inputs to the application software
and it sends requests to Server. So here both Database and Server are
incorporated with each other, this technology is called as “Client-Server
Technology“.
2
The Two-tier architecture is divided into two parts:
On client application side the code is written for saving the data in the SQL
server database. Client sends the request to server and it process the request &
send back with data. The main problem of two tier architecture is the server
cannot respond multiple request at the same time, as a result it cause a data
integrity issue.
Advantages:
Communication is faster
Disadvantages:
Cost-ineffective
3
The three tiered architecture allows for one central server location for all the
business logic and one central server location for all of the data leading to
reuse, consistency, and uniformity of applications in this environment.
The presentation layer supports the GUI. Sometimes this is called a GUI-lite
application. There may be many different kinds of GUI.
The middle section materializes the application. Though this is called the
application logic it is really much larger then just logic formulas and includes
all function and procedures that make the application an application for a
particular domain. Many of the elements in this area are tailored for the
application needs. Sometimes this layer is called the business rules or logic.
The last layer is the data. This is most often materialized by a database. This
layer does not have to be limited to a database. Alternatively, a large
computational server could act as a mathematical engine.
The three tiered layering is popular because it forces clean lines between the
three layers. The ``thin'' client can easily be moved to other architectures. The
application logic can be used by other applications in the system. The database
layer allows for plug and play of many different database vendors.
Each layer may have a special interface or use a more generic interface
protocol. An example of a GUI protocol is xterm or html. An example of a
database protocol is SQL/Net.
1) Client layer
2) Business layer
3) Data layer
1) Client layer:
2) Business layer:
In this layer all business logic written like validation of data, calculations, data
insertion etc. This acts as a interface between Client layer and Data Access
4
Layer. This layer is also called the intermediary layer helps to make
communication faster between client and data layer.
3) Data layer:
In this layer actual database is comes in the picture. Data Access Layer
contains methods to connect with database and to perform insert, update,
delete, get data from database based on our input data.
Three-tier Architecture
Advantages
Better Re-use
Easy to maintain and modification is bit easy, won’t affect other modules
Disadvantages
Increase Complexity/Effort