11g in memory database cache

Document Sample
11g in memory database cache Powered By Docstoc
					A Presentation to   Oracle OpenWorld

   Blistering Web Applications with Oracle
   TimesTen In Memory Option
Intro & Welcome



Bill Binko, Perot Systems Consulting (Tampa)
Perot Consulting Performance Practice
      –Tuning & Optimizing Enterprise Applications
      –Custom Development of High-Volume
       Applications
Contact: bill.binko@ps.net



                                                     1
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

                                                                                 2
                                                                                                                             3
                                                                                                                  Database
                                                                                   Java
                                                                                   Mail


                                                                                              JAF
                                                                        Servlet




                                                                                        JSTL
                                                        Web Container
Java EE Tutorial #1 – What’s wrong with this picture?




                                                                                  Java Server Faces
                                                                                        StAX
                                                                                   Java Persistence
                                                                                         JTA
                                                                                                           J2SE
                                                                                      Connectors
                                                                                         JMS
                                                                                     Management
                                                                                    WS MetaData
                                                                        JSP


                                                                                    Web Services
                                                                                        JACC
                                                                                        JAXR
                                                                                     JAX-WS




                                                                                                    SAAJ
                                                                                    JAX-RPC
                                                                                              4
                                                 Java
                                                 Mail



                                                               JAF
                      EJB Container




                                                        StAX
                                                Java Persistence
                                                        JTA
                                                   Connectors
                                      EJB




                                                                            J2SE




                                                        JMS
                                                  Management
                                                  WS MetaData
                                                  Web Services
                                                        JACC
                                                        JAXR
                                                  JAX-WS
                                                                     SAAJ




                                                  JAX-RPC



                                                                                   Database
                                                 Java
                                                 Mail



                                                               JAF
                                      Servlet




                                                      JSTL
                      Web Container




                                                Java Server Faces
                                                      StAX
                                                 Java Persistence
                                                       JTA




                                                                            J2SE
                                                   Connectors
                                                       JMS
Java EE Tutorial #2




                                                   Management
                                      JSP         WS MetaData
                                                  Web Services
                                                      JACC
                                                      JAXR
                                                  JAX-WS




                                                                     SAAJ
                                                 JAX-RPC
A More Reasonable App Structure



                  Application Server




                                         App Srv. Services
                         Presentation

                     Application Logic

                       Business Logic

                         Data Access


                                                             5
Traditional Application Stack

 Flavor somewhat irrelevant                         Application Server
       – Java EE, .NET, LAMP, even Rails




                                                                           App Srv. Services
                                                         Presentation
 Most still have relational DB as foundation          Application Logic
 Many Framework Options (Even just for Java!)
                                                        Business Logic
       – Presentation: Struts, JSF, JSP+Tag Libs
                                                         Data Access
       – 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!
                                                                                               6
What is a “General” Application?

 “Normal” Distribution of
  Effort/Results
 Follows “Pareto” 80/20 Rules




                                                               20%
      – Bugs, Traffic, Load, Time, etc.
 Consistent “Type” of activities
      – CRUD Applications           “Trivial Many”




                                                      80%
      – Similar Actions
 No major Outliers




                                                               80%
      – Resource Consumption
 “What Manager Expect”
      – (Not as common as we’d like)

                                                      20%
                                     “Vital Few”


                                                     Effort   Result
                                                                   7
 High-Volume Applications
 Fundamental Split in Functionality
       – Configuration/Analysis (Low Volume)
       – Delivery/Collection (High Volume)
                                                                                        Configuration
                                                                                        Analysis
 No longer 80/20!
 More like 100/1 (or 1000/1!)
 Two Main Categories




                                                 >99%
       – Content Delivery “Trivial Many”




                                                                        >99%
                                                                                        Delivery/
       – Data Collection
                                                                                        Measurement
       – Combination
 Normal Architecture
       – L.V. Benefits
       – H.V. Fails
       (Spectacularly)          “Vital Few”
                                           Features             Resources
                                         (URLs, Methods, etc)   (Time, Traffic, Hits)




                                                                                                   8
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
                                                          9
