New Age Transac9onal Systems Not Your Grandpa s OLTP - - PowerPoint PPT Presentation

new age transac9onal systems not your grandpa s oltp
SMART_READER_LITE
LIVE PREVIEW

New Age Transac9onal Systems Not Your Grandpa s OLTP - - PowerPoint PPT Presentation

The NewSQL database for high velocity applica9ons New Age Transac9onal Systems Not Your Grandpa s OLTP Ryan BeEs Sr. SoGware Engineer, VoltDB


slide-1
SLIDE 1

The ¡NewSQL ¡database ¡for ¡high ¡velocity ¡applica9ons ¡

New ¡Age ¡Transac9onal ¡Systems ¡– ¡
 Not ¡Your ¡Grandpa’s ¡OLTP ¡

Ryan ¡BeEs


  • Sr. ¡SoGware ¡Engineer, ¡VoltDB


rbeEs@voltdb.com ¡ ¡/ ¡@ryanbeEs ¡

slide-2
SLIDE 2

2 VoltDB 2

Who’s ¡making ¡fun ¡of ¡Grandpa’s ¡DB? ¡

We ¡got ¡your ¡back, ¡Mr. ¡

  • Codd. ¡
slide-3
SLIDE 3

3 VoltDB 3

Are ¡there ¡crystals ¡involved? ¡ New ¡age ¡OLTP ¡ NoSQL ¡ ¡ ¡ NewSQL ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡More ¡than ¡marke,ng? ¡

slide-4
SLIDE 4

4 VoltDB 4

NewSQL ¡ ¡ ¡“…shorthand ¡for ¡various ¡new ¡ scalable ¡high ¡performance ¡db ¡ vendors” ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡MaEhew ¡AsleE ¡/ ¡The ¡451 ¡group ¡ ¡ ¡ ¡ ¡April, ¡2011 ¡ ¡

hEp://blogs.the451group.com/informa9on_management/2011/04/06/what-­‑we-­‑talk-­‑ about-­‑when-­‑we-­‑talk-­‑about-­‑newsql/ ¡ ¡

slide-5
SLIDE 5

5 VoltDB 5

NewSQL ¡ ¡ ¡ ¡ ¡ “…rela,onal ¡seman,cs ¡with ¡NoSQL ¡ scalability” ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Me ¡ ¡ ¡ ¡ ¡November ¡16th. ¡ ¡ ¡ ¡

R

slide-6
SLIDE 6

6 VoltDB 6

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Rela,onal ¡ ¡ ACID ¡ Transac9ons ¡ SQL ¡ Schema ¡ ¡NoSQL ¡ ¡ Cloud ¡deployable ¡ Distributed ¡data ¡ Scale-­‑out ¡ Low ¡cost ¡profile ¡

slide-7
SLIDE 7

7 VoltDB 7

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ NewSQL ¡v. ¡Legacy ¡RDBMS ¡ ¡ ¡Tradeoffs ¡differ ¡by ¡vendor ¡

slide-8
SLIDE 8

8 VoltDB 8

  • Analysts. ¡Me. ¡Whoever. ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ Maybe ¡famous ¡academics ¡have ¡more ¡ credibility? ¡

slide-9
SLIDE 9

9 VoltDB 9

¡SIGMOD ¡2008 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ OLTP ¡Through ¡the ¡Looking ¡Glass, ¡and ¡ What ¡We ¡Found ¡There ¡ ¡ ¡ ¡ ¡

¡ ¡Stavros ¡Harizopoulos ¡ ¡ ¡ ¡ ¡ ¡ ¡Daniel ¡J. ¡Abadi ¡ ¡ ¡Samuel ¡Madden ¡ ¡ ¡ ¡Michael ¡Stonebraker ¡ ¡

h"p://nms.csail.mit.edu/~stavros/pubs/OLTP_sigmod08.pdf ¡ ¡

slide-10
SLIDE 10

10 VoltDB 10

Brilliant! ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

Computers ¡are ¡different ¡from ¡1970’s ¡ ¡-­‑ ¡Cheaper ¡ ¡-­‑ ¡Lots ¡of ¡main ¡memory ¡ ¡-­‑ ¡Mul9-­‑core ¡ ¡ Applica9ons ¡are ¡different ¡from ¡1970’s ¡ ¡-­‑ ¡Web ¡and ¡middleware: ¡not ¡data ¡entry ¡ ¡-­‑ ¡Latency ¡sensi9ve ¡“real ¡9me” ¡apps. ¡ ¡

