OldSQL vs. NoSQL vs. NewSQL on New OLTP Michael - - PowerPoint PPT Presentation

oldsql vs nosql vs newsql on new oltp
SMART_READER_LITE
LIVE PREVIEW

OldSQL vs. NoSQL vs. NewSQL on New OLTP Michael - - PowerPoint PPT Presentation

the NewSQL database youll never outgrow OldSQL vs. NoSQL vs. NewSQL on New OLTP Michael Stonebraker, CTO VoltDB, Inc. Old OLTP Remember how


slide-1
SLIDE 1

the ¡NewSQL ¡database ¡you’ll ¡never ¡outgrow ¡

OldSQL ¡vs. ¡NoSQL ¡vs. ¡NewSQL ¡

  • n ¡New ¡OLTP

¡

Michael ¡Stonebraker, ¡CTO ¡ VoltDB, ¡Inc. ¡

slide-2
SLIDE 2

VoltDB 2

Old ¡OLTP ¡

  • Remember ¡how ¡we ¡used ¡to ¡buy ¡airplane ¡Hckets ¡in ¡the ¡

1980s ¡

+ By ¡telephone ¡ + Through ¡an ¡intermediary ¡(professional ¡terminal ¡operator) ¡

  • Commerce ¡at ¡the ¡speed ¡of ¡the ¡intermediary ¡
  • In ¡1985, ¡1,000 ¡transacHons ¡per ¡second ¡was ¡considered ¡

an ¡incredible ¡stretch ¡goal!!!! ¡

+ HPTS ¡(1985) ¡ ¡ ¡

slide-3
SLIDE 3

VoltDB 3

How ¡has ¡OLTP ¡Changed ¡in ¡25 ¡Years? ¡

The ¡internet ¡

+ Client ¡is ¡no ¡longer ¡a ¡professional ¡terminal ¡operator ¡ + Instead ¡Aunt ¡Martha ¡is ¡using ¡the ¡web ¡herself ¡ + Sends ¡volume ¡through ¡the ¡roof ¡

slide-4
SLIDE 4

VoltDB 4

How ¡has ¡OLTP ¡Changed ¡in ¡25 ¡Years? ¡

PDAs ¡and ¡sensors ¡

+ Your ¡cell ¡phone ¡is ¡a ¡transacHon ¡originator ¡ + Everything ¡is ¡being ¡geo-­‑posiHoned ¡by ¡sensors ¡(marathon ¡ runners, ¡your ¡car, ¡….) ¡ + Sends ¡volume ¡through ¡the ¡roof ¡

slide-5
SLIDE 5

VoltDB 5

How ¡has ¡OLTP ¡Changed ¡in ¡25 ¡Years? ¡

The ¡definiHons ¡

+ “Online” ¡no ¡longer ¡exclusively ¡means ¡a ¡human ¡operator ¡

— The ¡oncoming ¡data ¡ ¡tsunami ¡is ¡o_en ¡device ¡and ¡system-­‑generated ¡

+ “TransacHon” ¡now ¡transcends ¡the ¡tradiHonal ¡business ¡ transacHon ¡

— High-­‑throughput ¡ACID ¡write ¡operaHons ¡are ¡a ¡new ¡requirement ¡

+ “HA” ¡and ¡“durability” ¡are ¡now ¡core ¡database ¡requirements ¡

slide-6
SLIDE 6

VoltDB 6

Examples ¡

Maintain ¡the ¡state ¡of ¡mulH-­‑player ¡internet ¡games ¡ Real ¡Hme ¡ad ¡placement ¡ Fraud/intrusion ¡detecHon ¡ Risk ¡management ¡on ¡Wall ¡Street ¡

slide-7
SLIDE 7

VoltDB 7

7

VoltDB 7

New ¡OLTP ¡Challenges ¡

New ¡OLTP ¡and ¡You ¡

You ¡need ¡to ¡ingest ¡the ¡firehose ¡in ¡real ¡ Hme ¡ You ¡need ¡to ¡ ¡process, ¡validate, ¡enrich ¡ ¡ and ¡respond ¡in ¡real-­‑Hme ¡ You ¡o_en ¡need ¡real-­‑Hme ¡analyHcs ¡

slide-8
SLIDE 8

VoltDB 8

