CLIENT SERVER COMPUTING
CLIENT SERVER AND INTERNET
Presented by
M I Jawid Nazir
Department of Information Technology
In late 1993, the Mosaic graphical Web browser introduced the first true
client/server application environment on top of the Internet.
The Web was built on open, cross-platform, intergalactic client/server
standards. To be intergalactic, the technology must run across multiple
networks, OSs, languages, and computer platforms.
The Evolution of Web Technologies.
A Web Client/Server Interaction.
• You select a target URL
• Browser sends an HTTP request to server.
• Server comes to life and processes the request.
• Browser interprets the HTML commands and displays the page
contents
The URL Structure.
A URL provides a general-purpose naming scheme for
specifying Internet resources using a string of printable ASCII
characters
The General Structure of an HTML Document
• Flow of Text in an HTML Document
• HTML Lists
• Embedding Images in Documents
• Hyperlinks
• Cascading Style Sheets
HTML Versions
In 1980, physicist Tim Berners-Lee, proposed and prototyped
W3C Stands for the World Wide Web Consortium
W3C was created in October 1994
W3C was created by Tim Berners-Lee
W3C was created by the Inventor of the Web
W3C is organized as a Member Organization
W3C is working to Standardize the Web
W3C creates and maintains WWW Standards
W3C Standards are called W3C Recommendations
http://www.w3schools.com/
HTTP Request
HTTP Response
3-Tier Client/Server, Web-Style
Hidden Fields Maintain State Across Web Invocations.
A hidden is an ordinary INPUT field inside a form that is marked with the attribute HIDDEN.
Consequently, it can be viewed by any user via a browser's View Source command. This
means that any good cracker can easily modify the field's information to trick the server.
There is nothing to stop her from hijacking a session, impersonating a different user, or
feeding the server false information. In the hands of a cracker, cookies can be just as bad
Web Clients/Server, Java-Style
Benefits:
Java style let you create component-sized applications that servers can ship to
clients via ordinary HTML pages. Once an applet lands in a Web browser, it
becomes an instant front-end to the remote services you provide. So, in a sense,
applets are "just-in-time" shippable clients. The server downloads the client
application when and where it's needed.
SQL Database Servers
SQL servers are the dominant model for
creating client/server applications. SQL server
vendors—including Oracle, Sybase, Informix,
IBM, and Microsoft—have become household
names.
What Does SQL Do?
The SQL language is used to perform complex data operations with a few
simple commands in situations that would have required hundreds of lines of
conventional code. Physicists might call SQL "the grand unified theory of
database" because of the multifaceted roles it plays. Here is a partial list of
roles:
SQL is an interactive query language for ad hoc database queries.
SQL is a database programming language. SQL is a data definition and
data administration language
SQL is the language of networked database servers.
SQL helps protect the data in a multiuser networked environment.
Database Server Architectures
Multithreaded architectures
Process-per-client architectures Hybrid architectures
Stored Procedure?
Static SQL statements are defined in your code and converted into an access plan at
program preparation time. The SQL statement is known before your program is run.
Dynamic SQL statements are created and issued at run time.
Middleware
• Middleware is software glue between Client and Server, which helps
the communication between the client and the server
CLIENT APPLICATION MIDDLEWARE SERVER
User Interface
Business Business logic
(GUI, text Client side Server side
logic Network and Data handling
Based, HTML Middleware Middleware
(if any) code
based etc)
Types of Middleware
• Peer to Peer interfaces (P2P)
• Indicates End to End communication in the same protocol
• Since the protocol is symmetrical sometimes it is called program to program.
• In this type of network each workstation has equivalent capabilities and
responsibilities.
• Example: File sharing systems (Napster etc), Instant Messengers
• Remote Procedure Call (RPC)
• Middleware that allows a computer program running on one host to cause code to
be executed on another host remotely
• Programmer doesn’t have to explicitly code for achieving this. Middleware provides
libraries or functions to achieve this
• Message Oriented Middleware (MOM)
• Uses a queue like structure to pass messages between two hosts
• Asynchronous
• connectionless, asynchronous transactional message store-and-forward capability.
Remote Procedure Call (RPC)
CLIENT SERVER
• Clientprocess invokes a remotely located
procedure in a server process
Request
• Server process may or may not reside on the same to Server
physical machine as the client
Request
Process
BLOCKED
• When a client invokes a remote procedure
• The remote procedure executes as if it is a local
function call Response
• Sends the response back to the client process from Server
• Involves network communication for data transfer
• RPC uses synchronous communication between
client and server TIME
• Client is blocked until server responds (Client is
typically in a wait state till the responds)
SYNCHRONOUS
• Proceeds further only after the server responds. COMMUNICATION
RPC
• Middleware provides the infrastructure for creating a client-server application
– Translating of client’s request into a server side call is handled by middleware
– Application programmer need not worry about network programming
Deposit(iAccNo,fAmt)
Client Code Withdraw(iAccNo,fAmt) Application Code
Balance(iAccNo){
Business Logic
Results to Client
}
Server Stub
MIDDLEWARE
Balance(iAccNo){
(Network Call)
Send request to server
}
Client
Network Transport Services Server
Stub
RPC - Working of a Simple Server
Server
Assign a thread
to service the
REQUEST request
Param: Service Name
Additional Parameters e rvice t
Service1 S ues
Service2 Thread Pool
Client Re q
RESPONSE a c k to
Status t u rn b l
Re Poo
Requested Data
File System
Configuration File
1. Thread Pool size
2. Service configuration
3. Other Parameters
Message Oriented Middleware (MOM)
• A client/server infrastructure that is asynchronous in
CLIENT SERVER
nature
• Client does not wait in a blocked state till the server Request
responds to Server
• Client can do other tasks while the server processes the
Other things
Processing
Continue
request
• Interoperability: Allows the application to be distributed Check
over multiple heterogeneous platforms. Status
Request
Process
Other things
Processing
Examples:
Continue
• A mainframe talking to a non-mainframe applications
• IBM MQ Series is one such Message Oriented Middleware,
JMS in J2EE Applications Check TIME
Status
• Reduces complexity of developing applications that Processing
Completed
span multiple operating systems Check
Status
Response
• Masks the application developer from the details of the
Handle
Server
various operating system and network interfaces ASYNCHRONOUS
COMMUNICATION
MOM…
• Client initiates communication by putting messages on to the Message queue
• No interaction with server process (de-coupled), thus achieves asynchronous
communication
– Client can continue with other work after putting a message in queue
– Message queues also provide temporary storage when the destination program is busy or not
connected
• Server uses another queue to send responses back
Request Queue
Request2 Request1
Client Server
Program Program
Response1
Response Queue
Message Oriented Middleware
Comparing MOM and RPC
Feature MOM RPC
Client/Server time Asynchronous Synchronous
Relation Ship
Sequencing Not required Servers come up first
Style Queued Call return
Load Balancing Not Applicable because it Required because of
is de-coupled synchronous communication
Performance Slow Fast
Metaphor Post Office Like Telephone
Application Layering
Splitting an application in a Client/Server Architecture
An application can be split from two perspectives
1. From the perspective of the different functionalities
• Presentation Logic
• Business Logic
• Data Source
2. From the perspective of the concentration of functionalities
• Fat Client
• Fat Server
Application Partitioning - Gartner’s Group Model
Distributed Remote Distributed Remote Data Distributed
Presentation Presentation Function Management Database
Presentation Presentation Presentation Presentation Presentation
Logic Logic Logic Logic Logic
Business Business Business
Logic Logic Logic
Presentation CLIEN
T Database
Logic
SERVE Management
R
Business Business Business
Logic Logic Logic
Data Store Data Store Data Store Data Store Data Store
Gartner Group Model
• Distributed Presentation Logic: A part of the presentation layer goes to the client.
The other part of presentation layer, business and data management layer goes to the
server.
• Remote Presentation Logic: Only the presentation layer goes to the client. Business
and data management layer goes to the server.
• Distributed Business Logic: The presentation layer and a part of the business layer
goes to the client. The other part of business layer and data management goes to the
server.
• Remote Data Management: Both the presentation and business layer goes to the
client. The data management layer goes to the server.
• Distributed Database : Presentation layer, business layer and a part of the data
management layer goes to the client. The other part of the data management goes to
the server.
Fat Client and Fat Server
• Fat Client: Most of the application’s code resides on client side
• Fat Server: Most of the application’s code resides on the server side
• What is Thin Client and Thin Server?
2 Tier Application
•Two-tier applications remain the most common client/server architecture.
•The entire application is decomposed into two sets of services.
•The client combines UI services + business services and the other data services.
SQL
or Database
File IO
Client Program
(UI + Business Logic)
running on Server machine
the client machine
TIER 1 TIER2
3 Tier Application
•It decomposes an application into three sets of services: UI, business, and data.
•Business logic is moved to an application server
•Shared data to a database server
Via
Gateways
Legacy System
Business Network
Network Logic
Client Program
(UI + Business Logic)
SQL Queries
running on Server machine Database
the client machine
Server machine
TIER 1 TIER 2 TIER 3
2 Tier Vs 3 Tier
2Tier 3 Tier
System Administration Complex Less Complex
Security Low High
Encapsulation of Data Low High
Performance Good Good
Scalability Poor Excellent
Application Reuse Poor Excellent
Legacy Application Difficult to implement Yes (Via Gateways)
Integration
Hardware Architecture Limited Excellent
Flexibility
Middleware: Open Database Connectivity (ODBC)
• ODBC is an API by Microsoft that allows applications to access a
database by
making SQL calls
• It is a call level interface where a single application can access
remote databases under disparate DBMS such as Informix, Oracle,
Sybase
• ODBC relies on data servers to convert the ODBC calls into different
database
formats
• That means Oracle drivers are needed to access Oracle databases
• Sybase drivers are needed to access Sybase databases and so on
ODBC
ODBC has four components
1. Application : Calls ODBC Functions ,Retrieves ,Processes and Reports the results
2. Driver Manager :Loads drivers, uses odbc.ini to map data source name to a specific DLL
3. Driver : Establishes a connections to datasource translates requests and responses by
handling standard errors.
• Different Databases have different drivers
4. Data source
Application
Driver Manager
Driver to Driver to
Oracle SQL Server
Oracle SQL Server
Database Database
Web Technologies
• World wide web is also based on Client-server technology
• One of the most popular and dominant client server technologies
today
• (Covered in detail in Introduction to Web Technologies
course)
Computer
HTTP
Web Application
HTML Documents
Laptop Web Server
What is XML?
• XML - EXtensible Markup Language
• It is a portable standard for data
• What Java did for portability of code, XML does for
portability of data:
Java+XML = Portable Code + Portable Data
• Used for quick and flawless data transfer between
heterogeneous systems that are distributed across
thousands of miles.
• XML is a meta-language used to define other languages.
What is RPC?
• The Remote Procedure Call (RPC) model relates client-
server communication to conventional procedure calls.
• It views each server as implementing one or more
(remote) procedures.
• Like conventional procedures, remote procedures accept
arguments and return one or more results.
• Using the RPC model helps programmers focus on the
application instead of the communication protocol.
XML for communication
• XML document and it’s data content are used to transfer
information between applications.
• XML data is not tied to any type of client.
• XML is a purely textual representation of data, which
provides the fastest means of communication over a
network.
• When an XML document is converted to an application
usable format, the result remains XML. This repeated
process of transforming a document and always generating
a new XML, makes it a great tool for communication.
XML-RPC
• The greatest obstacle to using RPC was
encoding. That is where XML came along!
• Not only did XML provide a very simple, textual
representation of data, it provided a standard for
the structure of that data.
• XML-RPC specification is concerned with
communication not between applications, but
between components within an application, or to
a shared set of services functioning across
applications.
XML-RPC: Definition
• Hence XML-RPC is a specification and a set of
implementations that allow s/w running on
disparate operating systems, running in different
environments, to make procedure calls over the
Internet.
• It is remote procedure calling using HTTP as the
transport and XML as the encoding. XML-RPC is
designed to be as simple as possible, while
allowing complex data structures to be
transmitted, processed and returned.
What is Groupware?
A collection of technologies to support
collaborative group activity
Document store
Workflow
E-mail
Group conferencing
Group scheduling
One definition: Groupware = Lotus Notes
What is Groupware?
The Web re-defined and validated groupware technologies
SMTP mail, Usenet newsgroups, discussion
boards, Web conferencing, chat
Business-to-Business collaboration on the
Web with distributed workflow
Document Management
Electronic Imaging
Scanning documents (financial,
engineering
drawings, X-rays) for electronic storage
Appearance of PC5, LAN5, scanners,
compression
boards, and optical jukeboxes aided the
development of Electronic Imaging i
Document Management
Document management stores are typically a
combination of SQL database and the file system
SQL stores metadata and pointer to file
system
File system stores the BLOB data itself
There’s typically an access layer on top of
SQL and the file system that presents the
document store interface
Lotus Notes has a proprietary document database
Workflow : Modeling a business system
Groupware Components