slide-11
SLIDE 11

11 VoltDB 11

Overhead ¡in ¡the ¡Shore ¡DB ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

Legacy ¡overhead ¡ ¡ Btrees ¡ Logging ¡ Locking ¡ Latching ¡ Buffer ¡Cache ¡ ¡

slide-12
SLIDE 12

12 VoltDB 12

TPC-­‑C ¡NewOrder ¡and ¡Payment ¡ ¡ ¡ ¡ ¡

Full ¡overhead ¡(in ¡memory, ¡no ¡log ¡fsync): ¡ ¡ 1,700 ¡TPS. ¡ ¡ Op9mal ¡(measured ¡via ¡prototype): ¡ ¡ 46,500 ¡TPS. ¡ ¡ ¡

¡ ¡ ¡ ¡ ¡ ¡VoltDB: ¡1M ¡SQL ¡statements ¡/ ¡sec. ¡ ¡ ¡ ¡ ¡ ¡ ¡50k-­‑180k ¡TPS ¡per ¡node ¡on ¡current ¡hardware ¡

slide-13
SLIDE 13

13 VoltDB 13

Are ¡these ¡kids ¡on ¡to ¡something? ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

Many ¡alterna,ve ¡architectures ¡ ¡ Memory ¡resident ¡databases ¡ Clustered ¡databases ¡ Log-­‑less ¡databases ¡ Single ¡threaded ¡databases ¡ Transac9on-­‑less ¡databases ¡ Eventually ¡consistent ¡systems ¡ ¡

slide-14
SLIDE 14

14 VoltDB 14

  • Analysts. ¡Me. ¡Academics. ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

¡ What’s ¡the ¡rest ¡of ¡world ¡have ¡to ¡say ¡about ¡ NewSQL ¡and ¡New ¡age ¡OLTP? ¡ ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Why? ¡

slide-15
SLIDE 15

15 VoltDB 15

  • Why. ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

¡ Contemporary ¡workloads ¡exceed ¡the ¡ capability ¡of ¡legacy ¡database ¡architectures ¡

slide-16
SLIDE 16

16 VoltDB 16

Do ¡you ¡have ¡this ¡problem? ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

¡ You ¡have ¡a ¡few ¡choices. ¡

slide-17
SLIDE 17

17 VoltDB 17

Do ¡you ¡have ¡this ¡problem? ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

Choice ¡#1 ¡ ¡ ¡ ¡ Ignore ¡it. ¡Maybe ¡it ¡just ¡isn’t ¡that ¡important. ¡

slide-18
SLIDE 18

18 VoltDB 18

Do ¡you ¡have ¡this ¡problem? ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

Choice ¡#2 ¡ ¡ ¡ ¡ Shard ¡a ¡legacy ¡system. ¡You ¡might ¡regret ¡ this ¡choice. ¡ ¡ ¡ ¡Manage ¡your ¡own ¡sharding. ¡ ¡ ¡Your ¡own ¡transac9ons. ¡ ¡ ¡Opera9onal ¡overhead ¡many ¡nodes. ¡ ¡ ¡Poor ¡per-­‑node ¡performance. ¡ ¡ ¡

slide-19
SLIDE 19

19 VoltDB 19

Do ¡you ¡have ¡this ¡problem? ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

Choice ¡#3 ¡ ¡ ¡ ¡ NoSQL: ¡Free ¡coffee ¡cups, ¡laptop ¡s9ckers ¡ AND ¡it ¡shards ¡for ¡me! ¡ ¡ ¡

slide-20
SLIDE 20

20 VoltDB 20

Do ¡you ¡have ¡this ¡problem? ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

Choice ¡#4 ¡ ¡ ¡ ¡ NewSQL: ¡I ¡like ¡new ¡things. ¡Sign ¡me ¡up. ¡ ¡

slide-21
SLIDE 21

21 VoltDB 21

Do ¡you ¡have ¡this ¡problem? ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

¡ ¡ NewSQL ¡vs. ¡NoSQL: ¡ ¡what ¡are ¡the ¡ important ¡decision ¡factors. ¡

slide-22
SLIDE 22

22 VoltDB 22

NoSQL ¡strengths ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

Raw ¡availability ¡vs. ¡consistency ¡and ¡(ACID) ¡

  • durability. ¡

