Oracle 9i AS

Download Report

Transcript Oracle 9i AS

Oracle 9i AS
Availability and Scalability
Margaret H. Mei
Senior Product Manager, ST
1
Agenda
• Brief 9iAS Overview
• Designing and Deploying Applications
– Scalability
– Availability
2
Oracle9i Application Server
Create Personalized Portals
Portal
Oracle9iAS
Wireless
for
wireless
clients
XML/XSL
J2EE
Forms
Services
BC4J
CORBA
Perl
Oracle
PSPs
PLSQL
Java Stored
Procedures
Developer Kits
LDAP, XML, Database
Extract Business Intelligence
Reports
Services
Discoverer
Clickstream
Intelligence
Database Cache
Connected
Clients
Oracle HTTP Server powered by Apache
Run All Your Web Sites & Applications
non-Oracle
Data
Sources
Collaborate With Stakeholders
Internet File System
Email, Unified Messaging
non-Oracle
Apps
Integrate Your Business
Oracle Applications
Interconnect
Oracle Gateways
Oracle
Workflow
Manage Your Web Infrastructure
Oracle Enteprise Manager
Oracle Internet Directory
3
Oracle Advanced Security
Agenda
• Brief 9iAS Overview
• Designing and Deploying Applications
– Scalability
– Availability
4
Layered Scaling
• Scale each tier independent of the other tiers
• Middle-tier: Scale its two major components
– Front-end: The web server and different plug-ins
that serve static files and route requests to the
back-end servers
– Back-end: Execute application logic written in Java
(JSPs, Servlets), PL/SQL (PSPs, Stored
Procedures) etc.
• Data-tier: Scale the data-tier
5
Scaling Front-end
• Front-end Apache Web server: Serves static
resources and acts as a dispatcher for
dynamic requests
– The Apache server is stateless (static, mod_plsql...)
– Scale on SMP - Apache process based architecture
– Scale on Web Farm: Run multiple instances on a
web farm (exact clones) and use a load balancing
solution
• Software load balancers: Oracle 9i AS Web Cache,
Network Dispatcher, NLBS etc.
• Round-Robin DNS (RRDNS)
• Intelligent IP or Application aware load balancing hardware
like LocalDirector, BigIP, ACEDirector etc.
• Combination of one or more of the above
6
Deploying Front-end
• Front-End Web Server Scalability
Front-end Web servers
Load Balancer
Oracle Web Cache
Back-end servers
PL/SQL
PL/SQL
Database
Internet
PL/SQL
PL/SQL
Shared disk
7
Deploying Front-end
• Multiple load balancers using RRDNS
Front-end Web servers
Back-end servers
Load Balancer 1
Database
Internet
Load Balancer 2
8
Back-end Server : Application Design
• Stateless vs. stateful applications
– A stateful application maintains session
state information within its runtime
environment between successive client
calls.
– A stateless application maintains no such
information within its environment. It may
persist state information in a common store
such as a database or in the client browser.
9
Stateful Application Example
• Step-by-step example of client requests to a
stateful application
Node A
Client
Load
Balancer
Database
Node B
10
Stateful Application Example
• Step-by-step example of client requests to a
stateful application
Client issues request; request gets
routed for service by Node A. Node A
may access db to service the request
Node A
Client
Load
Balancer
Database
Node B
11
Stateful Application Example
• Step-by-step example of client requests to a
stateful application
Node A services request; maintains
session state for Client’s session
Node A
Client
Load
Balancer
Client’s session state
Database
Node B
12
Stateful Application Example
• Step-by-step example of client requests to a
stateful application
On any subsequent request, Client
must be serviced by Node A (and not
Node B) to access Client’s session
state
Node A
Client
Load
Balancer
Client’s session state
Database
Node B
13
Stateless Application Example
• Step-by-step example of client requests to a
stateless application
Node A
Client
Load
Balancer
Database
Node B
14
Stateless Application Example
• Step-by-step example of client requests to a
stateless application
Client issues request; request gets routed
for service by Node A
Node A
Client
Load
Balancer
Database
Node B
15
Stateless Application Example
• Step-by-step example of client requests to a
stateless application
Node A services request; maintains
session state in Database
Node A
Client
Load
Balancer
Client’s session state
Database
Node B
16
Stateless Application Example
• Step-by-step example of client requests to a
stateless application
On any subsequent request, Client may
be serviced by either Node A or Node B
and access session state
Node A
Client
Load
Balancer
Client’s session state
Database
Node B
17
Deploying Back-end: Stateless
• Write stateless applications that run on a cluster
• Front-end server(s) load balances across the backend servers
Front-end servers
Back-end servers
JServ
Load Balancer
JServ
Database
Internet
JServ
JServ
18
Load-balancing Back-end
Apache JServ on a cluster
• Example: Load-balancing between multiple
nodes with Apache JServ.
The HTTP Server will load-balance
requests to Apache JServ instances.
Bigger machines may be allocated
more requests
Apache
JServ
Apache
JServ
Apache
JServ
Client
Load
Balancer
HTTP
Server
Apache
JServ
19
Apache
JServ
Deploying Back-end Server: Stateful
• Stateful Applications: Use sticky routing
• Use Oracle 8i JVM
Front-end servers
Back-end servers
8i JVM
PL/SQL
Load Balancer
8i JVM
PL/SQL
Internet
8i JVM
PL/SQL
8i JVM
PL/SQL
20
Database
Load-balancing
HTTP Server + Oracle8i JVM
The Oracle8i JVM can load-balance
over multiple listener processes
Client
Network
Load
Balancer
HTTP Servers
Ports
Oracle8i
Listeners
Processes
21
Oracle8i
Dispatchers
Oracle8i
Shared
Servers
Load-balancing
HTTP Server + Oracle8i JVM
A listener will be chosen at random
Client
Network
Load
Balancer
HTTP Servers
Ports
Oracle8i
Listeners
Processes
22
Oracle8i
Dispatchers
Oracle8i
Shared
Servers
Load-balancing
HTTP Server + Oracle8i JVM
The listener will determine which Oracle8i JVM node has the lightest
load, and then which dispatcher on that node is most available
Client
Network
Load
Balancer
HTTP Servers
Ports
Oracle8i
Listeners
Processes
23
Oracle8i
Dispatchers
Oracle8i
Shared
Servers
Load-balancing
HTTP Server + Oracle8i JVM
The dispatcher will then route the request to one of the server
processes
Client
Network
Load
Balancer
HTTP Servers
Ports
Oracle8i
Listeners
Processes
24
Oracle8i
Dispatchers
Oracle8i
Shared
Servers
Scaling Stateless Applications
JDK JVM
• The JDK JVM scales by giving quick performance to
many clients. This works well for stateless Java apps
because the VM does not get weighted down by
holding onto a lot of state.
Client
No
state
Client
Client
Client
HTTP
Server
Apache JServ
on JDK JVM
Additional clients do not contribute
additional state to be managed between
successive requests
25
Application Design: Scalability
JDK JVM
• However, stateful applications force the VM to perform
a lot of concurrent memory management when
multiple users access the system. Managing state may
inhibit the scalability of the JDK JVM.
Client
Client
Client
Client
HTTP
Server
Apache JServ
on JDK JVM
Managing this memory may slow down
the performance of the JDK JVM
26
Application Design: Scalability
Oracle8i JVM
• The Oracle8i JVM is a session-based JVM that
handles stateful applications exceedingly well.
Performance does not degrade until the capacity of
the hardware is reached.
Client
Client
Client
Client
HTTP
Server
No concurrent GC because of
segregated memory spaces
27
Oracle8i JVM
Scaling Back-end Server
• Oracle 9i AS provides scalability for both stateless and
stateful applications
– Stateless Java applications scale well in the JDK JVM
– Stateful Java applications scale well in the Oracle8i JVM (aka
JServer)
• Oracle 9i AS also provides a highly scalable
infrastructure for: Oracle Forms, Oracle Reports,
PL/SQL and Perl applications
28
Scaling Data Server: Oracle 9i AS
• Middle-tier database cache
– Reduces load on back-end database
– Faster access by avoiding network round trips
– Works transparently with existing applications
– Does not slow updates etc..
29
Scaling Data Server: Oracle 9i AS
• Example: Web site with catalog
Without Cache:
Static content
served from middle
tier. All catalog
queries are resolved
on back end.
Catalog
data
Static
content
HTTP Server
Data reads
Data writes
With Cache:
Queries resolved at
cache, reducing load
on back end. Cache
data on many middle
tier nodes for higher
Scalability.
Static
content
Catalog
data
HTTP Server Oracle8i Cache
Data reads
30
Data writes
Scaling Data Server: Database Cache
Front-end servers
Back-end servers
jserv iCache
Load Balancer
Partitioned
Data-tier
OPS
Database
jserv iCache
Internet
jserv iCache
jserv iCache
31
OPS
Database
Scalability: Putting it all together
• Stateless
Front-end servers
Back-end servers
Apache jserv iCache
Load Balancer
Apache jserv iCache
Partitioned
Data-tier
OPS
Database
Internet
Apache jserv iCache
Apache jserv iCache
32
OPS
Database
Scalability: Putting it all together
• Stateful
Front-end servers
Load Balancer
Apache
Apache
Back-end servers
OJVM iCache
Partitioned
Data-tier
OPS
Database
OJVM iCache
Internet
Apache
Apache
33
OJVM iCache
OJVM iCache
OPS
Database
Oracle 9i AS Services for Scalability
• Oracle 9i AS enables scalable stateless and
stateful applications, front-end servers, backend servers and data servers
Oracle 9i AS makes it easy to build scalable web
applications
34
Agenda
• Goals for PAS
• Designing and Deploying Applications
– Scalability
– Availability
35
Availability
Death-detection and restart
• Oracle 9i AS will detect the failure of given threads or
processes and restart them as appropriate.
– Watchdog in HTTP Server
– PMON in Oracle8i JVM, Oracle8i PL/SQL, and Oracle8i
Cache
– HTTP Server will detect death of Apache JServ instance and
not route requests to it. Restart of remote Apache JServ in a
future release.
36
Availability
Redundancy & Failover
• For web server failure, Oracle 9i AS web cache can
reroute requests to other web server instances.
• For failure of stateless services, Oracle 9i AS will
failover a request to an alternate instance of the
service. This is similar to connection re-routing.
37
Oracle 9i AS: High Availability
• Oracle 9i AS can be deployed to create a
system with no single point of failure
No single point of
failure in database
tier with OPS
HTTP
Server
Network
loadbalancer
Apache
JServ
Oracle8i
Cache
Apache
JServ
Oracle8i
Cache
HTTP
Server
Client
Oracle8i
HTTP
Server
Network
loadbalancer
Oracle8i
Apache
JServ
HTTP
Server
38
Oracle8i
Cache
Oracle 9i AS: Session Isolation
• There is no session isolation in a typical
JDK JVM. The failure of one user’s
session may cause all users’ sessions to
fail.
Client
Client
BUG
Client
HTTP
Server
Apache JServ
on JDK JVM
One client may encounter a buggy session
Client
39
Oracle 9i AS: Session Isolation
• There is no session isolation in a typical
JDK JVM. The failure of one user’s
session may cause all users’ sessions to
fail.
Client
Client
Client
HTTP
Server
Apache JServ
on JDK JVM
The one bug could bring down all users’ sessions
Client
40
Oracle 9i AS: Session Isolation
• JServer isolates sessions from one
another. In the case that one fails, the
others are unaffected.
Client
Client
BUG
Client
Client
HTTP
Server
One client may encounter a
buggy session
41
Oracle8i JVM
Oracle 9i AS: Session Isolation
• JServer isolates sessions from one another. In
the case that one fails, the others are
unaffected.
Client
Client
Client
Client
HTTP
Server
Only the buggy session is lost.
Other sessions are unaffected
42
Oracle8i JVM
Oracle 9i AS: Connection Re-routing
• In the case of failure of a stateless service of Oracle 9i
AS, requests can be re-routed to alternate instances of
the service.
• If a client is accessing a stateful application, the client
may be re-routed to the instance of the application
through an alternate route
• Let’s look at an example with the HTTP Server and a
stateful application running in Oracle8i JVM...
43
Oracle 9i AS: Connection Re-routing
• Example: Failure of an HTTP Server node.
Subsequent requests can be re-routed through
alternate nodes.
Oracle8i JVM
HTTP Server
on Node A
Client
Network
loadbalancer
Oracle8i JVM
HTTP Server
on Node B
44
Oracle8i JVM
Oracle 9i AS: Connection Re-routing
• Example: Failure of an HTTP Server node.
Subsequent requests can be re-routed through
alternate nodes.
A client request comes in and is routed to an
HTTP Server instance and an Oracle8i JVM instance
Oracle8i JVM
HTTP Server
on Node A
Client
Network
loadbalancer
Oracle8i JVM
HTTP Server
on Node B
45
Oracle8i JVM
Oracle 9i AS: Connection Re-routing
• Example: Failure of an HTTP Server node.
Subsequent requests can be re-routed through
alternate nodes.
The application in Oracle8i JVM is stateful, and
session state is retained in the instance. Also, a
cookie may be returned to the client’s browser
Oracle8i JVM
HTTP Server
on Node A
Client
Network
loadbalancer
Oracle8i JVM
HTTP Server
on Node B
46
Oracle8i JVM
Oracle 9i AS: Connection Re-routing
• Example: Failure of an HTTP Server node.
Subsequent requests can be re-routed through
alternate nodes.
Now, in between requests, the HTTP Server
on Node A goes down
Oracle8i JVM
HTTP Server
on Node A
Client
Network
loadbalancer
Oracle8i JVM
HTTP Server
on Node B
47
Oracle8i JVM
Oracle 9i AS: Connection Re-routing
• Example: Failure of an HTTP Server node.
Subsequent requests can be re-routed through
alternate nodes.
The next request can be routed to the destination
Oracle8i JVM instance through an alternate HTTP Server
Oracle8i JVM
HTTP Server
on Node A
Client
Network
loadbalancer
Oracle8i JVM
HTTP Server
on Node B
48
Oracle8i JVM
Oracle 9i AS: Connection Re-routing
• Example: Failure of an HTTP Server node.
Subsequent requests can be re-routed through
alternate nodes.
If it were just an HTTP Server process that went down,
Oracle 9i AS would detect this and restart it
Oracle8i JVM
HTTP Server
on Node A
Client
Network
loadbalancer
Oracle8i JVM
HTTP Server
on Node B
49
Oracle8i JVM
Oracle 9i AS: Failover
• Oracle8i Cache features transparent
application failover (TAF). In the case that a
cache node goes down, client sessions will be
automatically recreated on an alternate
instance.
A client has a stateful session
with a cache instance
Oracle8i
Cache
Client
HTTP
Server
OJVM
Oracle8i
Cache
50
Oracle 9i AS: Failover
• Oracle8i Cache features transparent
application failover (TAF). In the case that a
cache node goes down, client sessions will be
automatically recreated on an alternate
instance.
The cache instance may go
down
Oracle8i
Cache
Client
HTTP
Server
OJVM
Oracle8i
Cache
51
Oracle 9i AS: Failover
• Oracle8i Cache features transparent
application failover (TAF). In the case that a
cache node goes down, client sessions will be
automatically recreated on an alternate
The session automatically re-connects to the
instance.
new instance. The cache session is
transparently recreated on the alternate
instance
Oracle8i
Cache
Client
HTTP
Server
OJVM
Oracle8i
Cache
52
Availability
• Minimize planned downtime
• No Single Point of Failure
• Session Isolation
• Automatic Death Detection And Restart
• Redundancy and Automatic Failover
Oracle 9i AS makes it easy to build highly
available web applications
53