SoluHon ¡Choices ¡

  • OldSQL ¡

+ Legacy ¡RDBMS ¡vendors ¡

  • NoSQL ¡

+ Give ¡up ¡SQL ¡and ¡ACID ¡for ¡performance ¡

  • NewSQL ¡

+ Preserve ¡SQL ¡and ¡ACID ¡ + Get ¡performance ¡from ¡a ¡new ¡architecture ¡

slide-9
SLIDE 9

VoltDB 9

OldSQL ¡

TradiHonal ¡SQL ¡vendors ¡(the ¡“elephants”) ¡

+ Code ¡lines ¡daHng ¡from ¡the ¡1980’s ¡ ¡ + “bloatware” ¡ + Not ¡very ¡good ¡at ¡anything ¡

— Can ¡be ¡beaten ¡by ¡at ¡least ¡an ¡order ¡of ¡magnitude ¡in ¡every ¡verHcal ¡ market ¡I ¡know ¡of ¡

+ Mediocre ¡performance ¡on ¡New ¡OLTP ¡

— At ¡low ¡velocity ¡it ¡doesn’t ¡maeer ¡ — Otherwise ¡you ¡get ¡to ¡tear ¡your ¡hair ¡out ¡

slide-10
SLIDE 10

VoltDB 10

OLTP Data Warehouse Other apps DBMS apps

DBMS ¡Landscape ¡

slide-11
SLIDE 11

VoltDB 11

DBMS ¡Landscape ¡– ¡Performance ¡Needs ¡

OLTP Data Warehouse Other apps low high high high

slide-12
SLIDE 12

VoltDB 12

One ¡Size ¡Does ¡Not ¡Fit ¡All ¡-­‑-­‑ ¡Pictorially ¡

Open source Column stores Hadoop Low-overhead Main memory DBs NoSQL Array DBMSs

Elephants only get “the crevices”

slide-13
SLIDE 13

VoltDB 13

Reality ¡Check ¡

  • TPC-­‑C ¡CPU ¡cycles ¡
  • On ¡the ¡Shore ¡DBMS ¡prototype ¡
  • Elephants ¡should ¡be ¡similar ¡
slide-14
SLIDE 14

VoltDB 14

The ¡Elephants ¡ ¡

  • Are ¡slow ¡because ¡they ¡spend ¡all ¡of ¡their ¡Hme ¡on ¡
  • verhead!!! ¡

+ Not ¡on ¡useful ¡work ¡

  • Would ¡have ¡to ¡re-­‑architect ¡their ¡legacy ¡code ¡to ¡do ¡

beeer ¡

slide-15
SLIDE 15

VoltDB 15

To ¡Go ¡a ¡Lot ¡Faster ¡You ¡Have ¡to…… ¡

  • Focus ¡on ¡overhead ¡

+ Beeer ¡B-­‑trees ¡affects ¡only ¡4% ¡of ¡the ¡path ¡length ¡

  • Get ¡rid ¡of ¡ALL ¡major ¡sources ¡of ¡overhead ¡

+ Main ¡memory ¡deployment ¡– ¡gets ¡rid ¡of ¡buffer ¡pool ¡

— Leaving ¡other ¡75% ¡of ¡overhead ¡intact ¡ — i.e. ¡win ¡is ¡25% ¡

slide-16
SLIDE 16

VoltDB 16

Long ¡Term ¡Elephant ¡Outlook ¡

  • Up ¡against ¡“The ¡Innovators ¡Dilemma” ¡

+ Steam ¡shovel ¡example ¡ + Disk ¡drive ¡example ¡ + See ¡the ¡book ¡by ¡Clayton ¡Christenson ¡for ¡more ¡details ¡

  • Long ¡term ¡dri_ ¡into ¡the ¡sunset ¡ ¡

+ The ¡most ¡likely ¡scenario ¡ + Unless ¡they ¡can ¡solve ¡the ¡dilemma ¡

slide-17
SLIDE 17

VoltDB 17

NoSQL ¡

  • Give ¡up ¡SQL ¡
  • Give ¡up ¡ACID ¡
slide-18
SLIDE 18

VoltDB 18

Give ¡Up ¡SQL? ¡

  • Compiler ¡translates ¡SQL ¡at ¡compile ¡Hme ¡into ¡a ¡

