Title: Runtime Environment
1Introduction
3-Tier Client/Server Overview by Gary
Rau DS513 April 29, 1999 http//people.ce.mediaon
e.net/grau/clientserver.html
2What is Client/Server?
- 1) Client/Server describes the relationship
between two computer programs in which one
program, the client, makes a service request from
another program, the server, which fulfills the
request. - 2) Tiers describe the logical partitioning of an
application across clients and servers.
32-Tier and 3-Tier Architecture
- 2-Tier splits the processing load in two.
Application logic runs on client, which
communicates with data on server. - 3-Tier splits the processing load between clients
that run user interface logic, application server
running business logic, and database/legacy
application.
4Characteristics of Client/Server Systems
- Service
- Shared resources
- Asymmetrical protocols
- Transparency of location
- Platform independence
- Message-based exchanges
- Encapsulation of services
- Scalability
- Integrity
52-Tier vs 3-Tier Comparison I
Comments
2
3
Characteristic
62-Tier vs 3-Tier Comparison II
Comments
2
3
Characteristic
72-Tier vs 3-Tier Comparison III
Comments
2
3
Characteristic
82-Tier vs 3-Tier Comparison IV
Comments
2
3
Characteristic
9Client/Server Technologies
- File Servers
- Database Servers
- Transaction Servers
- Groupware Servers
- Object Application Servers
- Web Application Servers
10Client/Server withFile Servers
Client
Communication Protocols
Server
Server
PageServer
Application
File Server
File Calls
11Client/Server with Database Servers
Client
Communication Protocols
Server
Server
PageServer
Application
DBMS Server
SQL Calls
12Client/Server withTransaction Servers
Client
Communication Protocols
Server
Server
PageServer
Application
DBMS TP Monitor
Transactions
13Client/Server with Groupware Servers
Client
Communication Protocols
Server
Server
PageServer
Application
Groupware Server
Groupware Messages
14Client/Server with Object Application Servers
Client
Communication Protocols
Server
ORB
ORB
Server
PageServer
Application
Object Services
Remote Method Invocation
15Client/Server with Web Application Servers
Client
Communication Protocols
Server
Server
PageServer
Application
CGI
Application
HTTP over TCP/IP
16Middleware I
- The / in Client/Server
- All the distributed software needed to support
interactions between clients and servers - Client-side API to invoke a service
- Transmission of request and response over network
17Middleware II
- Provide platform for running server-side
components responsible for - Load balancing
- Integrity of transactions
- High availablity
- Secure environment
18Client/Server Software Infrastructure
Client
Middleware
Server
Service-Specific
ODBC TxRPC Mail ORB HTTP
Browser
DSM
GUI/OOUI
SNMP CMIP Tivoli/ORB
NOS
Directory Security Distributed File
DSM
RPC Messaging Peer-to-Peer
DSM
CustomServer
Transport Stack
OS
OS
NetBIOS TCP/IP IPX/SPX SNA
19Component-Based Architecture
- Develop in small steps (4X4)
- Applications reuse components
- Encapsulate services
- Off-the-shelf, mix-and-match
- Component environments get better with age
20Component Types
- Services encapsulate a business function
- Objects encapsulate specific data with the
associated business functions - Stateless objects retrieve required instance data
when needed, and update database when done - Stateful objects are unique. Changes in state
must be captured by the infrastructure.
21Design Patterns
- Greenfield
- Turbocharger
- Integrator
22Greenfield Pattern
Graphical User Interface
Services
Database
GUI/OOUI
TP Monitor or OTM
23Turbocharger Pattern
Existing System
Graphical User Interface
Services and Data
GUI/OOUI
TP Monitor or OTM
Middle-Tier Database
24Integrator Pattern
Existing System
Graphical User Interface
Services and Data
GUI/OOUI
TP Monitor or OTM
Middle-Tier Database
25When to use 3-Tier
- gt 50 services or classes
- gt 1 application language or development
organization - gt 1 different data source
- gt 3 years application life (especially if
modifications/additions are expected) - gt 50,000 transactions per day
- gt 300 users on same system using same database
- significant interapplication communication
- growth expectations
26Secrets for 3-Tier Success
- Keep it simple
- Design up front
- Buy, dont build
- Rely on industry standards
- Use a TP Monitor or OTM
- Take baby steps
- Use outside help
- Address system management during development
- Test, test, test
- Develop a rollout plan
27Overview of scripting lang.
- Scripting languages are used for adding client
side interaction, publishing live and dynamic
data to web site and an ability to communicate
with components in application server is making
them a very important in building multitier
architecture for organizations.
28Where scripting lang is important
- 1) Datawarehousing. Plays a major role in
publishing data out to web - 2) Internet and Intranet Applications. eg Fed Ex.
- 3) Applications where deployment is major pain
and has lot of remote users.
29Where they fit in mutitier architecture
Client
Middle Tier
Data
Web Server
30Runtime Environment
Client
Middle Tier
Data
Web Server
PageServer
31Runtime Environment
Client
Middle Tier
Data
Web Server
PageServer
TransactionServer
32Runtime Environment
Client
Middle Tier
Data
Web Server
PageServer
TransactionServer
Interface
CustomServer
33Runtime Environment
Client
Middle Tier
Data
Web Server
Browser
Very Thin
PageServer
TransactionServer
Interface
CustomServer
34Runtime Environment
Client
Middle Tier
Data
Web Server
Browser
Very Thin
PageServer
Browser
Thin
TransactionServer
Interface
CustomServer
35Scripting in Multitier Architecture
Client
Middle Tier
Data
Web Server
Browser
Very Thin
PageServer
Browser
Thin
TransactionServer
Interface
Stand-aloneApplication
CustomServer
Rich
36 Thick or thin client ??
How user utilize system?
Heavy dataentry
VB Client
VB Client
Heavy Batchprocessing
Instant ReportAccess
ASP Client
ASP Client
Mainly External Access
System consideration based on heavy database
access and development team
37Major vendors supporting scripting language
deployment
Page Server
client
Sybase PowerDynamoActive Server pages Netscape
Livewire(javascript)Cold Fusion
browser
Database
JaguarCTS MTS SilverStream Oracle app
server NetDynamics
Thick client
Component Server
38Where CGI fits in
- CGI. The classic way to perform server-side
functions is via Common Gateway Interface (CGI).
Many CGI programs use Perl, a scripting language
well-suited to the task. However, you can write
CGI programs in practically any language
including C, Python, and Java. Without careful
planning, CGI can introduce security holes in
your server, and CGI programs are usually hard to
debug and difficult for casual programmers to
write.
39Server side scripting(eg ASP)
- ASP is a deployment environment for server side
scripting - Client call the page server where the scripts
resides. - Scripts then query against the database or
components to create dyanamic content on the
client.
40Server side scripting(eg ASP)
- Jscript(competition of javascript) and Vbscript
are the scripting languages used in ASP
environment. - ASP files on the server can be updated at any
time. Simply save the changes to the file and the
script will be automatically compiled the next
time the Web page is loaded.
41Server side scripting(eg ASP)
- ASP includes five standard objects for global use
- Request -- To get information from the user
- Response -- To send information to the user
- Server -- To control the Internet Information
Server - Session -- To store information about and change
settings for the user's current Web-server
session - Application -- To share application-level
information and control settings for the lifetime
of the application
42VBscript(Overview)
- Visual Basic Scripting Edition, also known as
VBScript, enables authors to create scripts using
a subset of the Microsoft Visual Basic language.
If you are already a Visual Basic programmer, or
if you are not a programmer but are looking for a
scripting language that is easy to learn,
VBScript might be the right language for you.
VBScript is implemented as a fast, portable
interpreter for use in Web browsers and
applications that use ActiveX controls, Java
applets, and OLE Automation servers.
43VBScript -- Features
- Error handling. VBScript has a subset of the
error handling provided by Visual Basic. This
includes the error object and on error resume
next. Error handling is very important when
developing server-side code, since most of the
functionality will require access to external COM
objects, which could throw errors. - Formatting. VBScript has the ability to format
dates, numbers, and currency built into the
language.
44VBScript -- Features
- Easier COM integration. Many COM objects return
information in the form of a collection. VBScript
has built-in support for iterating through
collections - Standard Event-binding Syntax. Visual Basic
developers will immediately recognize the
object_event (sub button1_onclick) naming
convention for event handlers. VBScript works in
exactly the same way, so in any application that
supports event binding (such as Internet
Explorer, Outlook, and Windows Scripting Host),
you can use this syntax for your event hook-up
code.
45VBScript -- Advantages
- Easy to understand and master. VBScript's biggest
asset is that it's Basic, a language designed to
be learned quickly. Visual Basic has brought
Basic users some of the advantages of more
complex languages, while not losing sight of the
fact that the language should be easy to
understand. - It's Visual Basic. All the skills learned with VB
instantly apply to VBScript. Also, an enormous
community exists to provide training, books, and
magazines for learning Visual Basic. - Flexible. VBScript can be used in a wide variety
of applications, and Microsoft is committed to
ensuring that wherever script is part of an
application, VBScript will be included.
46VBScript --- Syntax
- ltCENTERgt
- ltPgt
- ltH2gtHello, world samplelt/H2gt
- ltINPUT TYPEBUTTON VALUE"Click me"
NAME"BtnHello"gt - lt/CENTERgt
- ltSCRIPT LANGUAGE"VBScript"gt
- lt!--
- Sub BtnHello_OnClick
- MsgBox "Hello, world!", 0, "My first active
document" - End Sub
- --gt
- lt/SCRIPTgt
47JScript(Overview)
- JScript is Microsoft's implementation of an
ECMA-compliant scripting language (like
JavaScript) that is targeted specifically to the
Internet. Like VBScript, JScript is implemented
as a fast, portable interpreter for use in Web
browsers and applications that use ActiveX
controls, Java applets, and OLE Automation
servers. JScript is not Java and has nothing to
do with Java. It is closer in syntax to C or C.
48Jscript Features
- Dynamic JScript was designed as a completely
dynamic language that is, you can effectively
redefine your program on the fly. While this has
a number of potential disadvantages, it does give
you the ultimate flexibility in your scripts.
This is particularly useful in DHTML programming,
since DHTML allows you to dynamically manipulate
the object model. If you really want to drive
DHTML, you might want to consider using JScript
instead of VBScript. - Object oriented JScript certainly isn't a
traditional class-based, object-oriented
language, but it does provide an effective
alternative based on prototypes. This allows you
to reap the benefits of object orientation
without the statically defined nature of classes.
49Jscript - Features
- Regular expressions A main reason why Perl has
such a huge following. Regular expressions add
the ability to search for expressions in strings.
This is exceptionally useful on the server and,
increasingly, on the client. - Eval Provides the ability to immediately
evaluate code at runtime. This allows you to
dynamically redefine logic dependent at run time.
This is especially useful when used in
conjunction with Remote Scripting, which works
with VBScript as well.
50Jscript -- Advantages
- Broad reach. JScript is pretty much guaranteed to
run in any browser, anywhere. If your page really
must work in any browser, this is the language
for you. - All those books in the bookstore. How many books
can there be? If you want to learn JScript, there
are myriad books to help you. - Similarity to C and Java. If you are a C or Java
programmer, the JScript syntax is going to be
familiar to you.
51JavaScript Overview
- Netscapes compact, object-based scripting
language for developing client and server
Internet applications. - Not Java .. Or is it?
52Client-side JavaScript
- Embedded directly with HTML
- As with HTML, JavaScripts functions are built
into the browser - Example code
ltscript language"JavaScript"gt lt!--
document.write("Hello World!")
//--gt lt/scriptgt
53LiveConnect in JavaScript
- Allows Java and JavaScript code to communicate
with each other - From JavaScript, you can instansiate Java objects
and access their public methods and fields - From Java, you can access JavaScript objects,
properties and methods
54LiveConnect in JavaScript
ltSCRIPTgt lt!-- if ((navigator.appVersion.indexOf("4
.") ! -1) (navigator.appName.indexOf("Netscape
") ! -1)) ip "" java.net.InetAddres
s.getLocalHost().getHostAddress()
document.write("Your IP address is "
ip) else document.write("IP Address
only shown in Netscape with Java
enabled!") //--gt lt/SCRIPTgt
55ServerSide JavaScript
- Serve more Client JavaScript and HTML
- Database Connectivity through LiveWire
- Corba Object Connectivity through LiveConnect
56Database Connectivity - LiveWire
57Corba Connectivity - LiveConnect
58(No Transcript)
59SilverStream Overview
- What is SilverStream
- The birth and success of SilverStream
60SilverStreams 3-tier Architecture
Database Server
Client
SilverStream HTTP Server
Database Server
Tier 1
Tier 2
Tier 3
61Benefits of SilverStreams 3-Tier Architecture
- Security management
- Code Management
- Data Valication
62SilverStream and Firewalls
External
P r o x y S e r v e r
F I r e w a l l
Database Server
SilverStream Client
SilverStream Server
SilverStream Client
Database Server
SilverStream Client
Internal
63SilverStream and Web Servers
64Client
Server
Session Info
Session
thread
Client Connection
initial connection
execute request
thread
thread
thread
Connection Pool
65server/database connections
Database Server
Client
Database Server
SilverStream Server
Client
Database Server
Client
66 javax.servlet. ServletRequest
1
URL Request
service event
Explorer
javax.servlet. ServletResponse
2
3
Netscape
HTTP Listener (Servlet)
javax.servlet. ServletResponse
67SilverStream and Page Management
- Java Presentations
- Dynamic Page Presentations
68Oracle Database
Server
Sybase Database
request
Client
DSO
Lotus Notes
Result
69Business Objects and Corba Objects in SilverStream
70Other Features of SilverStream
- SilverStream and E-mail
- SilverStream and JAR(java archive) files
- SilverStream and JavaBeans
71SilverStream Security
72Load Balancing and Fail-over in SilverStream
73In the Distance with SilverStream
74Load Balancing
75Topics
- Concepts
- What is Load Balancing?
- Why do we need load balancing?
- What is essential for a load balancer?
- Architecture example Silverstream
- Common Algorithms
- Vendors
76Concepts What is Load Balancing?
- Evenly distribute network processing, database
access, transactions. - Example Clustering
- distribute incoming transactions evenly
- redirect requests
77Concepts Why do we need load balancing?
- Handling multiple requests, while ensuring
- optimal response time
- quality performance
- The cluster of servers have even workload and
operate at maximum efficiency.
78Concepts What is essential for a load balancer?
- Retain the state of all servers it is managing.
- Have a good algorithm ? efficient load balancing
plan
Example of a good load balancing
architecture(Silverstream) ...
79Silverstream Load Balancing Architecture
Application Server
Dispatcher
Web Server ISAPI or NSAPI Layer
Load Balancer
Application Server
HTTP
Cache Manager
Application Server
80Silverstream Load Balancing Architecture
Application Server
Dispatcher
Web Server ISAPI or NSAPI Layer
Load Balancer
Application Server
HTTP
Cache Manager
Application Server
- Dispatcher
- receives client requests
- consults load balancer
- receives routing plan
- forwards requests
81Silverstream Load Balancing Architecture
Application Server
Dispatcher
Web Server ISAPI or NSAPI Layer
Load Balancer
Application Server
HTTP
Cache Manager
- Load Balancer
- the process to maintain a state of all servers
come up with a balancing plan
Application Server
82Silverstream Load Balancing Architecture
Application Server
Dispatcher
Web Server ISAPI or NSAPI Layer
Load Balancer
Application Server
HTTP
Cache Manager
- Cache Manager
- immediately update the cache
- send invalidation commands (parallel)
- able to assume all servers are in sync all the
time Load Balancer - the process to maintain a state of all servers
come up with a balancing plan
Application Server
83Common Algorithms
- Sender Initiated Algorithms
- Receiver Initiated Algorithms (more effective)
- Symmetrically Initiated Algorithms
- Adaptive Algorithms
84Some Vendors
- Alteon networks Inc. ACEswitch
- ArrowPoint Communications Inc. Content Smart
Switch - Coyote Point Systems Inc. Equalizer