Download client server computing

Document related concepts

Computer cluster wikipedia , lookup

Component Object Model wikipedia , lookup

Application Interface Specification wikipedia , lookup

Team Foundation Server wikipedia , lookup

Dependency injection wikipedia , lookup

• We have 2 types of n/w architectures – client
server and peer to peer.
• In P2P, each system has equal capabilities and
responsibilities .
• In CS, it is different.
• CS architecture is also called 2 tier architecture.
• It is an application that runs on a personal
computer or work station and relies on a server to
perform some operations.
• Eg: web browser, email clients
• It is a part of the client server model that
communicates with the server through inter
process communication techniques.
• Clients can be classified as either fat, thin or
• A fat client, also known as a rich client or thick
client, is a client that performs the bulk of any
data processing operations itself, and does not
necessarily rely on the server.
• A thin client is a minimal sort of client.
Thin clients use the resources of the host
• A thin client's job is generally just to graphically
display pictures provided by an application server,
which performs the bulk of any required data
• A hybrid client is a mixture of the above two
client models.
• A server is a computer program that provides
services to other computer programs (and their
users) in the same or other computers.
• The computer that a server program runs is also
frequently referred to as a server.
• Depending on the computing service that it offers
it could be a database server, file server, mail
server, print server, web server, gaming server, or
some other kind of server.
• In the client/server programming model, a server
is a program that awaits and fulfills requests
from client programs in the same or other
• A given application in a computer may function as
a client with requests for services from other
programs and also as a server of requests from
other programs.
• Client server is the distribution of an application
program into two logically separate components,
each performing very separate duties.
• Load balancing between client and server.
Methods for creating Client Server Applications
• Different methods in which CS applications are
developed are:
1.) 3GL like C,C++,COBOL,PASCAL etc
2.)4GL like
FoxPro,Panther,PowerBuilder,Matlab,PL/SQL etc.
3.) CASE: Computer Aided S/W Engineering.
It produce client server applications with graphical
interfaces as output.
4.)5GL visual builders: It helps developers to code
very sophisticated applications without writing
source code of any kind.
Heterogeneous Computing
• Diverse computing environment containing PCs,
minicomputers, mainframe computers etc.
• Each application vendor must strive to support
key platform for its target s/w consumer.
• Organizations buy software based on 3 criteria.
1.) Is it compatible with our existing s/w and h/w?
2.) Will it integrate with our current platform?
3.) Will it integrate with platforms we intend to use
in the future?
• In heterogeneous computing, h/w platforms must
be able to support multiple operating systems,
networks and protocols.
• Operating systems should communicate with
other operating systems.
• Operating
independent like Windows NT,UNIX.
Cross Platform Computing
• An application which runs on multiple platforms.
• A cross-platform application may run on Microsoft
Windows on the x86 architecture, Linux on
the x86 architecture and Mac OS X on either
Macintosh systems.
• It is the responsibility of the application developer
to take care of these things.
• The key things to be done by application
programmer as follows:
1.) The application must run on multiple platforms.
2.) It must have the same look and feel on other
3.) It must integrate with the native operating
4.) It must be maintained simply and consistently.
• Some integrated development environments or
frameworks are available for client server
• E.g: Microsoft’s Windows Open System
Architecture(WOSA), the UNIX COSE and Novell’s
AppWare Foundation.
Distributed Computing
multiple computers that communicate through
a computer network.
• The computers interact with each other in order
to achieve a common goal.
• In parallel computing, all processors may have
access to a shared memory to exchange
information between processors.
• In distributed computing, each processor has its
own private memory (distributed memory).
Information is exchanged by passing messages
between the processors.
• Distributed Computing is a form of client server
• Increase of overall application throughput and the
ability to multitask are tremendous benefits to
the user.
• Corporates benefits from the integration of
discrete network components and their
functioning as a whole to increase efficiency and
reduce costs.
• Distributed machines process work by exactly the
same means as client server model.
• Many distributed nodes may be working on behalf
of one requesting client.
• It is the responsibility of the client to manage
information requests and the receipt of results.
• Managing the load at a central server is very
effective in distributed environment.
• Work can be dispatched to nodes such as those
geographically nearest the requesting client.
Costs of Client Server Computing
• Early implementers believe that CSC is a cheaper
alternative to mainframe or minicomputers.
• In some cases CSC is more expensive than
traditional systems.
CSC costs by functional area
CSC VS Minicomputer Cost Break down
Benefits of Client Server Computing
• Client is relieved of intensive computing tasks and
can perform other duties.
• So, client can respond better to local, end user
• From the clients perspective, applications are
executed more quickly.
• Users benefit because they are capable of
performing more work in the same amount of
• Expensive computers with more processing power
can be shared among many clients, which
maximizes use of the most costly systems and
fully utilizes their available resources.
• Scalability of distributed networks is a large
potential performance advantage for client server.
• Another advantage is use of client server for
centralized data management.
• Server can act as a focal point for data
• When essential connectivity and services are
being provided, we can support a number of
• The Application is unaware of underlying protocol
support, has become the focal point for data
• Here, the server module is responsible for data
access and may provide a centralized
management to front end stations.
• Server application provides data management
• By providing a layer between data requests and
data retrieval, the data management layer
provides consistency to server applications and
thus to client systems.
• Specifications such as Borland/Novell’s Integrated
Database API (IDAPI) and Microsoft's Open
Database Connectivity (ODBC) provide this
• Application programmers merely interface with
the services provided by IDAPI or ODBC to fashion
a single interface to multiple SQL data sources.
• Another advantage is effective use of server
• Disks, printers, faxes and services etc. can be
shared by network clients.
• Client server promises to improve the overall
performance of application programs and
minimize network usage.
• An obvious benefit of client server computing is
Reduced Total execution time.
• Advantage of reduced execution time is that client
application can may take advantage of the
additional CPU cycles that becomes available.
• If the client OS is multitasking, the client
application may run concurrently while waiting for
the server computer to complete specified
amount of work.
• The client machine at this point is able to process
more work in a shorter amount of time due to the
• Another is reduced Client Memory Usage
• Memory usage is decreased when implementing
client server because application code as well as
third party modules may be migrated to other
• Another advantage is reduced network traffic.
• In Client Server model, the actual data
manipulation resides on the server computer and
usually not transferred to the client station during
• The client computer only receives data when the
unit of work is completed.
• As a result fewer network transmissions are
required to compute tasks.
Client server Databases
• Client machines:
– Run own copy of an operating system.
– Run one or more applications using the client
machine's CPU, memory.
– Application communicates with DBMS server running
on server machine through a Database Driver
– Database driver (middleware) makes a connection to
the DBMS server over a network.
• Server Machines:
– Run own copy of an operating system.
– Run a Database Management System that manages a
– Provides a Listening daemon that accepts connections
from client machines and submits transactions to
DBMS on behalf of the client machines.
– Examples: Sun Sparc server running UNIX operating
system, PC with Windows NT operating system.
RDBMS such as Oracle Server, Sybase, Informix, DB2
• Middleware:
– Small portion of software that sits between client and
– Establishes a connection from the client to the server
and passes commands between them.
– E.g ODBC
Fundamentals of Client Server Design
• Client Server systems are the coordination of
involvement between two logical systems (client
& server) and their application logic components.
• Many logical components execute most efficiently
on the client; many will execute efficiently on the
• Managing these logic components is the essence
of client server application.
• Designing applications to become client server
requires proper architecture.
• Because portions on application execute on more
than one system, client server software must be
modularized for distribution among different
• Separating
components makes writing client server
applications much easier because components
provide well defined locations where applications
may become distributed.
• This logical separation better prepares
applications for distribution across a network.
Division of labor between client and Server
• The following lists show components and their
most efficient execution location.
User interaction
Application logic
Request formulation
Queries against shared resources
Management: Application and data
Transaction processing
Centralized application logic
Managing the interaction of client and server
• There are 3 layers to be defined for application
components to interact:
1. Application interaction protocol
2. Communication Technique
3. Network protocol
Application Interaction protocols
• They are uniquely defined for each program.
• Used to logically describe the data being passed
between client and server components.
• It is independent of the underlying network
protocol used to actually transfer the data.
• Application Interaction protocols are of 2 types:
- flexible
• A predefined protocol could be established
between components where the order and
modification of data passed between would not
• In flexible protocol there is no predetermined
format to the data being transmitted.
• A predefined protocol offers an advantage in
speed and simplicity.
• Flexible protocol is more adaptable to traditional
client programming and will require less demands
of the client side programmer.
• Efficiency of client server protocol depends on
how it prepares for transmission, acceptance and
delivery of data between systems.
• In flexible protocols, each parameter must be
packed and described individually.
• It will be a time consuming process depending on
the data being passed between systems.
• In predefined protocol there is no need of
packaging of data.
• When properly architected the inter application
level protocol should remain independent of the
underlying communication protocols.
• For programmers not familiar with client server
design flexible protocol is easy.
Communication Techniques
• There are generally 4 mechanisms for managing
client to server interaction.
1. Remote Procedure calls
2. Native communication protocols
3. Messaging
4. Object orientation
• The quickest means of developing client server
application code is with RPC.
• Hand coding RPCs is a difficult process.
• Products such as NobleNet EasyRPC provide client
programmers an easy method for RPC.
• A major drawback to RPCs is that traditionally
they have been very synchronous in nature.
• When a client makes RPC requests of the server
procedure it is blocked until the server completes
the function and returns.
• Advanced RPC products do not have this
• It is a type of protocol that allows a program on
one computer to execute a program on
a server computer.
• Using RPC, a system developer need not develop
specific procedures for the server.
• The client program sends a message to the server
with appropriate arguments and the server
returns a message containing the results of the
program executed.
• Another method for client server interaction is
the message oriented products.
• These products communicates between client and
server in the form of messages.
• The messages are processed by some queuing
mechanism at the receiving node.
• A messaging queue is obtained and once
established messages can flow freely over this
message queue.
• Another technology for distribution of
applications is Object orientation.
• Common
Architecture(CORBA) by Object Management
Group(OMG) is specifically designed to deal with
issues of distributing object technology and
• It helps objects to communicate with one another
regardless of what PL they are written or what OS
they are running.
• Also we have Distributed System Object
Model(DSOM) from IBM and Component Object
Model (COM) from Microsoft.
• DSOM and COM uses CORBA architecture.
• Sun Microsystems RMI is another one.
• We have many choices for communication
• UnixWare or NetWare-IPX/SPX
• Windows NT or OS/2- NetBIOS or Named Pipe
• It is the responsibility of the application developer
to assess the network protocol requirements and
choose an appropriate communication protocol.
Techniques for implementing Client Server
1. Preparing applications for Client Server
2.Optimizing applications for Client Server
Preparing applications for Client Server
• Architectural changes needed for client server
development are:
1. Identify and group logically similar
2.Convert applications into Request/Response
3.Make server components reentrant.
4.Initiate data access on a per-client basis
Identify and group logically similar procedures.
• The first major step in the migration from stand
alone programming to client server is to identify
procedures that are candidates for migration to
the server.
• Grouping
procedures as
components and migrating the entire set to the
server will increase efficiency.
• It minimizes client to server transitions.
• Grouping procedures helps identify the
dependencies of the procedural components.
Convert applications into Request/Response
• The requesting and responding components of
client server computing represent the most
traditional application programs and client server
• When using a remote procedure call approach,
many functions or procedures communicate
remotely with the server.
• The interface between requesting and responding
agents varies widely and is strictly a developer
design issue.
Make server components reentrant.
• In environments where threads are supported, it is
very important for the server components to be
• Being reentrant simply means that an application
procedure can be called more than once and
executed concurrently without causing corruption.
• Variables defined locally are valid because they exist
on a stack allocated uniquely for each call to the
• Global variables modification will change the value
contained by other threads making the same
procedure call.
Initiate data access on a per-client basis
• Each access to global data on behalf of the
responding component will need to be made on a
per request component basis.
• In order for server functions to be reentrant , data
must either be contained locally or be given
serialized access to global data.
• If global data is used serialization must be used to
coordinate access so as not to corrupt the
Optimizing application for client server
1. Minimizing the Data Passed between client and
2. Maintaining data at the server.
3. Processing Predefined Application protocols
4. Server Processing with queues.
Minimizing the Data Passed between client and
• It can be achieved in two different ways.
1. Reducing the number of parameters or
amount of data.
It is done by sending only what is needed to
the server.
2. The server could maintain similar data
passed by the client on each function call.
• All parameters in a flexible protocol need to be
packed and copied into a buffer at the client and
unpacked and copied into parameters at the
• This is an expensive process and is made worse
when handling unnecessary data.
Maintaining data at the server.
• For client server connections that involve many
interactions between client and server, certain
core information may be transmitted on each call.
• This state information could easily be removed
from the wire if the server remembered the data
between calls from the client.
• By maintaining the data at the server, the
efficiency of the client server application can be
Processing Predefined Application protocols
• Better use predefined application protocols than
flexible ones.
• Since predefined ones are not flexible, a minimal
amount of time is spent in transmission.
• If properly architected, predefined protocols are
efficiently processed.
Server Processing with queues.
• Efficient server processing of client requests is
greatly enhanced through efficient use of queues.
• Using message queues for communication
between client and server is used.
• Any client server interaction, has the following
1.The interface between Request/Response
2.The formulation of requests from the client
3.The transmission of requests between
4.Acceptence and unpacking of requests from the
5.The execution of requests at the server.
6.Transmission of response to the client.
Multiprogramming and Multitasking
• It is the capability of an operating system to
• The term more widely used to describe
multiprogramming is multitasking.
• Multitasking gives the users a feeling that multiple
applications are running at once.
• I/O burst and CPU burst.
• Single-Tasking and Multitasking Systems.
• E.g: Single tasking OS- DOS
Multitasking OS- Novell Netware, UnixWare,
Microsoft Windows NT, IBM OS/2
• Program in execution
• Has 2 main characteristics-code execution and
resource ownership.
• Each application loaded into memory is
represented as a process that is the controlling
mechanism in a multitasking system.
• A process can create other processes.
• Parent process and Child process.
• A database server might construct one process to
communicate with clients, one to read databases,
one to write databases etc.
• Each separate process must communicate via
some form of inter process communication(IPC)
which is specific to the OS.
• Application programmers must distribute the
server application’s functionality among different
• These programs will be executed as loadable
processes and will interact with each other to
form the server application.