a presentation to oracle openworld blistering web applications with oracle timesten in memory option
TRANSCRIPT
A Presentation to Oracle OpenWorld
Blistering Web Applications with Oracle TimesTen In Memory Option
2
Intro & Welcome
Bill Binko, Perot Systems Consulting (Tampa)Perot Consulting Performance Practice
–Tuning & Optimizing Enterprise Applications–Custom Development of High-Volume
ApplicationsContact: [email protected]
3
Overview
Very High Volume Web Applications– Delivery & Data Collection
Leverage TimesTen (IMDB) and Cache Connect Based on several engagements (past & present)
– Online Content Delivery, Smart Grid, Smart CDN Management Fundamental:
– Find high-volume functionality (usually not hard)– Re-implement using TimesTen IMDB & Simpler Architecture
Results:– Highly scalable (horizontally)– Deliveries (finding constrained Content): 1,000 req/sec/node– Data Collection (simple recording & aggregation) : 75,000 req/sec/node
4
Java EE Tutorial #1 – What’s wrong with this picture?
Web Container
JSP Servlet
JST
LJava S
erver Faces
StA
XJava P
ersistenceJT
AC
onnectorsJM
SM
anagement
WS
MetaD
ataW
eb Services
JAC
CJA
XR
JAX
-WS
JAX
-RP
C
SAAJ
Java Mail
JAF
J2SE
Database
5
Java EE Tutorial #2
Web Container
JSP Servlet
JST
L
Java Server F
aces
StA
X
Java Persistence
JTA
Connectors
JMS
Managem
ent
WS
MetaD
ata
Web S
ervices
JAC
C
JAX
R
JAX
-WS
JAX
-RP
C
SAAJ
Java Mail
JAF
J2SE
Database
EJB Container
EJB
StA
X
Java Persistence
JTA
Connectors
JMS
Managem
ent
WS
MetaD
ata
Web S
ervices
JAC
C
JAX
R
JAX
-WS
JAX
-RP
C
SAAJ
J2SE
Java Mail
JAF
6
A More Reasonable App Structure
Application Server
Presentation
Application Logic
App S
rv. Services
Business Logic
Data Access
7
Traditional Application Stack
Flavor somewhat irrelevant– Java EE, .NET, LAMP, even Rails
Most still have relational DB as foundation Many Framework Options (Even just for Java!)
– Presentation: Struts, JSF, JSP+Tag Libs– App Logic: Struts, Spring, Seam, etc.– Business Logic: Internal & External
External: EJB, SOA, ESB, etc.– Data Access: Java Persistence, ORMs, JDBC, DAO
Works well for “General” Applications– Many Benefits (Technical & Business)– Many Problems (Debugging, Performance, Don’t get me started)
Important: Every Layer Adds Overhead!
Application Server
Presentation
Application Logic
App S
rv. Services
Business Logic
Data Access
8
What is a “General” Application?
“Normal” Distribution of Effort/Results
Follows “Pareto” 80/20 Rules– Bugs, Traffic, Load, Time, etc.
Consistent “Type” of activities– CRUD Applications– Similar Actions
No major Outliers– Resource Consumption
“What Manager Expect”– (Not as common as we’d like)
“Trivial Many”
“Vital Few”
Effort Result
80%
20%
20%
80%
9
High-Volume Applications
Fundamental Split in Functionality– Configuration/Analysis (Low Volume)
– Delivery/Collection (High Volume)
No longer 80/20! More like 100/1 (or 1000/1!) Two Main Categories
– Content Delivery– Data Collection– Combination
Normal Architecture– L.V. Benefits– H.V. Fails (Spectacularly)
“Trivial Many”
“Vital Few”
Features(URLs, Methods, etc)
Resources(Time, Traffic, Hits)
>99%
>99% Delivery/
Measurement
ConfigurationAnalysis
10
Category 1: High-Volume Delivery Applications
Delivery vs. Web App vs. Hosting? – Many rapid requests from separate clients– Mostly Stateless/Sessionless– Dynamic Content: not just hosting files/images
Examples– Online Ads– Personalized Feeds (RSS/Atom/etc.)– APIs (esp. REST)
Pseudo-Delivery– Ajax (Auto-Complete, Status Check)– Smart CDN Management
11
High-Volume Delivery Application Solution
The Trick is to Split the App– Low Volume: Configuration– High Volume: Delivery
Session, Workflow, Human Interfaces are SLOWHandle Delivery SeparatelyTimesTen (Oracle IMDB) Helps Tremendously
12
Delivery Solution - Remember the RDBMS!
Relational Database – Oracle RAC
Application Server
Presentation
Application Logic
App S
rv. Services
Business Logic
Data Access
Table
Table
Table
Table
Table
Table
Table
Table Table
Table
ODBC/JDBC/OCI
13
Delivery Solution - One option: just split the app
Relational Database – Oracle RAC
Low Volume Server
Presentation
Application Logic
App S
rv. Services
Business Logic
Data Access
Table
Table
Table
Table
Table
Table
Table
Table Table
Table
ODBC/JDBC/OCI
Required For Delivery
High Volume Server(Delivery Node)
Request Management
Direct Data Access
ODBC/JDBC/OCI
14
Delivery Solution – Add TimesTen (IMDB Option)
Relational Database – Oracle RAC
Low Volume Server
Presentation
Application Logic
App S
rv. Services
Business Logic
Data Access
Table
Table
Table
Table
Table
Table
Table
Table Table
Table
ODBC/JDBC/OCI
Required For Delivery
High Volume Server
Request Management
Direct Data Access
TimesTen IMDB
Table
Table
Table
Table Table
Read Only Cache Groups
Cache Connect
Shared Memory O/JDBC
15
TimesTen Overview
JDB
C
Driv
erO
DB
C
Driv
er
Sha
red
Mem
ory
TimesTen – In-Memory RDBMS
Cache Group
Table
Table
Table
Table
Table
Table
Table
Table Table
Table
Oracle RAC
Cache Connect
Disk
Log
Shi
p
Exp
oses
16
High Volume Delivery Server Design
High Volume Delivery Node
TimesTen/IMDB
Ap
ache
Web
Se
rver
AJP
Java EE App Server
Custom Apache C ModuleS
erv
let
JDB
C
Tim
esT
en
Driv
er
Sh
ared
Me
mo
ry
Ca
che
Gro
ups
Ca
che
Co
nnec
t
RAC
Del
iver
y R
equi
red
Dat
a
HTTPAJP Direct
Direct
Low Volume Server
Pre
sen
tatio
n
Ap
plic
atio
n L
og
ic
App Srv. Services
Bu
sin
ess
Lo
gic
Da
ta A
cce
ssHTTP JDBC
17
Nothing Magic about WebLogic / Java
High Volume Delivery Node
TimesTen/IMDB
Apa
che
Web
Ser
ver
PH
P M
odul
e
PHP Environment
Custom Apache C ModuleP
age
Logi
c
MD
B2
OD
BC
Driv
er
Sha
red
Mem
ory
Cac
he G
roup
s
Cac
he C
onne
ct
RAC
De
live
ry R
eq
uire
d D
ata
HTTPAJP Direct
Direct
Low Volume Server
Pre
sent
atio
n
App
licat
ion
Log
ic
App Srv. Services
Bus
ines
s L
ogic
Dat
a A
cces
s
HTTP JDBC
18
Scales Well Horizontally
Edg
e S
erve
r(A
pach
e/F
5/IB
M)
HT
TP
HV Delivery Node
Oracle RAC
HV Delivery Node
Low Volume Server
Ora
cle/
OC
I
HV Delivery Node
HV Delivery Node
HV Delivery Node
TimesTen/IMDB
Apa
che
Web
Ser
ver
AJP
Java EE App Server
Custom Apache C Module
Ser
vlet
JDB
C
Tim
esT
enD
river
Sha
red
Mem
ory
Cac
he G
roup
s
Cac
he C
onne
ctAJP Direct
Direct
Low Volume Server
Pre
sen
tatio
n
Ap
plic
atio
n L
og
ic
App Srv. Services
Bu
sin
ess
Lo
gic
Da
ta A
cce
ss
19
Category 2: Data Collection And Analysis
Not about Intelligent Delivery About Rapid Data Collection Simple “Requests” are just data submission Attributes:
– High Volume– Low Latency– Many Concurrent Clients
Examples– Analytics (JavaScript/Ajax/Beacon Images)– Sensor Data– (Content) Delivery Tracking
20
High-Volume Data Collection Solution
The Trick is STILL to Split the App– Low Volume: Analysis– High Volume: Data Collection
Analysis uses normal BI/DW techniques– Don’t change this
Data Collection is critical Pre-Aggregate on the High-Volume Server
– Data is still data, and you CAN’T keep it all– (unless you’re Google/Amazon/etc.)
21
Data Collection & Analysis
Dimensional DW or Relational for ETL later
LV Analysis Server
Presentation
Application Logic
Ap
p Srv. S
ervices
Business Logic
Data Access
Table
Table
Table
FactTable
Table
Table
Table
Table Table
Table
ODBC/JDBC/OCI
Required For Delivery
HV Data Collection Server
Request Management
Direct Data Access
TimesTen IMDB
Table
Table
Table
Table Table
AWT/SWT Group
Shared Memory O/JDBC
AggregatedData
Table
Table
Local TT Tables
Aggregator
Aggregates
22
Data Collector HV Design
High Volume Data Collection Node
TimesTen/IMDB
Apa
che
Web
Ser
ver
Background Process
Custom Apache C Module
Sha
red
Mem
ory
Cac
he G
roup
s
Cac
he C
onne
ct
RAC
Agg
rega
ted
Dat
a
HTTPDirect
Direct
Very Little Logic
Primarily Image/Code Responses
Just Record & Respond
Background Aggregator Moves to SWT
Cac
he M
odul
es
23
Combining Delivery & Data Collection
One final option (our original client’s needs)Use Data Collection to track DeliveriesReuse the High Volume Server for both Delivery
& Data Collection“Round Trip” feedback Loop
24
Combination Approach – Both Delivery & Data Collection in one Node
High Volume Data Collection Node
TimesTen/IMDB
Ap
ach
e W
eb
Se
rve
rBackground Process
Custom Apache C Module
Sh
are
d M
emor
y
Ca
che
Gro
ups
Ca
che
Con
nect
RAC
HTTP
Direct
Direct
Java EEDelivery Servlet Direct
Low Volume Server
Pre
sen
tatio
n
Ap
plic
atio
n L
ogi
c
App Srv. Services
Bu
sin
ess
Lo
gic
Da
ta A
cce
ssHTTP JDBC
AJP
Mod
ule AJP
Exp
ose
s
25
Combination – Data Flows
High Volume Data Collection Node
TimesTen/IMDB
Apa
che
Web
Ser
ver
Background Process
Custom Apache C Module
Sha
red
Me
mor
y
Ca
che
Gro
ups
Ca
che
Con
nect
RAC
HTTP
Direct
Direct
Java EEDelivery Servlet Direct
Low Volume Server
Pre
sen
tatio
n
Ap
plic
atio
n L
og
ic
App Srv. Services
Bu
sin
ess
Lo
gic
Da
ta A
cce
ssHTTP JDBC
AJP
Mod
ule AJP
Exp
ose
s
26
Combination – Full Picture
Delivery/Data Collection Node
Background Processor
Operational RAC Instance
Delivery Servlet
Feedback Script
Data Collection Module
Delivery Required Data (R/O)
Aggregated Data (SWT)
Raw Data Coll.(Local TimesTen)
Operational DB
Aggregated Data ETL Scripts
DW RAC Instance
ETL Scripts
Staging Tables
DW Schema(Dimensional)
J2EEApache TimesTen OracleColors:
Read
Record
Use
27
Questions?
Questions about Architecture?
28
Other Issues: Connection Management
Internet
F5
LTM
340
0(L
ayer
7 S
witc
h)
`
Publisher Web Server
SSL – Direct Backbone Connection
WAP
Cable
DSL
Dial-Up
Gig
aBit
Eth
erne
t
HV Delivery Node
HV Delivery Node
HV Delivery Node
HV Delivery Node
HV Delivery Node
TimesTen/IMDB
Apa
che
Web
Ser
ver
AJP
Java EE App Server
Custom Apache C Module
Ser
vlet
JDB
C
Tim
esT
enD
river
Sha
red
Mem
ory
Cac
he G
roup
s
Cac
he C
onne
ctAJP Direct
Direct
29
Other Issues: Hardware
Low Volume – Standard HardwareRAC Instance – Standard HardwareHigh Volume – Not Standard
– CPU Intensive– Memory Hogs– Saturates Network I/O– Odd Disk Usage (Sequential Writes)
TimesTen Group great at helping find write hardware!
A Presentation to Oracle OpenWorld
Blistering Web Applications with Oracle TimesTen In Memory Option