¡ Journal ¡oriented ¡or ¡commuta9ve ¡writes. ¡ ¡ Schema ¡flexibility ¡(con9nuously ¡deployed ¡ web ¡apps?) ¡ ¡

slide-23
SLIDE 23

23 VoltDB 23

NewSQL ¡strengths ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

ACID ¡seman9cs. ¡ ¡ ¡ Especially ¡mul9-­‑key ¡ACID. ¡ ¡ Transac9ons ¡are ¡necessary. ¡ ¡ Rich ¡queries. ¡Non-­‑trivial ¡atomic ¡opera9ons. ¡ ¡ ¡ ¡

slide-24
SLIDE 24

24 VoltDB 24

Note ¡the ¡commonali9es ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

Cloud ¡friendly. ¡ ¡ Scale-­‑out. ¡Horizontal ¡scaling. ¡ ¡ Low ¡cost ¡profile. ¡ ¡ ¡ ¡

slide-25
SLIDE 25

25 VoltDB 25

New ¡age ¡OLTP ¡use ¡cases ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

¡ ¡ Example ¡workloads ¡that ¡favor ¡the ¡NewSQL ¡ side ¡of ¡this ¡decision ¡matrix ¡ ¡

slide-26
SLIDE 26

26 VoltDB 26

Use ¡case: ¡Online ¡Gaming ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

Game ¡state ¡tracking ¡is ¡oGen ¡transac9onal. ¡ ¡ State ¡must ¡be ¡durable: ¡what ¡was ¡observed ¡ as ¡done ¡must ¡stay ¡done. ¡ ¡ “Sharding ¡games ¡detracts ¡from ¡the ¡ universality ¡and ¡player ¡experience.” ¡

slide-27
SLIDE 27

27 VoltDB 27

Use ¡case: ¡Adver9sing ¡Tech ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

Near ¡real ¡9me ¡(not ¡batched) ¡A/B ¡tes9ng: ¡ ¡ ¡Stream ¡of ¡campaign ¡interac9ons ¡(clicks). ¡ ¡ ¡Aggregated ¡mul9-­‑key ¡reads ¡of ¡results. ¡ ¡ ¡Real ¡9me ¡feedback ¡in ¡to ¡ad ¡composi9on. ¡ ¡ Ad ¡display ¡decision ¡making: ¡ ¡ ¡ ¡Input ¡demographics ¡& ¡run ¡business ¡logic. ¡ ¡ ¡ ¡Record ¡choices. ¡ ¡

slide-28
SLIDE 28

28 VoltDB 28

Use ¡case: ¡Financial ¡Trade ¡Apps ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

¡ Process ¡100k ¡to ¡1M+ ¡inputs ¡per ¡second: ¡ ¡ ¡ ¡Calculate ¡outstanding ¡posi9ons/risk. ¡ ¡ ¡ ¡Measure ¡poruolio ¡compliance ¡(alert). ¡ ¡ ¡ ¡Measure ¡performance ¡by ¡sub-­‑groups ¡ (report). ¡ ¡ ¡

slide-29
SLIDE 29

29 VoltDB 29

Real ¡9me ¡web ¡apps ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

¡ Durable ¡session ¡caches. ¡ ¡ ¡ Reduce ¡latency ¡of ¡feedback ¡to ¡web-­‑9er. ¡ Web ¡-­‑> ¡log ¡-­‑> ¡OLTP ¡analy9cs ¡-­‑> ¡Web ¡ ¡ ¡ ¡

slide-30
SLIDE 30

30 VoltDB 30

Telco ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

¡ Near ¡real ¡9me ¡account ¡status. ¡ ¡ ¡ ¡Prepaid ¡account ¡aler9ng. ¡ ¡ ¡ ¡Roaming ¡/ ¡data ¡plan ¡aler9ng. ¡ ¡ ¡ ¡Real ¡9me ¡account ¡balance ¡inquiries. ¡ ¡ ¡ ¡ ¡

slide-31
SLIDE 31

31 VoltDB 31

Network ¡monitoring ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

¡ Endpoint ¡monitoring ¡for ¡aEack ¡profiles. ¡ Monitoring ¡traffic ¡flows. ¡ Opera9onal ¡dashboarding. ¡

slide-32
SLIDE 32

32 VoltDB 32

Sensor ¡readings ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