High-Volume Delivery Application Solution



The Trick is to Split the App
    – Low Volume: Configuration
    – High Volume: Delivery
 Session, Workflow, Human Interfaces are SLOW
 Handle Delivery Separately
TimesTen (Oracle IMDB) Helps Tremendously



                                                 10
Delivery Solution - Remember the RDBMS!

         Application Server
            Presentation




                                   App Srv. Services
          Application Logic

           Business Logic

            Data Access


                           ODBC/JDBC/OCI

                       Relational Database – Oracle RAC
                                                                               Table
                                                       Table




                       Table
                                                                                       Table
                                                                       Table
                                   Table

                                                               Table

                           Table                                               Table           Table




                                                                                                       11
Delivery Solution - One option: just split the app

           Low Volume Server                                                                  High Volume Server
                     Presentation
                                                                                                (Delivery Node)




                                                  App Srv. Services
                                                                                               Request Management
                  Application Logic
                                                                                                Direct Data Access
                  Business Logic

                     Data Access

                                                                                      ODBC/JDBC/OCI
                        ODBC/JDBC/OCI

          Relational Database – Oracle RAC
                                                                      Table
                                Table




          Table
                                                                              Table
                                                Table
                        Table

                                        Table
                                                                                                      Required For
                                                                                                        Delivery
             Table                                                    Table           Table




                                                                                                                     12
Delivery Solution – Add TimesTen (IMDB Option)

                      Low Volume Server                                                       High Volume Server
                              Presentation                                                       Request Management




                                                              App Srv. Services
                            Application Logic                                                         Direct Data Access

                            Business Logic                                                     Shared Memory O/JDBC

                              Data Access                                                             TimesTen IMDB
                                                                                              Table                       Table




                    ODBC/JDBC/OCI                                                                      Table      Table           Table




                Relational Database – Oracle RAC
                                                                                                      Read Only Cache Groups

                                                      Table
                              Table



        Table
                                                              Table                       Cache Connect
                    Table                     Table


                                      Table

           Table                                      Table                       Table
                                                                                                                  Required For
                                                                                                                    Delivery



                                                                                                                                          13
TimesTen Overview

                                          TimesTen – In-Memory RDBMS




             Driver
             JDBC


                      Shared Memory
                                                                                       Table
                                                               Table




                                      Table                                            Cache Group
                                                                                                 Table
                                                                               Table
                                                 Table
             ODBC
             Driver
                                                                       Table

                                         Table                                          Table             Table




                                                                                         Cache
                                                                                        Connect
                                                    Log Ship




                                                                                                Exposes
                                                  Disk                                 Oracle RAC


                                                                                                                  14
High Volume Delivery Server Design


                                                                                                    High Volume Delivery Node

                                                                                                     Java EE App Server                    TimesTen/IMDB

                  Apache Web Server




                                                                                                                       TimesTen
                                                                                                      Servlet




                                                                                                                         Driver
                                                                                                                JDBC




                                                                                                                                           Shared Memory
                                                               AJP




                                                                                                                                                                           Cache Connect
                                                                                                                                                           Cache Groups
                                                                                      AJP                                         Direct
           HTTP




                                                                    Custom Apache C Module                                        Direct




                                                                                                                                                                            Delivery Required Data
                                   Low Volume Server
                                            App Srv. Services
                                                Application Logic


                                                                     Business Logic
                             Presentation




                                                                                      Data Access




           HTTP                                                                                                          JDBC




                                                                                                                                                                          RAC

                                                                                                                                                                                                     15
