CST 426 - Module 2 Notes
CST 426 - Module 2 Notes
One-tier architecture involves putting all of the required components for a software application or
technology on a single server or platform. This kind of architecture is often contrasted with multi-
tiered architecture or the three-tier architecture that's used for some Web applications and other
technologies where various presentation, business and data access layers are housed separately.
Basically, one-tier architecture keeps all of the elements of an application, including the interface,
middleware and back-end data, in one place. Developers see these types of systems as the simplest
and most direct. Some experts describe them as applications that could be installed and run on a
single computer. The need for distributed models for Web applications and cloud hosting solutions
has created many situations where one-tier architectures are not sufficient. That caused three-tier
or multi-tier architecture to become more popular. The benefits of a multi-tier solution are often
evident. They can provide better security, better performance and more scalability, as well as
individual environments for data centers and front-end applications. However, the appeal of a
single-tier architecture can relate to the costs that are involved, where it might make more sense to
keep simpler applications contained in one easy platform.
The application processing is done separately for database queries and updates and for business
logic processing and user interface presentation. Usually, the network binds the back-end of an
application to the front-end, although both tiers can be present on the same hardware. Sometimes,
the application logic (the real business logic) is located in both the client program and in the
database itself. Quite often, the business logic is merged into the presentation logic on the client
side. As a result, code maintenance and reusability become difficult to achieve on the client side. On
the database side, logic is often developed using stored procedures.
The architecture of any client/server environment is by definition at least a two-tier system, the
client being the first tier and the server being the second. The Client requests services directly from
server i.e. client communicates directly with the server without the help of another server or server
process.
In a typical two-tier implementation, SQL statements are issued by the application and then handed
on by the driver to the database for execution. The results are then sent back via the same
mechanism, but in the reverse direction. It is the responsibility of the driver (ODBC) to present the
SQL statement to the database in a form that the database understands.
• Availability of well-integrated PC-based tools like, Power Builder, MS Access, 4 GL tools provided
by the RDBMS manufacturer, remote SQL, ODBC.
• PC-based tools show Rapid Application Development (RAD) i.e., the application can be developed
in a comparatively short time.
• The 2-tier Client/Server provides much more attractive graphical user interface (GUI) applications
than was possible with earlier technology.
• Architecture maintains a persistent connection between the client and database, thereby
eliminating overhead associated with the opening and closing of connections.
• As the application development is done on client side, maintenance cost of application, as well as
client side tools etc. is expensive. That is why in 2-tier architecture the client is called ‘fat client’.
• Increased network load: Since actual processing of data takes on the remote client, the data has to
be transported over the network. This leads to the increased network stress.
• Applications are loaded on individual PC i.e. each application is bound to an individual PC. For this
reason, the application logic cannot be reused.
• Due to dynamic business scenario, business processes/logic has to be changed. These changed
processes have to be implemented in all individual PCs. Not only that, the programs have to undergo
quality control to check whether all the programs generate the same result or not.
• Software distribution procedure is complicated in 2-tier Client/Server model. As all the application
logic is executed on the PCs, these entire machines have to be updated in case of a new release. The
procedure is complicated, expensive, prone to errors and time consuming.
• PCs are considered to be weak in terms of security i.e., they are relatively easy to crack.
• Most currently available drivers require that native libraries be loaded on a client machine.
• Load configurations must be maintained for native code if required by the driver.
• Problem areas are encountered upon implementing this architecture on the Internet.
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
Client (Tier 1)
Application
Driver
Network
Interface
Network
Network Interface
Data base
Server (Tier 2)
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
Three-Tier Computing
In 3-tier architecture, there is an intermediary level, meaning the architecture is generally split up
between:
A client, i.e. the computer, which requests the resources, equipped with a user interface
(usually a web browser) for presentation purposes
The application server (also called middleware), whose task it is to provide the requested
resources, but by calling on another server
The data server, which provides the application server with the data it requires
Reusability is hard to achieve if pieces of business logic must be distributed across systems and
several databases are involved. To avoid embedding the application’s logic at both the database side
and the client side, a third software tier is inserted in between. In the threetier architecture, most of
the business logic is located in the middle tier (here business logic is encapsulated as a component in
a separate tier). In this structure, when the business activity or business rules change, only the
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
middle tier must be modified. In three-tier architecture application responsibilities are divided into
three logical categories (in other words, the business system must provide three types of main
services)
Presentation (GUI) or user services: Include maintaining the graphical user interface and
generating what users see on the monitor. Presentation Logic dealing with:
Screen formatting
Windows management
Input editing
What-if analysis
Application services or business rules: These include executing applications and controlling
program flow. Business logic dealing with:
Domain and range validation
Data dependency validation
Request/response architecture of Inter Process Communication level
Database services or data server: Which refers to the management of underlying databases.
Server logic deals with:
Data access
Data management
Data security
SQL parsing
In three-tier model, a third server is employed to handle requests from the client and then pass
them off to the database server. The third server acts as proxy for all client requests. Or, in other
words we can say: “In three-tier client/server system the client request are handled by intermediate
servers which coordinate the execution of the client request with subordinate servers.” All client
requests for the database are routed through the proxy server, thereby creating a more secure
environment for your database. In two-tier environment, we can say that the client uses a driver to
translate the client’s request into a database native library call. In a three-tier environment, the
driver translates the request into a “network” protocol and then makes a request via the proxy
server. Figure 1.8 represents the three-tier Client/Server model.
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
The proxy server makes the database request on behalf of the client and passes the results back
after they have been serviced by the database. This approach eliminates the need for DBMS to be
located on the same server. There are a couple of drawbacks to this model. One is that it requires
that a small server process (listener) be set up on the middle server. Secondly, it requires all your
client requests be transmitted into a “network” protocol. First-tier (client-tier): The main
responsibility of this tier is to receive user events and to control the user interface and presentation
of data. As most of the software is removed from the client, the client is called “Thin Client”. Mainly
browser and presentation code resides on this tier. Second-tier (application-server-tier): The
complex application logic is loaded here and available to the client tier on request from client. This
level forms the central key towards solving the 2-tier problem. This tier can protect direct access of
data. Object oriented analysis aims in this tier to record and abstract business processing in business
projects. This way it is possible to map this tier directly from the case tools that support object
oriented analysis.
Database-server-tier
This tier is responsible for data storage. This server mostly operates on a relational database. The
boundaries between tiers are logical. One can run 3-tiers in one and the same machine. The
important fact is that the system is neatly structured and well-planned definitions of the software
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
boundaries exist between the different tiers. Some of the advantages of using three-tier model
include:
• Application maintenance is centralized with the transfer of the business logic for many end users
into a single application server. This eliminates the concern of software distribution that is
problematic in the traditional two-tier Client/Server model.
• Many users are able to access a wide variety of server applications, as all application logic are
loaded in the applications server.
• As a rule servers are “trusted” systems. Their authorization is simpler than that of thousands of
“untrusted” client-PCs. Data protection and security is simpler to obtain. Therefore, it makes sense
to run critical business processes that work with security sensitive data, on the server.
• Redefinition of the storage strategy won’t influence the clients. RDBMS’ offer a certain
independence from storage details for the clients. However, cases like changing table attributes
make it necessary to adapt the client’s application. In the future, even radical changes, like switching
from an RDBMS to an OODBMS, won’t influence the client. In well-designed systems, the client still
accesses data over a stable and well-designed interface, which encapsulates all the storage details.
• Load balancing is easier with the separation of the core business logic from the database server.
• Dynamic load balancing: if bottlenecks in terms of performance occur, the server process can be
moved to other servers at runtime.
• Business objects and data storage should be brought as close together as possible. Ideally, they
should be together physically on the same server. This way network load for complex access can be
reduced.
• The need for less expensive hardware because the client is ‘thin’.
• Change management is easier and faster to execute. This is because a component/ program
logic/business logic is implemented on the server rather than furnishing numerous PCs with new
program versions.
• The added modularity makes it easier to modify or replace one tier without affecting the other
tier.
• Your database server does not have to be directly visible to the Internet. An additional advantage
is that the three-tier architecture maps quite naturally to the Web environment, with a Web
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
browser acting as the ‘thin’ client, and a Web server acting as the application server. The three-tier
architecture can be easily extended to N-tier, with additional tiers added to provide more flexibility
and scalability. For example, the middle tier of the three-tier architecture could be split into two,
with one tier for the Web server and another for the application server. Some disadvantages are:
• You may see increased network traffic if a separate proxy server is used.
N-tier architecture (with N more than 3) is really 3 tier architectures in which the middle tier is split
up into new tiers. The application tier is broken down into separate parts. What these parts are
differs from system to system. The following picture shows it:
The primary advantage of N-tier architectures is that they make load balancing possible. Since the
application logic is distributed between several servers, processing can then be more evenly
distributed among those servers. N-tiered architectures are also more easily scalable, since only
servers experiencing high demand, such as the application server, need be upgraded. The primary
disadvantage of N-tier architectures is that it is also more difficult to program and test an N-tier
architecture due to its increased complexity.
MVC
Traditionally used for desktop graphical user interfaces (GUIs), this pattern became popular for
designing web applications. Popular programming languages have MVC frameworks that facilitate
the implementation of the pattern.
For ease of development and deployment of the project, the web-application is divided into basic 3
modules: model, view and controller.
Model: responsible for handling database interaction with the controller (database layer)
Controller: responsible for acting as per user action (business logic layer)
Considering the example of AWT or Java Swing (Drop-down menu/Combobox menu), if the user
wants to retrieve the states belonging to the selected country from drop-down menu,
View: displays the Combo box menu to the user (coordinates with model)
Controller: sends message to model about the user’s selection of country name.
The complete architecture is mainly controlled by the controller. The end-user (client) actions on
view, based on which the controller delegates the requests to model. The model retrieves required
data from beans or database (through database queries) and responses back to the controller. Based
on the response received, the controller changes/modifies the data in view.
The components of Client/server architecture must conform to some basic principles, if they are to
interact properly. These principles must be uniformly applicable to client, server and to
communicate middleware components. Some of the main principles are as follows:
Hardware independence
Software independence
Open access to services
Process distribution
Standards
Hardware independence
Here the client server and communication middleware should be able to run on multiple hardware
platforms (IBM, DEC, Compaq, Apple and so on) without any functional differences.
Software independence
Here the client server and communication middleware processes should support multiple operating
systems (such as windows 98, windows NT, Apple Mac system, OS/2, Linux and Unix), multiple n/w
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
protocols (such as IPX and TCP/IP) and multiple applications (spreadsheet, Database, electronic mail
and so on)
All clients in the system must have open (unrestricted) access to all the services provided
within the network and these services must not be dependent on the location of the client
or the server.
Services should be provided on demand to the client.
Process distribution
The decision of the application processing load must conform to the following rules
Client and server processes must be autonomous entities. This property enables to clearly
define the functionality of each side and it enhances the modularity and flexibility of the
system.
Local utilization of resources (at both clients and server sides) must be maximized. The client
and server process must fully utilize the processing power of the host computers. To utilize
all resources, the server process must be shared among all the client processes, that is a
server should service multiple requests from multiple clients.
Scalability and flexibility requires that the client and server process be easily upgradable to
run on more powerful hardware and software platforms. This provides additional
capabilities and better performance for the client/server processes
Interoperability and integration that client and server processes be integrated to form a
system. Swapping a server process must be transparent to the client process.
Standards
All the principles that are formulated must be based on standards applied within the
client/server architecture.
Eg: Standard must govern the user interface, data access, network protocols, interprocess
communication and so on.
Standards ensure all the components interact in an orderly manner to achieve the desired
results
There is no universal standard for all the components
Eg: A) an application can be based on ODBC (open Data base connectivity) instead of integrated
Database application programming interface for data access.( IDAPI)
[ODBC and IDAPI are database middleware components that enable the system to provide a data
access standard for multiple processes.]
B) The application might use IPxTCP/IP [Transmission control protocol or internet protocol], as the
network protocol.
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
Standards should ensure that all the components (servers, clients and communication middle ware )
are able to interact as long as they use the same standards.
A client server topologies refers to the physical layout of the client/server network in which all the
clients and servers are connected to each other. The possible client/server topological design and
strategies used are as follows:
Client
Server
Multiple Client, Single server
In this topology, several clients are directly connected to only one server.
Client 1
Server
Client 2
Client 1 Server1
Client 2 Server2
Client 3 Server3
In mainframe systems all the processing takes place on mainframe and usually dumb terminals that
are end user platform are used to display data on screens.
Database
Main frame
3. Very flexible
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
4. Very Expensive
In client/server lan one or more stations called server gives services to other
stations, called clients.
The server versions of network OS is installed on server, and the client version
network OS is installed on clients.
A network may have several servers, each dedicated for a particular task. These
servers enable many clients to share access to the same resources and enable the
use of high performance computer systems to manage the resources.
A file server allows the client to access shared data stored on the disk connected to
the file server. Each client can send data to be printed to the print server, which then
spools and print them. The file server station server runs a server file access program
and a print server station a server print handling program.
Users, Applications and resources are distributed and linked by single local area
network
Through internet vast amount of information becomes available from the same application
and the interface.
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
Here web browsers are universal clients. A web browser is a minimalist client that interprets
information it receives from a server, and displays it graphically to a user. The client takes
complete responsibility for displaying the hypertext document, and for the users response
to it.
Eg: Web browsers like Netscape and spyglass interprets HTML commands. These browsers
execute HTML commands and display text and images on a specific GUI platform; It can also
navigate from one page to other using embedded hyper links
The server system supplies multimedia document (pages) and runs some application
programs (HTML forms and CGI programs) on behalf of client.
Client server computing offers organizations the ability to distribute computing, storage and
other resources as dictated by business needs. But the standard-based open systems
provide the necessary flexibility and interoperability for maximum benefits.
IEEE technical committee on open systems offers the following definition of open systems.
A comprehensive and consistent set of international information technology
standards and functional standard profiles that specify interfaces, services and supporting
formats to accomplish interoperability and portability of applications data and people.
Standard areas
1. Platforms: These standards are developed by hardware and software vendors usually in response
to defacto standards such as intel chips, Unix and DOS with windows.
2. Networks: Industry standard networking protocols such as OSI and TCP/IP is being used.
3. Middleware: This is the software that sets between application and the OS including GUI’s,
Databases, email systems etc.
Interoperability and portability are provided through adherence to standards. Portability means that
software will run on other platforms without requiring modifications to application code.
Interoperability means that the software can work with other platforms.
Existing standards:
Currently there are recognized standards for the server operating systems environment and for the
network protocols.
UNIX:
POSIX:
Portable operating system interface (POSIX) from IEEE is a UNIX based specification, which is
a standard for server OS.
It is a uniform means for a C language application. It can request service from an OS
regarding of the underlying hardware architecture or operating environment.
Programmers can choose from a list of standards library functions and system header files.
TCP/IP
OSI
Open system interconnection model was developed by ISO to provide a common basis for
communication system standards.
It can support heterogeneous communication.
OSI model provides a hierarchical layer structure in which each layer performs a specific n/w
function, services the next high layer and accepts requests from the next lower layer.
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
Open Systems
Management directives
Business Information system is an integrated set of components for collecting, storing and
processing data and for providing information for business. Business firms rely on Information
Systems (IS) to carry out and manage the operations, interact with customers and compete in the
market place.
The user interface handles presentational tasks and controls the dialogue. The application Kernel
performs the business logics and the database access layer connects the application Kernel functions
to a database
ation
Services APPLICATION
BUSINESS LOGIC
KERNEL
DATABASE ACCESS
DATA MANAGEMENT
DATABASE
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
General Forces
Allocating functionality and data to the places where it is actually needed supports distributed
business process very well, but distributions raises a systems complexity. Few sources of complexity
are GUI, middleware and heterogeneous OS environment.
Processing styles
Different processing styles require different distribution decisions. Batch processing need processing
power close to the data and interactive processing should be close to input/output devices.
Distribution Vs Performance
We gain performance by distributed processing units executing tasks in parallel placing data close to
the processing and balancing workload between several servers. But as the level of distribution
increases the communication network overhead bottleneck in communication network increases.
In distributed environment the number of possible security holes increases because of greater
number of attack points.
The partitioning of system layers into client and server process enables distribution of the process
within the network, but the more software we distribute higher the distribution and installation cost
will occur in a centralised system.
Placing functionality on a server enforces code reuse and reduces client code size, but data must be
shipped to the server and the server must be enabling the functionality of request by multiple
clients.
Distribution Pattern
There are several distribution styles to distribute an information system by assigning client and
server roles to the components of the layered architecture.
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
Distributed Presentation
This pattern partitions the system within the presentation component. One part of the presentation
component is packaged as a distribution unit and processed separately from other parts of the
presentation, which can be packaged together with the other application layers.
Instead of distributing presentation functionality the whole user interface becomes a unit of
distribution and act as a client of the application kernel on the server side.
The pattern splits the application Kernel into 2 parts which are processed separately.
CST426 –Client Server Architecture (Dept. of Comp. Sc, Mangalam College of Engineering)
Remote Database:
The database is a major component of business information system. Sometimes several application
work on the server database. This pattern can locate the database component on a separate node
within the system’s network.
Distributed database:
The database is decomposed into separate database components, which can interact using IPC. With
a distributed database an application can integrate data from different database systems, o data can
be stored more closely to the location where it is processed.