¡ De-­‑dupe ¡mul9ple ¡readings. ¡

  • Filter. ¡

Alert ¡on ¡loca9on. ¡ Cross ¡sensor ¡aggregates. ¡

  • Leaderboarding. ¡
slide-33
SLIDE 33

33

VoltDB 33

Lower-frequency

  • perations

High-frequency

  • perations

Data
 Source

Applica9on ¡Use ¡Cases ¡

Capital ¡markets ¡ Write/index ¡all ¡trades, ¡ ¡ store ¡9ck ¡data ¡ Show ¡consolidated ¡risk ¡ across ¡traders ¡ Call ¡ini9a9on ¡request ¡ Real-­‑9me ¡authoriza9on ¡ Fraud ¡detec9on/analysis ¡ Inbound ¡HTTP ¡ requests ¡ Visitor ¡logging, ¡analysis, ¡ aler9ng ¡ Traffic ¡paEern ¡analy9cs ¡ Online ¡game ¡play ¡ Rank ¡scores: ¡

  • Defined ¡intervals ¡
  • Player ¡“bests” ¡

Leaderboard ¡lookups ¡ Real-­‑9me ¡ad ¡ ¡ trading ¡systems ¡ Match ¡form ¡factor, ¡ placement ¡criteria, ¡bid/ask ¡ Report ¡ad ¡performance ¡ from ¡exhaust ¡stream ¡ Mobile ¡device ¡ ¡ loca9on ¡sensor ¡ Loca9on ¡updates, ¡QoS, ¡ transac9ons ¡ Analy9cs ¡on ¡transac9ons ¡

slide-34
SLIDE 34

34 VoltDB 34 8

VoltDB 8

A ¡picture ¡is ¡worth ¡a ¡thousand ¡bullets… ¡

slide-35
SLIDE 35

35 VoltDB 35 6

VoltDB 6

The ¡Giant ¡
 Scoreboard ¡in ¡the ¡Sky ¡

slide-36
SLIDE 36

36 VoltDB 36

VoltDB 27

Coun9ng ¡is ¡Hard: ¡American ¡Idol ¡Edi9on ¡

N ¡contestants ¡on ¡some ¡reality ¡talent ¡show ¡ Vote ¡over ¡the ¡phone ¡and ¡count ¡votes ¡per ¡contestant ¡

§ Op9on ¡1: ¡Accept ¡that ¡you’re ¡not ¡going ¡to ¡be ¡perfectly ¡accurate, ¡ and ¡that ¡it ¡might ¡be ¡difficult ¡to ¡bound ¡how ¡not ¡accurate. ¡ ¡ § Op9on ¡2: ¡Buffer ¡batches ¡of ¡votes ¡for ¡a ¡while ¡to ¡amor9ze ¡the ¡ cost ¡of ¡using ¡external ¡locks. ¡The ¡real-­‑9me ¡count ¡for ¡a ¡ contestant ¡is ¡a ¡count(*) ¡on ¡live ¡buffers ¡plus ¡the ¡roll ¡up ¡of ¡prev. ¡

  • buffers. ¡

§ Op9on ¡3: ¡Support ¡isolated, ¡atomic ¡read-­‑then-­‑update ¡for ¡fault-­‑ tolerant ¡counters ¡(at ¡very ¡high ¡throughput). ¡

slide-37
SLIDE 37

37 VoltDB 37

VoltDB 29

Coun9ng ¡is ¡Hard: ¡Requirements ¡change ¡

BEGIN ¡(PHONE, ¡CONTESTANT) ¡ ¡

Check ¡how ¡many ¡votes ¡a ¡phone ¡number ¡has. ¡ If ¡too ¡many, ¡return. ¡ Otherwise ¡atomically ¡increment ¡the ¡votes ¡for ¡the ¡phone ¡ ¡ ¡ ¡ ¡ number ¡and ¡for ¡the ¡contestant. ¡

COMMIT ¡ N ¡contestants ¡on ¡some ¡reality ¡talent ¡show ¡ Vote ¡over ¡the ¡phone ¡and ¡count ¡votes ¡per ¡contestant ¡ Limit ¡voters ¡to ¡X ¡number ¡of ¡votes ¡

slide-38
SLIDE 38

38 VoltDB 38

VoltDB 30

… ¡a ¡lot ¡