Nothing Magic about WebLogic / Java

                                                                                                           High Volume Delivery Node

                                                                                                             PHP Environment                       TimesTen/IMDB




                                                               PHP Module
                  Apache Web Server




                                                                                                             Page Logic




                                                                                                                                 ODBC
                                                                                                                          MDB2


                                                                                                                                 Driver




                                                                                                                                                   Shared Memory




                                                                                                                                                                                   Cache Connect
                                                                                                                                                                   Cache Groups
                                                                                             AJP                                          Direct
          HTTP




                                                                     Custom Apache C Module                                               Direct




                                                                                                                                                                                    Delivery Required Data
                                   Low Volume Server
                                            App Srv. Services
                                                Application Logic


                                                                            Business Logic
                             Presentation




                                                                                             Data Access




           HTTP                                                                                                                   JDBC




                                                                                                                                                                                  RAC



                                                                                                                                                                                                             16
Scales Well Horizontally

                                                                               HV Delivery Node
                                                                                            Java EE App Server                                                      TimesTen/IMDB




                                                   Apache Web Server




                                                                                                                                  TimesTen
                                                                                             Servlet




                                                                                                                                    Driver
                                                                                                                           JDBC
                                                                       AJP




                                                                                                                                                                    Shared Memory




                                                                                                                                                                                                   Cache Connect
                                                                                                                                                                                    Cache Groups
                                                                               AJP                                                                 Direct




                                                                         Custom Apache C Module                                                    Direct




                                                                                    HV Delivery Node

                                                                                       HV Delivery Node

                                                                                       HV Delivery Node
                   Edge Server
                                 (Apache/F5/IBM)




                                                                                       HV Delivery Node




                                                                                                                                                                                                                   Oracle/OCI
            HTTP




                                                                                                                                                                                                                                Oracle RAC

                                                                       Low Volume Server
                                                                                        App Srv. Services
                                                                                                       Application Logic


                                                                                                                                  Business Logic
                                                                             Presentation




                                                                                                                                                      Data Access




                                                                        Low Volume Server




                                                                                                                                                                                                                                             17
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
                                                     18
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.)

                                                      19
Data Collection & Analysis
          LV Analysis Server                                                          HV Data Collection Server
                   Presentation                                                                                  Request Management




                                         App Srv. Services
                                                                                      Aggregator

                Application Logic                                                                  Direct Data Access

                Business Logic
                                                                                                Shared Memory O/JDBC

                   Data Access                                                                           TimesTen IMDB
                                                                                                                  Aggregates        Table
                                                                                        Table            Table




                      ODBC/JDBC/OCI                                                              Table           Table
                                                                                                                            Table           Table




        Dimensional DW or Relational for ETL later
                                                                                           Local TT Tables                 AWT/SWT Group

                              Table
                                                              Table



        Table
                                         Table
                                                                                      Aggregated
                      Table                                           Table
                                                                                         Data
                     Fact
                                 Table


           Table                                             Table            Table
                                                                                                                         Required For
                                                                                                                           Delivery


                                                                                                                                                    20
Data Collector HV Design

                                                     High Volume Data Collection Node

                                                         Background Process            TimesTen/IMDB




                                     Cache Modules
                 Apache Web Server




                                                                                       Shared Memory




                                                                                                                       Cache Connect
                                                                                                       Cache Groups
                                                                              Direct
          HTTP




                                          Custom Apache C Module              Direct




                                                                                                                        Aggregated Data
           Very Little Logic
           Primarily Image/Code Responses
           Just Record & Respond
           Background Aggregator Moves to SWT

                                                                                                                      RAC


                                                                                                                                          21
Combining Delivery & Data Collection



One final option (our original client’s needs)
Use Data Collection to track Deliveries
Reuse the High Volume Server for both Delivery
 & Data Collection
“Round Trip” feedback Loop




                                                  22