sequence ¡of ¡low ¡level ¡operaHons ¡ ¡

  • Similar ¡to ¡what ¡the ¡NoSQL ¡products ¡make ¡you ¡

program ¡in ¡your ¡applicaHon ¡

  • 30 ¡years ¡of ¡RDBMS ¡experience ¡

+ Hard ¡to ¡beat ¡the ¡compiler ¡ + High ¡level ¡languages ¡are ¡good ¡(data ¡independence, ¡less ¡code, ¡…) ¡ + Stored ¡procedures ¡are ¡good! ¡

— One ¡round ¡trip ¡from ¡app ¡to ¡DBMS ¡rather ¡than ¡one ¡one ¡round ¡trip ¡ per ¡record ¡ — Move ¡the ¡code ¡to ¡the ¡data, ¡not ¡the ¡other ¡way ¡around ¡

slide-19
SLIDE 19

VoltDB 19

Give ¡Up ¡ACID ¡

  • If ¡you ¡need ¡data ¡accuracy, ¡giving ¡up ¡

ACID ¡is ¡a ¡decision ¡to ¡tear ¡your ¡hair ¡

  • ut ¡by ¡doing ¡database ¡“heavy ¡

li_ing” ¡in ¡user ¡code ¡

  • Can ¡you ¡guarantee ¡you ¡won’t ¡need ¡

ACID ¡tomorrow? ¡

ACID = goodness, in spite of what these guys say

slide-20
SLIDE 20

VoltDB 20

Who ¡Needs ¡ACID? ¡

  • Funds ¡transfer ¡

+ Or ¡anybody ¡moving ¡something ¡from ¡X ¡to ¡Y ¡

  • Anybody ¡with ¡integrity ¡constraints ¡

+ Back ¡out ¡if ¡fails ¡ + Anybody ¡for ¡whom ¡“usually ¡ships ¡in ¡24 ¡hours” ¡is ¡not ¡an ¡ acceptable ¡outcome ¡

  • Anybody ¡with ¡a ¡mulH-­‑record ¡state ¡

+ E.g. ¡move ¡and ¡shoot ¡

slide-21
SLIDE 21

VoltDB 21

Who ¡needs ¡ACID ¡in ¡replicaHon ¡

  • Anybody ¡with ¡non-­‑commutaHve ¡updates ¡

+ For ¡example, ¡+ ¡and ¡* ¡don’t ¡commute ¡

  • Anybody ¡with ¡integrity ¡constraints ¡

+ Can’t ¡sell ¡the ¡last ¡item ¡twice…. ¡

  • Eventual ¡consistency ¡means ¡“creates ¡garbage” ¡
slide-22
SLIDE 22

VoltDB 22

NoSQL ¡Summary ¡

  • Appropriate ¡for ¡non-­‑transacHonal ¡systems ¡
  • Appropriate ¡for ¡single ¡record ¡transacHons ¡that ¡are ¡

commutaHve ¡

  • Not ¡a ¡good ¡fit ¡for ¡New ¡OLTP ¡
  • Use ¡the ¡right ¡tool ¡for ¡the ¡job ¡

Two ¡recently-­‑proposed ¡NoSQL ¡ language ¡standards ¡– ¡CQL ¡and ¡ UnQL ¡– ¡are ¡amazingly ¡similar ¡to ¡ (you ¡guessed ¡it!) ¡SQL ¡ ¡

Interes5ng ¡… ¡

slide-23
SLIDE 23

VoltDB 23

NewSQL ¡

  • SQL ¡
  • ACID ¡
  • Performance ¡and ¡scalability ¡through ¡modern ¡

innovaHve ¡so_ware ¡architecture ¡

slide-24
SLIDE 24

VoltDB 24

NewSQL ¡

  • Needs ¡something ¡other ¡than ¡tradiHonal ¡record ¡level ¡

locking ¡(1st ¡big ¡source ¡of ¡overhead) ¡ ¡

+ Hmestamp ¡order ¡ + MVCC ¡ + Your ¡good ¡idea ¡goes ¡here ¡

slide-25
SLIDE 25

VoltDB 25

