Client Server
Model
The client–server model of computing is a distributed application structure that partitions tasks or
workloads between the providers of a resource or service, called servers, and service requests,
called clients. Often clients and
servers communicate over a computer
network on separate hardware, but
both client and server may reside in the same system. A server host runs one or
more server programs which share their resources with clients. A client does
not share any of its resources, but requests a server's content or service
function. Clients therefore initiate communication sessions with servers which
await incoming requests.
When a bank customer accesses online banking services with a web browser (the client), the client initiates a
request to the bank's web server. The customer's login credentials may be stored in a database, and the web server accesses
the database server as a client.
An application server interprets the returned data by
applying the bank's business
logic, and provides the output to the web server. Finally, the web
server returns the result to the client web browser for display.
In each step of this sequence of client–server message
exchanges, a computer processes a request and returns data. This is the
request-response messaging pattern. When all the requests are met, the sequence
is complete and the web browser presents the data to the customer.
The main basic communication modes:
- RPC (Remote Procedure
Call)
- Message-based
Types of Client Server architecture
Basically
client server model have three parts: client, business logic and Data Source. Based
on this there are two types.
Two Tier
Three Tier
Two Tier Architecture
The direct communication takes place between client and
server. There is no intermediate between client and server. Because of tight
coupling a 2 tiered application will run faster.
The Two-tier architecture is divided into two
parts:
1) Client Application
(Client Tier)
2) Database (Data Tier)
2) Database (Data Tier)
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 same
time, as a result it cause a data integrity issue.
Advantages:
- Easy
to maintain and modification is bit easy.
- Communication
is faster.
Disadvantages:
- In two tier architecture
application performance will be degrade upon increasing the users.
- Cost-ineffective.
Three Tier
Architecture
Three-tier architecture typically comprises
a presentation tier, a business or data
access tier, and a data tier.
Three layers in the three tier architecture are
as follows:
1) Client layer
2) Business layer
3) Data layer
2) Business layer
3) Data layer
1) Client layer
It is also called as Presentation layer which
contains UI part of our application. This layer is used for the design purpose
where data is presented to the user or input is taken from the user. For
example designing registration form which contains text box, label, button etc.
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 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.
Advantages
- High
performance, lightweight persistent objects
- Scalability
– Each tier can scale horizontally
- Performance
– Because the Presentation tier can cache requests, network utilization is
minimized, and the load is reduced on the Application and Data tiers.
- High
degree of flexibility in deployment platform and configuration
- Better
Re-use
- Improve
Data Integrity
- Improved
Security – Client is not direct access to database.
- Easy
to maintain and modification is bit easy, won’t affect other modules
- In
three tier architecture application performance is good.
Disadvantages
- Increase
Complexity/Effort
Summary for
Client-Server Architecture
Client-server is a computing architecture which
separates a client from a server.
It is almost always implemented over a computer
network
The most basic type of client-server architecture
employs only two types of nodes: clients and servers.
->This type of
architecture is sometimes referred to as two-tier.
->It allows devices to
share files and resources.
Server provides the service.
Client is considered as the customer requesting the
service.
The server service can be shared among a number of
clients.
Clients must request or initiate the service.
The location of the server in the network is
transparent to clients.
Transaction between C/S is message-passing based.
C/S architecture is scalable.
->Horizontally (more
clients can added)
->Vertically (more
servers can be added)
The server is centrally maintained where as clients
are independent of each other.