Dbim Workshop Part1 Next Big Thing

49

description

Oracle

Transcript of Dbim Workshop Part1 Next Big Thing

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Oracle Database In-Memory The Next Big Thing

    Maria Colgan Master Product Manager

    #DBIM12c

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Why is Oracle do this

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Accelerate Mixed Workload OLTP

    Real Time Analytics

    No Changes to Applications

    Trivial to Implement

    Oracle Database In-Memory Goals

    100x

    4

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    What is an analyJc query?

    Which products give us our highest

    margins?

    Who are the top 10 sales reps in the north

    west region this month?

    If I get a 20% discount on widget A, how

    much will our margins improve?

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    What is an analyJc query?

    Scans a large amount of data Selects a subset of columns from wide tables Uses lter predicates in the form of =, >,

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    What is an analyJc query? Good Example

    SALES

    CUSTOMERS

    SUPPLIERS

    PARTS TIME

    STORES

    STAR SCHEMA

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Row Format Databases vs. Column Format Databases

    Rows Stored ConJguously

    ! TransacEons run faster on row format Example: Query or Insert a sales order Fast processing few rows, many columns

    Columns Stored

    ConJguously

    !AnalyEcs run faster on column format Example : Report on sales totals by region Fast accessing few columns, many rows

    SALES

    SALES

    8

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    OLTP Example

    9

    Row

    !Query a single sales order in row format One contiguous row accessed = FAST

    Column

    !Query a sales order in Column Format Many column accessed = S L O W

    SALES

    Stores SALES

    Query

    Query Query

    Query Query

    UnEl Now Must Choose One Format and Suer Tradeos

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    What is it

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Breakthrough: Dual Format Database

    BOTH row and column formats for same table

    Simultaneously acJve and transacJonally consistent

    AnalyJcs & reporJng use new in-memory Column format

    OLTP uses proven row format

    11

    Normal Buer Cache

    New In-Memory Format

    SALES SALES

    Row Format

    Column Format

    SALES

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Now we can run Jme-sensiJve analyJcal queries directly against our OLTP database. This is something we wouldn't have dreamt of earlier.

    Arup Nanda, Enterprise Architect Starwood Hotels and Resorts

    12

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    How Does it work

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Oracle In-Memory Columnar Technology

    Pure in-memory column format Not persistent, and no logging Quick to change data: fast OLTP

    Enabled at table or parJJon Only acJve data in-memory

    2x to 20x compression typical

    Available on all hardware plaiorms

    14

    SALES

    Pure In-Memory Columnar

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Early User - Schneider Electric

    Global Specialist in Energy Management

    25 billion revenue 160,000+ employees in 100+ countries

    15

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    0

    5

    10

    15

    20

    Query Low Query High Capacity Low

    Capacity High

    Schneider General Ledger Compression Factors

    8.6x

    Schneider In-Memory Compression

    13x 16x 19x

    Over 2 billion General Ledger Entries

    900 GB on disk

    Default

    16

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Why is an In-Memory scan faster than the buer cache?

    SELECT COL4 FROM MYTABLE;

    17

    X X X X X

    RESULT

    Row Format

    Buer Cache

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Why is an In-Memory scan faster than the buer cache?

    SELECT COL4 FROM MYTABLE;

    18

    RESULT

    Column Format

    IM Column Store

    RESULT

    X X X X

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Oracle In-Memory Column Store Storage Index Each column is the made up

    of mulJple column units

    Min / max value is recorded for each column unit in a storage index

    Storage index provides parJJon pruning like performance for ALL queries

    19

    Memory

    SALES Column Format

    Min 1 Max 3

    Min 4 Max 7

    Min 8 Max 12

    Min 7 Max 15

    Example: Find all sales from stores with a store_id of 8

    ?

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Orders of Magnitude Faster AnalyJc Data Scans

    Each CPU core scans local in-memory columns

    Scans use super fast SIMD vector instructions Originally designed for

    graphics & science

    Billions of rows/sec scan rate per CPU core Row format is millions/sec

    20

    Vector Register Load

    mulJple region values

    Vector Compare all values an 1 cycle

    CPU

    Memory

    REGION

    CA

    CA CA

    CA

    Example: Find sales in region of CAlifornia

    > 100x Faster

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Joining and Combining Data Also DramaJcally Faster

    Converts joins of data in multiple tables into fast column scans

    Joins tables 10x faster

    21

    Example: Find total sales in outlet stores

    Sales Stores

    Store ID

    StoreID in 15, 38, 64

    Type=Outlet

    Type

    Sum

    Store ID

    Amou

    nt

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Generates Reports Instantly

    Dynamically creates in-memory report outline

    Then report outline lled-in during fast fact scan

    Reports run much faster Without predened cubes

    Also ooads report ltering to Exadata Storage servers

    22

    Example: Report sales of footwear in outlet stores

    Sales

    Stores

    Products In-Memory

    Report Outline

    Footwear

    Outlets $

    $$ $

    $$$

    Footwear

    Sales Outlets

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    0

    20

    40

    60

    80

    100 Seconds per Query

    Schneider Speedup Across 1545 Queries 7x to 128x faster

    Million rows returned by query 2000M 300M 30M 5M 0.5M

    Buer Cache

    IN-MEMORY

    2 billion General Ledger Entries

    1545 queries Currently take 34 hours to complete

    CombinaJon of lter queries, aggregaJons and summaJons

    23

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    0

    200

    400

    600

    800

    1000

    Schneider Speedup vs. Disk From 62x to 3259x faster

    Million rows returned 2000M 300M 30M 5M 0.5M

    Disk

    IN-MEMORY

    Seconds per Query

    24

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    How does it impact OLTP environments

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Complex OLTP is Slowed by AnalyJc Indexes

    Most Indexes in complex OLTP (e.g. ERP) databases are only used for analytic queries

    Inserting one row into a table requires updating 10-20 analytic indexes: Slow!

    Indexes only speed up predictable queries & reports

    Table

    1 3 OLTP

    Indexes

    10 20 AnalyJc Indexes

    26

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    OLTP is Slowed Down by AnalyJc Indexes

    Insert rate decreases as number of indexes

    increases

    # of Fully Cached Indexes (Disk Indexes are much slower)

    27

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Column Store Replaces AnalyJc Indexes

    Fast analytics on any columns Better for unpredictable analytics Less tuning & administration

    Column Store not persistent so update cost is much lower OLTP & batch run faster

    Table

    1 3 OLTP

    Indexes In-Memory Column Store

    28

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Schneider Update TransacJons Speedup From 5x to 9x faster

    All Indexes

    Primary Index Only

    Primary Index Plus In-Memory Columns

    Data Sales Accounts Main table has 1 Primary Key + 21 secondary indexes

    Test - 303 million transacJons Currently takes 21 hours

    29

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Schneider Storage ReducJon Over 70% reducEon in storage usage due to analyEc index removal

    0

    100

    200

    300

    400

    Objects Redo

    Size in GBs SECONDARY INDEXES

    TABLES & PK INDEXES

    30

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    How can I scale this soluJon

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Scale-Out In-Memory Database to Any Size

    Scale-Out across servers to grow memory and CPUs

    In-Memory queries parallelized across servers to access local column data

    Direct-to-wire InfiniBand protocol speeds messaging on Engineered Systems

    32

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Full support for RAC scale-out means Oracle Database In-Memory can be used on our largest Data Warehouse, enabling more near real-Jme analyJcs.

    Sudhi Vijayakumar, Senior Oracle DBA Yahoo Inc.

    33

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    In-Memory Speed + Capacity of Low Cost Disk

    DISK

    PCI FLASH

    DRAM

    Cold Data

    Hoest Data

    AcJve Data

    Size not limited by memory Data transparently accessed

    across tiers

    Each tier has specialized algorithms & compression

    Simultaneously Achieve: Speed of DRAM I/Os of Flash Cost of Disk

    34

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Scale-Up for Maximum In-Memory Performance

    M6-32

    Big Memory Machine

    32 TB DRAM

    32 Socket

    3 Terabyte/sec Bandwidth

    Scale-Up on large SMPs Algorithms NUMA optimized

    SMP scaling removes overhead of distributing queries across servers

    Memory interconnect far faster than any network

    35

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Oracle In-Memory: Industrial Strength Availability

    RAC

    ASM

    RMAN

    Data Guard & GoldenGate Pure In-Memory format does not

    change Oracles storage format, logging, backup, recovery, etc.

    All Oracles proven availability technologies work transparently

    Protection from all failures Node, site, corruption, human error,

    etc.

    36

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Oracle Database In-Memory: Unique Fault Tolerance

    Similar to storage mirroring

    Duplicate in-memory columns on another node

    Enabled per table/partition E.g. only recent data

    Application transparent

    Downtime eliminated by using duplicate after failure

    37

    Only Available on Engineered Systems

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    DownJme is extremely costly for our business. Oracles In-Memory architecture takes the right approach to balancing real-Jme speed with conJnuous availability.

    Jens-ChrisJan Pokolm Analyst IT-DB Architecture & Engineering Postbank Systems AG

    38

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    How easy is it to get started

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Oracle In-Memory: Simple to Implement

    1. Configure Memory Capacity inmemory_size = XXX GB

    2. Configure tables or partitions to be in memory alter table | partition inmemory;

    3. Later drop analytic indexes to speed up OLTP

    40

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    In terms of how easy the in-memory opJon was to use, it was actually almost boring. It just worked just turn it on, select the tables, nothing else to do.

    Mark Riman Chief Technical Ocer Riman Mead

    41

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Oracle In-Memory Requires Zero Application Changes

    Full FuncEonality - ZERO restricEons on SQL

    Easy to Implement - No migraJon of data

    Fully CompaEble - All exisJng applicaJons run unchanged

    Fully MulEtenant - Oracle In-Memory is Cloud Ready

    Uniquely Achieves All In-Memory Benets With No ApplicaEon Changes

    42

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Whats the catch

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Geng The Most From In-Memory

    Fast cars speed up travel, not meeJngs In-Memory speeds up analyJc data access, not:

    Network round trips, logon/logo Parsing, PL/SQL, complex funcJons Data processing (as opposed to access)

    Complex joins or aggregaJons where not much data is ltered before processing Load and select once Staging tables, ETL, temp tables

    Understand Where it Helps

    44

    Know your boeleneck!

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Geng The Most From In-Memory

    Avoid stop and go trac Process data in sets of rows in the Database Not one row at a Jme in the applicaJon

    Plan ahead, take shortest route Help the opJmizer help you: Gather representaJve set of staJsJcs using DBMS_STATS

    Use all your cylinders Enable parallel execuJon In-Memory removes storage bolenecks allowing more parallelism

    The Driver Maeers

    45

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    In-Memory Use Cases OLTP

    Real-Jme reporJng directly on OLTP source data

    Removes need for separate ODS Speeds data extracJon

    Data Warehouse

    Staging/ETL/Temp not a candidate Write once, read once

    All or a subset of FoundaJon Layer For Jme sensiJve analyJcs

    PotenJal to replace Access Layer

    46

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Where can I get more informaJon

  • Copyright 2014, Oracle and/or its aliates. All rights reserved. |

    Join the ConversaEon

    48

    hps://twier.com/db_inmemory

    hps://blogs.oracle.com/in-memory/

    Related White Papers Oracle Database In-Memory White Paper Oracle Database In-Memory AggregaJon Paper

    Related Database In-Memory Free Webcasts Oracle Database In-Memory meets Data Warehousing

    Related Videos In-Memory Demo Database Industry Experts Discuss Oracle Database In-Memory (11:10) Soware on Silicon

    Any AddiEonal QuesEons Oracle Database In-Memory Blog My email: [email protected]

    hps://www.facebook.com/OracleDatabase

    hp://www.oracle.com/goto/dbim.html

    AddiJonal Resources