Combination Approach – Both Delivery & Data Collection in one Node

                                                                                          High Volume Data Collection Node

                                                                                                                     Java EE                  TimesTen/IMDB
                                                                                                                                     Direct
                                                                                               AJP               Delivery Servlet


                    Apache Web Server

                                                                 AJP Module




                                                                                                                                              Shared Memory




                                                                                                                                                                              Cache Connect
                                                                                                                                                              Cache Groups
             HTTP
                                                                                                               Background Process
                                                                                                                                     Direct




                                                                       Custom Apache C Module                                        Direct




                                                                                                                                                                              Exposes
                                Low Volume Server
                                         App Srv. Services
                                             Application Logic


                                                                              Business Logic
                          Presentation




                                                                                                 Data Access




             HTTP                                                                                                             JDBC




                                                                                                                                                                             RAC


                                                                                                                                                                                              23
Combination – Data Flows

                                                                                      High Volume Data Collection Node

                                                                                                                 Java EE                  TimesTen/IMDB
                                                                                                                                 Direct
                                                                                           AJP               Delivery Servlet
                Apache Web Server

                                                             AJP Module




                                                                                                                                          Shared Memory




                                                                                                                                                                          Cache Connect
                                                                                                                                                          Cache Groups
         HTTP
                                                                                                           Background Process
                                                                                                                                 Direct




                                                                   Custom Apache C Module                                        Direct




                                                                                                                                                                          Exposes
                            Low Volume Server
                                     App Srv. Services
                                         Application Logic


                                                                          Business Logic
                      Presentation




                                                                                             Data Access




         HTTP                                                                                                             JDBC




                                                                                                                                                                         RAC


                                                                                                                                                                                          24
 Combination – Full Picture
Delivery/Data Collection Node                                              Operational RAC Instance



          Delivery Servlet
                                               Delivery Required
                                                                                     Operational DB
                                                  Data (R/O)
                                                                           Re
                                                                                ad




                                                                   e
                                                                                                       Feedback Script




                                                                   Us
        Data Collection Module
                                                Raw Data Coll.
                                               (Local TimesTen)         Record



                                                                                     Aggregated Data             ETL Scripts

           Background Processor
                                               Aggregated Data
                                                   (SWT)
                                                                           DW RAC Instance



Colors: Apache         J2EE      TimesTen   Oracle
                                                                                     Staging Tables


                                                                                                           ETL Scripts



                                                                                       DW Schema
                                                                                      (Dimensional)


                                                                                                                               25
Questions?



Questions about Architecture?




                                 26
Other Issues: Connection Management


                                         Dial-Up




                             DSL
               `

                                                                                                                                          HV Delivery Node
                                                                                                                                                Java EE App Server                    TimesTen/IMDB




                                                                                                                Apache Web Server




                                                                                                                                                                  TimesTen
                                                                                                                                                 Servlet




                                                                                                                                                                    Driver
                                                                                                                                                           JDBC
                                                                                                                                    AJP




                                                                                                                                                                                      Shared Memory




                                                                                                                                                                                                                     Cache Connect
                                                                                                                                                                                                      Cache Groups
                                                                                                                                          AJP                                Direct




                                                                                             GigaBit Ethernet
                                                            F5 LTM 3400
                                                                                                                                      Custom Apache C Module                 Direct




                                                                          (Layer 7 Switch)
                     Cable


                                                Internet
                                                                                                                                           HV Delivery Node

                   WAP                                                                                                                     HV Delivery Node

                                                                                                                                           HV Delivery Node

                                                                                                                                           HV Delivery Node



                         SSL – Direct Backbone Connection




       Publisher Web Server




                                                                                                                                                                                                                                     27
Other Issues: Hardware



Low Volume – Standard Hardware
RAC Instance – Standard Hardware
High Volume – Not Standard
      – CPU Intensive
      – Memory Hogs
      – Saturates Network I/O
      – Odd Disk Usage (Sequential Writes)
TimesTen Group great at helping find write hardware!

                                                        28
Questions?



Questions?



 Contact:
      – Bill Binko
      – Perot Systems (Tampa)
      – Bill.Binko@ps.net


                                29
A Presentation to   Oracle OpenWorld

   Blistering Web Applications with Oracle
   TimesTen In Memory Option

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:11
posted:10/2/2012
language:Unknown
pages:31