Percona and TokuDB: Architecture, Design, and …...Peter Zaitsev, CEO, Percona Jon Tobin Sr System...
Transcript of Percona and TokuDB: Architecture, Design, and …...Peter Zaitsev, CEO, Percona Jon Tobin Sr System...
Peter Zaitsev, CEO, Percona
Jon Tobin Sr System Engineer, Tokutek
January 28, 2015
Percona Technical Webinars
Percona and TokuDB: Architecture, Design, and Practical Benefits
®
®
TokuDB – Fractal Foundations
Jon Tobin – Lead Sales Engineer @jontobs
Linkedin.com/in/JonathanETobin
®
Company Overview
• Two high-performance database solutions for big
data
• NoSQL: TokuMX™ for MongoDB
• SQL: TokuDB®
for MySQL, Percona & MariaDB
• Radical new storage for larger-than-RAM datasets
• Fractal Tree® indexing technology
• Data science research at M.I.T., Rutgers, Stony
Brook
®
B-tree Overview
®
B-tree Insert
Pivot Rule >=
®
B-tree Search
®
What’s the Problem?
Performance is I/O limited when data is > RAM Each insert/update requires at least 1 I/O
plus an I/O for every extra index
®
B-tree - Importance of I/O
15 hours VS 91 hours
AWS – Load 200M Rows – Predictable I/O Response VS Not
®
Fractal Tree Indexes
®
Fractal Tree Indexes
®
Fractal – Sample Data
®
Fractal - Insert
®
Fractal – Message Injection
®
TokuDB Benefits/Features
• Transactions (ACID & MVCC)
• Compression (low overhead)
– 3 libraries (quicklz, zlib, lzma)
• Hot Schema Change
– No table copy required (add, drop, exp)
• Clustered Secondary Index
• Read Free Replication
• Efficiency
®
Summary
InnoDB TokuDB
Data Structure B-tree Fractal Tree
Transactions Yes Yes
Foreign Keys Yes No
Compression Yes* Yes
Clustered Indexes Primary Key Only Any
Hot Schema Change Yes* Yes
Strength In memory working set > Memory performance
Weakness Efficiency Point Queries*
®
Up Next
Peter will show you the practical side
Peter Zaitsev, CEO, Percona
January 28, 2015 Percona Technical Webinars
Why TokuDB ?
www.percona.com 18
Why TokuDB ?
The Practical Reasons why I like
TokuDB
www.percona.com 19
What Practical ?
Percona has been running TokuDB in demanding production for 9 months
I personally invested a lot of time looking into it
www.percona.com 20
Long History
Percona has been working with Tokutek
since 2009
www.percona.com 21
TokuDB is Solid
Percona had done extensive QA with
TokuDB and Percona Server
TokuDB Engineering Team
very smart and responsive
The only Solid Transactional
Storage Engine for MySQL besides Innodb/XtraDB
www.percona.com 22
Close to Zero Tuning
Great Performance with no tuning, out of the box
Most important settings tuned to the Hardware Scale
Tune tokudb_commit_sync to match durability needs
www.percona.com 23
Compression Done Wrong
Innodb Compression
is an Afterthought
Dramatically complicates
the code
Performance impact even
if compression
not in use
High Performance Degradation when in use
www.percona.com 24
Compression done Right
TokuDB Compression part of initial design
Lower Performance Overhead
High Level of Compression
www.percona.com 25
Write Optimized
Insert data in large tables very fast
Even when have many indexes
Without need of Partitioning
www.percona.com 26
And Decent with Reads
Rather efficient Reads
Largest penalty for non-cached point selects
www.percona.com 27
Great for SSD
• Use SSDs for larger set of workloads
Less Space Usage through
compression
• Can use lower Endurance SSDs
Reduces Wear
www.percona.com 28
SSD Space is Expensive
•$3+ per GB High Quality PCI-E MLC
SSD
•$0.50+ per GB Entry Level SATA SSD
www.percona.com 29
Endurance is Expensive
•6.1 TBW/$ Intel P3700 400GB -
7.3 PBW at $1200
•2.75 TBW/$ Intel P3600 400GB -
2.2 PBW at $800
www.percona.com 30
Mix Reads/Writes
Innodb suffers badly when long running queries are mixed with heavy writes
TokuDB handles such workloads very well
Makes it very good for running real-time analytics
www.percona.com 31
MVCC
Different implementation from Innodb
No Undo Space and Purge Threads
The cleanup done as part of normal operations
Compressed Fractal Trees handle many old versions well
www.percona.com 32
Fragmentation
Fractal Trees performance does not degrade as much with use
The “Optimization” is a part of normal operations
www.percona.com 33
Lets Take a look at
Some Graphs!
www.percona.com 34
1B Insert Test
www.percona.com 35
Compression
www.percona.com 36
Load Speed
www.percona.com 37
Wear
www.percona.com 38
Beyond Inserts
www.percona.com 39
Sysbench Updates
0
1000
2000
3000
4000
5000
6000
7000
InnodbUncompressed
Innnodb 8K TokuDBUncompressed
TokuDB zlib
Updates/Sec
Updates/Sec
www.percona.com 40
Full Table Scan (10m rows)
0
10
20
30
40
50
60
70
InnodbUncompressed
Innnodb 8K TokuDBUncompressed
TokuDB zlib
Full Table Scan (sec)
Full Table Scan (sec)
www.percona.com 41
Table Size on Disk
0
0.5
1
1.5
2
2.5
3
3.5
4
InnodbUncompressed
Innodb 8K TokuDBUncompressed
TokuDB zlib
Table Size (GB)
Table Size (GB)
www.percona.com 42
TokuDB vs Innodb
Innodb is Great Storage Engine !
Facebook, Twitter, Google have proven it in scale
A lot of experience operating and tuning Innodb
Innodb is good default choice
Explore if TokuDB benefits your application rather than do blind migration
www.percona.com 43
Explore TokuDB
Performance at Scale
Efficiency Cost
www.percona.com 44
Resources
• Download Percona Server 5.6 with support for TokuDB
• Review the TokuDB installation web page
• Read the Tokutek blog or visit the Tokutek resources page
To learn more about
Percona Server 5.6
with the Tokutek
database storage engine:
www.percona.com 45
How Percona Can Help
• Visit http://www.percona.com/services/mysql-support/tokudb-support
• Call us at 1-888-316-9775 or +1-208-473-2904
Percona offers
MySQL Support and Consulting services for
users deploying TokuDB
www.percona.com 46
Wanted: Speaker Proposals for Birds of a
Feather Sessions and Lightning Talks
Early Bird Pricing Ends February 1st
http://www.percona.com/live/mysql-conference-2015/
www.percona.com 47 www.percona.com
Peter Zaitsev
@PeterZaitsev
https://www.linkedin.com/in/peterzaitsev
Thank You!