§ N ¡contestants ¡on ¡some ¡reality ¡talent ¡show. ¡ § Vote ¡over ¡the ¡phone ¡and ¡count ¡votes ¡per ¡contestant. ¡ § Limit ¡voters ¡to ¡X ¡number ¡of ¡votes. ¡ § Allow ¡voters ¡who’ve ¡signed ¡up ¡for ¡the ¡email ¡list ¡to ¡vote ¡ twice ¡as ¡many ¡9mes. ¡ § Don’t ¡allow ¡voters ¡to ¡vote ¡twice ¡in ¡the ¡same ¡minute. ¡ § Send ¡voters ¡an ¡SMS ¡text ¡message ¡aGer ¡their ¡3rd ¡vote. ¡ ¡ DON’T ¡SEND ¡TWO. ¡ § Provide ¡a ¡live ¡dashboard ¡of ¡contestant ¡scores ¡by ¡geo. ¡ § Record ¡votes ¡past ¡the ¡limits, ¡but ¡don’t ¡count ¡them. ¡

slide-39
SLIDE 39

39 VoltDB 39

VoltDB 30

User ¡feedback ¡

¡ ¡

What ¡do ¡you ¡hear ¡when ¡the ¡right ¡problem ¡ is ¡paired ¡to ¡the ¡right ¡tool? ¡

slide-40
SLIDE 40

40 VoltDB 40

VoltDB 30

User ¡feedback ¡

¡

If ¡you ¡need ¡transac9ons, ¡building ¡them ¡ yourself ¡is ¡painful. ¡ ¡ Using ¡a ¡system ¡with ¡transac9ons ¡will ¡cut ¡ development ¡9me ¡and ¡increase ¡

  • correctness. ¡
slide-41
SLIDE 41

41 VoltDB 41

VoltDB 30

User ¡feedback ¡

¡

Per-­‑Node ¡performance ¡maEers. ¡ ¡ Can ¡support ¡naïve ¡solu9ons. ¡ ¡ ¡

MySQL ¡ ¡+ ¡memcached ¡+ ¡tuning ¡+ ¡SSD ¡+ ¡ cleverness ¡gets ¡you ¡a ¡lot. ¡But ¡a ¡NewSQL ¡system ¡ might ¡be ¡nearly ¡idle ¡on ¡the ¡same ¡workload. ¡

slide-42
SLIDE 42

42 VoltDB 42

VoltDB 30

User ¡feedback ¡

¡

Per-­‑Node ¡performance ¡maEers. ¡ ¡ Enables ¡cloud ¡deployment. ¡More ¡ predictable ¡I/O. ¡Reduces ¡cloud ¡leasing ¡

  • costs. ¡ ¡

¡ Enables ¡you ¡to ¡balance ¡scaling ¡up ¡vs. ¡out. ¡

slide-43
SLIDE 43

43 VoltDB 43

VoltDB 30

NewSQL ¡product ¡similari9es? ¡ Techniques ¡differ ¡widely. ¡ ¡From ¡single ¡ threaded ¡+ ¡transac9onal ¡procedures ¡to ¡ MVCC ¡to ¡alternate ¡MySQL ¡storage ¡engines. ¡ ¡

Common: ¡(1) ¡SQL ¡as ¡query ¡language. ¡(2) ¡ACID ¡

  • transac9ons. ¡(3) ¡Non-­‑blocking ¡concurrency ¡control. ¡(4) ¡

per-­‑node ¡performance ¡(5) ¡horizontal ¡scale-­‑out. ¡

¡

slide-44
SLIDE 44

44 VoltDB 44

VoltDB 30

Conclusions ¡ NewSQL ¡can ¡be ¡differen9ated ¡from ¡NoSQL ¡ and ¡from ¡legacy ¡RDBMS. ¡ ¡ Some ¡workloads ¡favor ¡NewSQL: ¡ ¡ ¡ ¡-­‑ ¡Rich ¡query-­‑ability ¡ ¡ ¡ ¡-­‑ ¡ACID ¡transac9ons ¡ ¡ ¡ ¡-­‑ ¡High ¡velocity ¡inputs ¡ ¡ ¡ ¡-­‑ ¡Mul9-­‑key ¡aggrega9on ¡ ¡

slide-45
SLIDE 45

Ques9ons ¡& ¡Answers ¡ Thanks! ¡ ¡ ¡

rbeEs@voltdb.com ¡/ ¡@ryanbeEs ¡