NewSQL ¡

  • Needs ¡a ¡soluHon ¡to ¡buffer ¡pool ¡overhead ¡(2nd ¡big ¡

source ¡of ¡overhead) ¡

+ Main ¡memory ¡(at ¡least ¡for ¡data ¡that ¡is ¡not ¡cold) ¡ + Some ¡other ¡way ¡to ¡reduce ¡buffer ¡pool ¡cost ¡

slide-26
SLIDE 26

VoltDB 26

NewSQL ¡

  • Needs ¡a ¡soluHon ¡to ¡latching ¡for ¡shared ¡data ¡structures ¡

(3rd ¡big ¡source ¡of ¡overhead) ¡

+ Some ¡innovaHve ¡use ¡of ¡B-­‑trees ¡ + Single-­‑threading ¡ + Your ¡good ¡idea ¡goes ¡here ¡

slide-27
SLIDE 27

VoltDB 27

NewSQL ¡

  • Needs ¡a ¡soluHon ¡to ¡write-­‑ahead ¡logging ¡(4th ¡big ¡

source ¡of ¡overhead) ¡

+ Obvious ¡answer ¡is ¡built-­‑in ¡replicaHon ¡and ¡failover ¡ ¡ + New ¡OLTP ¡views ¡this ¡as ¡a ¡requirement ¡anyway ¡

  • Some ¡details ¡

+ On-­‑line ¡failover? ¡ + On-­‑line ¡failback? ¡ + LAN ¡network ¡parHHoning? ¡ + WAN ¡network ¡parHHoning? ¡

slide-28
SLIDE 28

VoltDB 28

¡A ¡NewSQL ¡Example ¡– ¡VoltDB ¡ ¡

  • Main-­‑memory ¡storage ¡
  • Single ¡threaded, ¡run ¡Xacts ¡to ¡compleHon ¡

+ No ¡locking ¡ + No ¡latching ¡

  • Built-­‑in ¡HA ¡and ¡durability ¡

+ No ¡log ¡(in ¡the ¡tradiHonal ¡sense) ¡

slide-29
SLIDE 29

VoltDB 29

Yabut: ¡ ¡What ¡About ¡MulHcore? ¡

  • For ¡A ¡K-­‑core ¡CPU, ¡divide ¡memory ¡into ¡K ¡(non ¡
  • verlapping) ¡buckets ¡
  • i.e. ¡convert ¡mulH-­‑core ¡to ¡K ¡single ¡cores ¡
slide-30
SLIDE 30

VoltDB 30

Where ¡all ¡the ¡Hme ¡goes… ¡revisited ¡

Before VoltDB

slide-31
SLIDE 31

VoltDB 31

  • Runs ¡a ¡subset ¡of ¡SQL ¡(which ¡is ¡getng ¡larger) ¡
  • On ¡VoltDB ¡clusters ¡(in ¡memory ¡on ¡commodity ¡gear) ¡
  • No ¡WAN ¡support ¡yet ¡ ¡

+ Working ¡on ¡it ¡right ¡now ¡

  • 50X ¡a ¡popular ¡OldSQL ¡DBMS ¡on ¡TPC-­‑C ¡
  • 5-­‑7X ¡Cassandra ¡on ¡VoltDB ¡K-­‑V ¡layer ¡
  • Scales ¡to ¡384 ¡cores ¡(biggest ¡iron ¡we ¡could ¡get ¡our ¡

hands ¡on) ¡

  • Clearly ¡note ¡this ¡is ¡an ¡open ¡source ¡system! ¡ ¡

Current ¡VoltDB ¡Status ¡

slide-32
SLIDE 32

VoltDB 32

Summary ¡

Old ¡OLTP ¡ OldSQL ¡for ¡New ¡OLTP ¡

  • Too ¡slow ¡
  • Does ¡not ¡scale ¡

NoSQL ¡for ¡New ¡OLTP ¡

  • Lacks ¡consistency ¡guarantees ¡
  • Low-­‑level ¡interface ¡

NewSQL ¡for ¡New ¡OLTP ¡

  • Fast, ¡scalable ¡and ¡consistent ¡
  • Supports ¡SQL ¡ ¡

New ¡OLTP ¡

slide-33
SLIDE 33

the ¡NewSQL ¡database ¡you’ll ¡never ¡outgrow ¡

Thank ¡You ¡