SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
@agatestudio 
TokuDB Introduction 
Aswin 
Knight 
Agate Studio
TokuDB Introduction 
Aswin Juari
TokuDB Overview 
•MySQL Like Storage Engine (MySQL, MariaDB, PerconaServer) 
•Database Engine that more friendly than InnoDB 
•TokuTek Product 
•Open Source 
•No Built for 32 bit 
•Only for Linux Server
Traditional MySQL Engines 
•MyISAM 
–Support nontransactional query 
–No Foreign Key Support 
–Table Level Locking 
–Simple 
•InnoDB 
–Support Transaction and MVCC 
–Foreign Key Support 
–Row Level Locking 
–Complex
Why TokuDB introduced 
Big Data Challenges 
•Volume 
•Velocity 
•Variety
TokuDB vs InnoDB 
•Similarity: 
–Support Transaction and MVCC
TokuDB vs InnoDB 
TokuDB 
InnoDB 
Indexing 
Use Fractal Binary Index 
Use Binary Tree Index 
Hot Indexing 
Yes 
No 
Hot Column Changes 
Yes 
No 
Data Compression 
Up to 25x 
2x 
Fragmentation Immunity 
Yes 
No 
Eliminate Slave Lag 
Yes 
No 
Fast Loader 
Yes 
No 
Fast Recovery Time 
Yes 
No 
Foreign Key Support 
No 
Yes
Benefit of TokuDB 
•Schema change w/o downtime 
•Performances (Fewer Server & Faster) 
•More data Compression (Data Volume) 
•Efficiency of Server 
•TokuDB may extends Storage Life 
•TokuDB may take the same amount time with InnoDB to complete if data is small. However, in huge data, tokudb can give you quick result
TokuDB Technology (Why TokuDB is Better)
Indexing 
•TokuDB uses Fractal Index 
–Much faster than B-trees in > RAM workloads 
–InnoDB and MyISAM use B-trees 
–Key Idea is minimizing I/O Operation
B-Tree 
•B-Tree Structure
B-Tree 
•B-Tree are Fast at Sequential Insert 
–Require 1 Disk I/O because Data fit in memory
B-Tree 
•B-Trees are Slow for High-Entropy Inserts 
–Require Many Disk I/O (because data not fit in memory) 
•Insert Cost       BNOloglog
B-Tree 
•New Created B-Trees Run Fast Range Queries 
–Because Data is put sequentially on Disk 
•Aged B-Trees Run Slow Range Queries
(Simplified) Fractal Index
Simplified Fractal Tree 
•Make N Array of 2 ^ (N-1) Elemen 
•Each Array is full or empty 
•Each array is sorted 
•For Example if there are 10 elements. 
5 
10 
3 
6 
8 
12 
17 
23 
26 
30
Fractal Tree Insertion 
7 
5 
10 
3 
6 
8 
12 
17 
23 
26 
30 
•Insert 7 
Temp Array 
Result Array
Fractal Tree Insertion 
15 
5 
10 
3 
6 
8 
12 
17 
23 
26 
30 
•Insert 15 
7 
Temp Array 
Result Array
Fractal Tree Insertion 
5 
10 
3 
6 
8 
12 
17 
23 
26 
30 
7 
15 
Temp Array 
Result Array
Fractal Tree Insertion 
5 
7 
10 
15 
3 
6 
8 
12 
17 
23 
26 
30 
•Insert 15 
Temp Array 
Result Array
Fractal Tree Insertion 
•Cost to merge 2 arrays of size X is O(X/B) block I/O 
•Cost per element to merge is O(1/B) since O(X) elements were merged. 
•Max # of times of each element is merged is O(log N). 
•Average insert cost (I/O) is O 
•It may takes more CPU cycles because of merge process 
    BNlog
Fractal Tree vs Binary Tree 
• Example: 
– 10^9 of 128 Byte Rows inserted 
• N = 2 ^ 30, log(N)= 30 
– 1MB Block Size 
• 1 Block  8192 rows (2^20/2^7). B = 8192 
• Log (B) = 13 
– B-Tree: 
– Fractal Tree: 
3 
13 
30 
log 
log 
    
 
 
  
 
 
B 
N 
O 
0,003 
8192 
log 13 
   
 
 
 
B 
N 
O
Fractal vs Binary Tree 
InnoDB 
TokuDB 
Performance 
Fast until index not fit in Memory 
Start Fast, Stay Fast 
Deletion 
Not Free Hardisk. 
Free Hardisk 
Disk Block 
64KB, Random IO 
4MB, Sequential IO 
Bottleneck 
Disk (I/O) 
CPU
Fractal vs B-Tree
InnoDB Compression 
InnoDB 
Cache Block 
16k 
Disk Block 
8k, 4k, 2k, 1k 
Algorithm 
zlib
TokuDB Compression 
TokuDB 
Cache Block 
64k (default) 
Disk Block 
4MB 
Algorithm 
Quicklz/zlib/lzma
Installing TokuDB 
•Pre-requisite: Install MySQL First 
•TokuDB Procedure: 
1.Download TokuDB (Check the version of MySQL) 
2.Upload to Server 
3.Extract TokuDB 
4.Make symbolic link from /path-to-tokudb-folder/mysql-5.5.38- tokudb-7.1.0-linux-x86_64 to /path-to-tokudb-folder/mysql 
5.Make symbolic link from /path-to-tokudb-folder/mysql/support- files/mysql.server to /etc/init.d/mysql_toku 
6.Edit Configuration /etc/init.d/mysql_toku 
a.basedir=/opt/tokutek/mysql 
b.datadir=/var/lib/mysql 
7.Copy ‘ha_tokudb.so’ from /path-to-tokudb-folder/mysql/lib/plugin to /usr/lib64/mysql/plugin/
Installing TokuDB 
•TokuDB Procedure (Cont) 
8.Login to Mysql server as root 
9.Do Query Below: 
a)INSTALL PLUGIN tokudb_trx SONAME 'ha_tokudb.so'; 
b)INSTALL PLUGIN tokudb_locks SONAME 'ha_tokudb.so'; 
c)INSTALL PLUGIN tokudb_lock_waits SONAME 'ha_tokudb.so'; 
d)DELETE FROM mysql.plugin WHERE NAME LIKE 'tokudb_user_data%'; 
e)INSTALL PLUGIN TokuDB SONAME 'ha_tokudb.so'; 
f)INSTALL PLUGIN tokudb_file_map SONAME 'ha_tokudb.so'; 
g)INSTALL PLUGIN tokudb_fractal_tree_info SONAME 'ha_tokudb.so'; 
h)INSTALL PLUGIN tokudb_fractal_tree_block_map SONAME 'ha_tokudb.so'; 
i)SET GLOBAL default_storage_engine=TokuDB; 
10.Verify Installation by Query SHOW PLUGINS; and SHOW ENGINES;
Result 
•Conversion Result 
–Compression 
•Input Data: InnoDB 1.0 GB 
•Output : TokuDB 200MB and more files XD
Advanced Setting 
•Edit /etc/my.cnf 
–Reduce innodb_buffer_pool_size (InnoDB) and key_cache_size (MyISAM) 
–Especially if converting tables 
–tokudb_cache_size=?G 
–Defaults to 50% of RAM, I recommend 80% 
–tokudb_directio=1 
–(We Tell that OS should not cache page requested by TokuDB) 
–Data is cache by tokudb cache 
–In Experiment I set innodb_buffer_pool_size about 40-50% memory.
Advanced Setting 
•TokuDB Compression method 
–TOKUDB_ZLIB - This compression is using zlib library and provides mid-range compression with medium CPU utilization. 
–TOKUDB_QUICKLZ - This compression is using quicklz library and provides light compression with low CPU utilization. 
–TOKUDB_LZMA - This compression is using lzma library and provides the highest compression with high CPU utilization. 
–TOKUDB_UNCOMPRESSED - This option disables the compression. 
•Default TokuDB 7.1  TOKUDB_ZLIB 
•Query 
create table t1 ( 
`ID` int(11) NOT NULL AUTO_INCREMENT 
) engine=tokudb, row_format= 
[tokudb_lzma | tokudb_zlib | tokudb_quicklz]; 
ALTER TABLE City ROW_FORMAT=TOKUDB_ZLIB;
References 
•http://www.tokutek.com/

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Performance evaluation of apache tajo
Performance evaluation of apache tajoPerformance evaluation of apache tajo
Performance evaluation of apache tajo
 
Better Full Text Search in PostgreSQL
Better Full Text Search in PostgreSQLBetter Full Text Search in PostgreSQL
Better Full Text Search in PostgreSQL
 
Splitgraph: Open data and beyond - SF ClickHouse Meetup Sep 2020
Splitgraph: Open data and beyond - SF ClickHouse Meetup Sep 2020Splitgraph: Open data and beyond - SF ClickHouse Meetup Sep 2020
Splitgraph: Open data and beyond - SF ClickHouse Meetup Sep 2020
 
Exploring Parallel Merging In GPU Based Systems Using CUDA C.
Exploring Parallel Merging In GPU Based Systems Using CUDA C.Exploring Parallel Merging In GPU Based Systems Using CUDA C.
Exploring Parallel Merging In GPU Based Systems Using CUDA C.
 
HeroLympics Eng V03 Henk Vd Valk
HeroLympics  Eng V03 Henk Vd ValkHeroLympics  Eng V03 Henk Vd Valk
HeroLympics Eng V03 Henk Vd Valk
 
Full Text Search in PostgreSQL
Full Text Search in PostgreSQLFull Text Search in PostgreSQL
Full Text Search in PostgreSQL
 
ClickHouse Defense Against the Dark Arts - Intro to Security and Privacy
ClickHouse Defense Against the Dark Arts - Intro to Security and PrivacyClickHouse Defense Against the Dark Arts - Intro to Security and Privacy
ClickHouse Defense Against the Dark Arts - Intro to Security and Privacy
 
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs
 
Scylla Summit 2022: The Future of Consensus in ScyllaDB 5.0 and Beyond
Scylla Summit 2022: The Future of Consensus in ScyllaDB 5.0 and BeyondScylla Summit 2022: The Future of Consensus in ScyllaDB 5.0 and Beyond
Scylla Summit 2022: The Future of Consensus in ScyllaDB 5.0 and Beyond
 
Apache Flink Training Workshop @ HadoopCon2016 - #2 DataSet API Hands-On
Apache Flink Training Workshop @ HadoopCon2016 - #2 DataSet API Hands-OnApache Flink Training Workshop @ HadoopCon2016 - #2 DataSet API Hands-On
Apache Flink Training Workshop @ HadoopCon2016 - #2 DataSet API Hands-On
 
Cassandra @ Yahoo Japan (Satoshi Konno, Yahoo) | Cassandra Summit 2016
Cassandra @ Yahoo Japan (Satoshi Konno, Yahoo) | Cassandra Summit 2016Cassandra @ Yahoo Japan (Satoshi Konno, Yahoo) | Cassandra Summit 2016
Cassandra @ Yahoo Japan (Satoshi Konno, Yahoo) | Cassandra Summit 2016
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
 
OpenTSDB 2.0
OpenTSDB 2.0OpenTSDB 2.0
OpenTSDB 2.0
 
Bucket your partitions wisely - Cassandra summit 2016
Bucket your partitions wisely - Cassandra summit 2016Bucket your partitions wisely - Cassandra summit 2016
Bucket your partitions wisely - Cassandra summit 2016
 
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
 
Redpanda and ClickHouse
Redpanda and ClickHouseRedpanda and ClickHouse
Redpanda and ClickHouse
 
Synchronise your data between MySQL and MongoDB
Synchronise your data between MySQL and MongoDBSynchronise your data between MySQL and MongoDB
Synchronise your data between MySQL and MongoDB
 
RAIDZ on-disk format vs. small blocks
RAIDZ on-disk format vs. small blocksRAIDZ on-disk format vs. small blocks
RAIDZ on-disk format vs. small blocks
 
PostgreSQL and RAM usage
PostgreSQL and RAM usagePostgreSQL and RAM usage
PostgreSQL and RAM usage
 
Update on OpenTSDB and AsyncHBase
Update on OpenTSDB and AsyncHBase Update on OpenTSDB and AsyncHBase
Update on OpenTSDB and AsyncHBase
 

Andere mochten auch (8)

Wp quality bar tedy
Wp quality bar   tedyWp quality bar   tedy
Wp quality bar tedy
 
Freemium conceptanalytics leemarvin
Freemium conceptanalytics leemarvinFreemium conceptanalytics leemarvin
Freemium conceptanalytics leemarvin
 
Community Management by Yudhit
Community Management by YudhitCommunity Management by Yudhit
Community Management by Yudhit
 
Game Programming Pattern by Restya
Game Programming Pattern by RestyaGame Programming Pattern by Restya
Game Programming Pattern by Restya
 
Computational Advertising by Icha
Computational Advertising by IchaComputational Advertising by Icha
Computational Advertising by Icha
 
[Habli] tds agustus
[Habli] tds agustus[Habli] tds agustus
[Habli] tds agustus
 
MGDW4 Online Camp #3b - State Management
MGDW4 Online Camp #3b - State ManagementMGDW4 Online Camp #3b - State Management
MGDW4 Online Camp #3b - State Management
 
Digital Coloring by Raksa
Digital Coloring by RaksaDigital Coloring by Raksa
Digital Coloring by Raksa
 

Ähnlich wie Toku DB by Aswin

OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture Performance
Enkitec
 

Ähnlich wie Toku DB by Aswin (20)

Fractal Tree Indexes : From Theory to Practice
Fractal Tree Indexes : From Theory to PracticeFractal Tree Indexes : From Theory to Practice
Fractal Tree Indexes : From Theory to Practice
 
20140128 webinar-get-more-out-of-mysql-with-tokudb-140319063324-phpapp02
20140128 webinar-get-more-out-of-mysql-with-tokudb-140319063324-phpapp0220140128 webinar-get-more-out-of-mysql-with-tokudb-140319063324-phpapp02
20140128 webinar-get-more-out-of-mysql-with-tokudb-140319063324-phpapp02
 
Apache con 2020 use cases and optimizations of iotdb
Apache con 2020 use cases and optimizations of iotdbApache con 2020 use cases and optimizations of iotdb
Apache con 2020 use cases and optimizations of iotdb
 
Get More Out of MySQL with TokuDB
Get More Out of MySQL with TokuDBGet More Out of MySQL with TokuDB
Get More Out of MySQL with TokuDB
 
Real World Performance - Data Warehouses
Real World Performance - Data WarehousesReal World Performance - Data Warehouses
Real World Performance - Data Warehouses
 
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
 
Ceph Day Beijing - Our Journey to High Performance Large Scale Ceph Cluster a...
Ceph Day Beijing - Our Journey to High Performance Large Scale Ceph Cluster a...Ceph Day Beijing - Our Journey to High Performance Large Scale Ceph Cluster a...
Ceph Day Beijing - Our Journey to High Performance Large Scale Ceph Cluster a...
 
From Postgres to ScyllaDB: Migration Strategies and Performance Gains
From Postgres to ScyllaDB: Migration Strategies and Performance GainsFrom Postgres to ScyllaDB: Migration Strategies and Performance Gains
From Postgres to ScyllaDB: Migration Strategies and Performance Gains
 
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
 
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte DataProblems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
 
SQream DB - Bigger Data On GPUs: Approaches, Challenges, Successes
SQream DB - Bigger Data On GPUs: Approaches, Challenges, SuccessesSQream DB - Bigger Data On GPUs: Approaches, Challenges, Successes
SQream DB - Bigger Data On GPUs: Approaches, Challenges, Successes
 
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
 
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
 
Galaxy Big Data with MariaDB
Galaxy Big Data with MariaDBGalaxy Big Data with MariaDB
Galaxy Big Data with MariaDB
 
OracleStore: A Highly Performant RawStore Implementation for Hive Metastore
OracleStore: A Highly Performant RawStore Implementation for Hive MetastoreOracleStore: A Highly Performant RawStore Implementation for Hive Metastore
OracleStore: A Highly Performant RawStore Implementation for Hive Metastore
 
FACE: Fast and Customizable Sorting Accelerator for Heterogeneous Many-core S...
FACE: Fast and Customizable Sorting Accelerator for Heterogeneous Many-core S...FACE: Fast and Customizable Sorting Accelerator for Heterogeneous Many-core S...
FACE: Fast and Customizable Sorting Accelerator for Heterogeneous Many-core S...
 
OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture Performance
 
Loadays MySQL
Loadays MySQLLoadays MySQL
Loadays MySQL
 
week1slides1704202828322.pdf
week1slides1704202828322.pdfweek1slides1704202828322.pdf
week1slides1704202828322.pdf
 
MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017
 

Mehr von Agate Studio

Lee marvin pitching-hacks
Lee marvin pitching-hacksLee marvin pitching-hacks
Lee marvin pitching-hacks
Agate Studio
 
Emotiv EPOC by Neneng
Emotiv EPOC by NenengEmotiv EPOC by Neneng
Emotiv EPOC by Neneng
Agate Studio
 
MMO Design Architecture by Andrew
MMO Design Architecture by AndrewMMO Design Architecture by Andrew
MMO Design Architecture by Andrew
Agate Studio
 
How to Persuade People by Dave
How to Persuade People by DaveHow to Persuade People by Dave
How to Persuade People by Dave
Agate Studio
 
Eddie supersmash goodminton
Eddie   supersmash goodmintonEddie   supersmash goodminton
Eddie supersmash goodminton
Agate Studio
 
Satriyo digital audio gears
Satriyo   digital audio gearsSatriyo   digital audio gears
Satriyo digital audio gears
Agate Studio
 
Yinan heroes of-the_strom
Yinan   heroes of-the_stromYinan   heroes of-the_strom
Yinan heroes of-the_strom
Agate Studio
 
Advanced encryption standard (aes) epul
Advanced encryption standard (aes)   epulAdvanced encryption standard (aes)   epul
Advanced encryption standard (aes) epul
Agate Studio
 
Real Time Framework by Tonny
Real Time Framework by TonnyReal Time Framework by Tonny
Real Time Framework by Tonny
Agate Studio
 
Unity Camera & Simple Image Editing by Puthut
Unity Camera & Simple Image Editing by PuthutUnity Camera & Simple Image Editing by Puthut
Unity Camera & Simple Image Editing by Puthut
Agate Studio
 
Hibernate by Jason
Hibernate by JasonHibernate by Jason
Hibernate by Jason
Agate Studio
 
Hardening Apache Web Server by Aswin
Hardening Apache Web Server by AswinHardening Apache Web Server by Aswin
Hardening Apache Web Server by Aswin
Agate Studio
 
Introduction to Global Illumination by Aryo
Introduction to Global Illumination by AryoIntroduction to Global Illumination by Aryo
Introduction to Global Illumination by Aryo
Agate Studio
 
Mobile Games Store by Valen
Mobile Games Store by ValenMobile Games Store by Valen
Mobile Games Store by Valen
Agate Studio
 
Characteristics of Musical Keys by Satriyo
Characteristics of Musical Keys by SatriyoCharacteristics of Musical Keys by Satriyo
Characteristics of Musical Keys by Satriyo
Agate Studio
 
Nelson easter egg
Nelson easter eggNelson easter egg
Nelson easter egg
Agate Studio
 
Idol Cardgame by Naky
Idol Cardgame by NakyIdol Cardgame by Naky
Idol Cardgame by Naky
Agate Studio
 
Carnival Zombie by Indra
Carnival Zombie by IndraCarnival Zombie by Indra
Carnival Zombie by Indra
Agate Studio
 
Postmortem Jokowi Go by Tama
Postmortem Jokowi Go by TamaPostmortem Jokowi Go by Tama
Postmortem Jokowi Go by Tama
Agate Studio
 

Mehr von Agate Studio (20)

Lee marvin pitching-hacks
Lee marvin pitching-hacksLee marvin pitching-hacks
Lee marvin pitching-hacks
 
Emotiv EPOC by Neneng
Emotiv EPOC by NenengEmotiv EPOC by Neneng
Emotiv EPOC by Neneng
 
Aksi – Koneksi – Deviasi by Valent
Aksi – Koneksi – Deviasi by ValentAksi – Koneksi – Deviasi by Valent
Aksi – Koneksi – Deviasi by Valent
 
MMO Design Architecture by Andrew
MMO Design Architecture by AndrewMMO Design Architecture by Andrew
MMO Design Architecture by Andrew
 
How to Persuade People by Dave
How to Persuade People by DaveHow to Persuade People by Dave
How to Persuade People by Dave
 
Eddie supersmash goodminton
Eddie   supersmash goodmintonEddie   supersmash goodminton
Eddie supersmash goodminton
 
Satriyo digital audio gears
Satriyo   digital audio gearsSatriyo   digital audio gears
Satriyo digital audio gears
 
Yinan heroes of-the_strom
Yinan   heroes of-the_stromYinan   heroes of-the_strom
Yinan heroes of-the_strom
 
Advanced encryption standard (aes) epul
Advanced encryption standard (aes)   epulAdvanced encryption standard (aes)   epul
Advanced encryption standard (aes) epul
 
Real Time Framework by Tonny
Real Time Framework by TonnyReal Time Framework by Tonny
Real Time Framework by Tonny
 
Unity Camera & Simple Image Editing by Puthut
Unity Camera & Simple Image Editing by PuthutUnity Camera & Simple Image Editing by Puthut
Unity Camera & Simple Image Editing by Puthut
 
Hibernate by Jason
Hibernate by JasonHibernate by Jason
Hibernate by Jason
 
Hardening Apache Web Server by Aswin
Hardening Apache Web Server by AswinHardening Apache Web Server by Aswin
Hardening Apache Web Server by Aswin
 
Introduction to Global Illumination by Aryo
Introduction to Global Illumination by AryoIntroduction to Global Illumination by Aryo
Introduction to Global Illumination by Aryo
 
Mobile Games Store by Valen
Mobile Games Store by ValenMobile Games Store by Valen
Mobile Games Store by Valen
 
Characteristics of Musical Keys by Satriyo
Characteristics of Musical Keys by SatriyoCharacteristics of Musical Keys by Satriyo
Characteristics of Musical Keys by Satriyo
 
Nelson easter egg
Nelson easter eggNelson easter egg
Nelson easter egg
 
Idol Cardgame by Naky
Idol Cardgame by NakyIdol Cardgame by Naky
Idol Cardgame by Naky
 
Carnival Zombie by Indra
Carnival Zombie by IndraCarnival Zombie by Indra
Carnival Zombie by Indra
 
Postmortem Jokowi Go by Tama
Postmortem Jokowi Go by TamaPostmortem Jokowi Go by Tama
Postmortem Jokowi Go by Tama
 

KĂźrzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

KĂźrzlich hochgeladen (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Toku DB by Aswin

  • 1. @agatestudio TokuDB Introduction Aswin Knight Agate Studio
  • 3. TokuDB Overview •MySQL Like Storage Engine (MySQL, MariaDB, PerconaServer) •Database Engine that more friendly than InnoDB •TokuTek Product •Open Source •No Built for 32 bit •Only for Linux Server
  • 4. Traditional MySQL Engines •MyISAM –Support nontransactional query –No Foreign Key Support –Table Level Locking –Simple •InnoDB –Support Transaction and MVCC –Foreign Key Support –Row Level Locking –Complex
  • 5. Why TokuDB introduced Big Data Challenges •Volume •Velocity •Variety
  • 6. TokuDB vs InnoDB •Similarity: –Support Transaction and MVCC
  • 7. TokuDB vs InnoDB TokuDB InnoDB Indexing Use Fractal Binary Index Use Binary Tree Index Hot Indexing Yes No Hot Column Changes Yes No Data Compression Up to 25x 2x Fragmentation Immunity Yes No Eliminate Slave Lag Yes No Fast Loader Yes No Fast Recovery Time Yes No Foreign Key Support No Yes
  • 8. Benefit of TokuDB •Schema change w/o downtime •Performances (Fewer Server & Faster) •More data Compression (Data Volume) •Efficiency of Server •TokuDB may extends Storage Life •TokuDB may take the same amount time with InnoDB to complete if data is small. However, in huge data, tokudb can give you quick result
  • 9. TokuDB Technology (Why TokuDB is Better)
  • 10. Indexing •TokuDB uses Fractal Index –Much faster than B-trees in > RAM workloads –InnoDB and MyISAM use B-trees –Key Idea is minimizing I/O Operation
  • 12. B-Tree •B-Tree are Fast at Sequential Insert –Require 1 Disk I/O because Data fit in memory
  • 13. B-Tree •B-Trees are Slow for High-Entropy Inserts –Require Many Disk I/O (because data not fit in memory) •Insert Cost       BNOloglog
  • 14. B-Tree •New Created B-Trees Run Fast Range Queries –Because Data is put sequentially on Disk •Aged B-Trees Run Slow Range Queries
  • 16. Simplified Fractal Tree •Make N Array of 2 ^ (N-1) Elemen •Each Array is full or empty •Each array is sorted •For Example if there are 10 elements. 5 10 3 6 8 12 17 23 26 30
  • 17. Fractal Tree Insertion 7 5 10 3 6 8 12 17 23 26 30 •Insert 7 Temp Array Result Array
  • 18. Fractal Tree Insertion 15 5 10 3 6 8 12 17 23 26 30 •Insert 15 7 Temp Array Result Array
  • 19. Fractal Tree Insertion 5 10 3 6 8 12 17 23 26 30 7 15 Temp Array Result Array
  • 20. Fractal Tree Insertion 5 7 10 15 3 6 8 12 17 23 26 30 •Insert 15 Temp Array Result Array
  • 21. Fractal Tree Insertion •Cost to merge 2 arrays of size X is O(X/B) block I/O •Cost per element to merge is O(1/B) since O(X) elements were merged. •Max # of times of each element is merged is O(log N). •Average insert cost (I/O) is O •It may takes more CPU cycles because of merge process     BNlog
  • 22. Fractal Tree vs Binary Tree • Example: – 10^9 of 128 Byte Rows inserted • N = 2 ^ 30, log(N)= 30 – 1MB Block Size • 1 Block  8192 rows (2^20/2^7). B = 8192 • Log (B) = 13 – B-Tree: – Fractal Tree: 3 13 30 log log           B N O 0,003 8192 log 13       B N O
  • 23. Fractal vs Binary Tree InnoDB TokuDB Performance Fast until index not fit in Memory Start Fast, Stay Fast Deletion Not Free Hardisk. Free Hardisk Disk Block 64KB, Random IO 4MB, Sequential IO Bottleneck Disk (I/O) CPU
  • 25. InnoDB Compression InnoDB Cache Block 16k Disk Block 8k, 4k, 2k, 1k Algorithm zlib
  • 26. TokuDB Compression TokuDB Cache Block 64k (default) Disk Block 4MB Algorithm Quicklz/zlib/lzma
  • 27. Installing TokuDB •Pre-requisite: Install MySQL First •TokuDB Procedure: 1.Download TokuDB (Check the version of MySQL) 2.Upload to Server 3.Extract TokuDB 4.Make symbolic link from /path-to-tokudb-folder/mysql-5.5.38- tokudb-7.1.0-linux-x86_64 to /path-to-tokudb-folder/mysql 5.Make symbolic link from /path-to-tokudb-folder/mysql/support- files/mysql.server to /etc/init.d/mysql_toku 6.Edit Configuration /etc/init.d/mysql_toku a.basedir=/opt/tokutek/mysql b.datadir=/var/lib/mysql 7.Copy ‘ha_tokudb.so’ from /path-to-tokudb-folder/mysql/lib/plugin to /usr/lib64/mysql/plugin/
  • 28. Installing TokuDB •TokuDB Procedure (Cont) 8.Login to Mysql server as root 9.Do Query Below: a)INSTALL PLUGIN tokudb_trx SONAME 'ha_tokudb.so'; b)INSTALL PLUGIN tokudb_locks SONAME 'ha_tokudb.so'; c)INSTALL PLUGIN tokudb_lock_waits SONAME 'ha_tokudb.so'; d)DELETE FROM mysql.plugin WHERE NAME LIKE 'tokudb_user_data%'; e)INSTALL PLUGIN TokuDB SONAME 'ha_tokudb.so'; f)INSTALL PLUGIN tokudb_file_map SONAME 'ha_tokudb.so'; g)INSTALL PLUGIN tokudb_fractal_tree_info SONAME 'ha_tokudb.so'; h)INSTALL PLUGIN tokudb_fractal_tree_block_map SONAME 'ha_tokudb.so'; i)SET GLOBAL default_storage_engine=TokuDB; 10.Verify Installation by Query SHOW PLUGINS; and SHOW ENGINES;
  • 29. Result •Conversion Result –Compression •Input Data: InnoDB 1.0 GB •Output : TokuDB 200MB and more files XD
  • 30. Advanced Setting •Edit /etc/my.cnf –Reduce innodb_buffer_pool_size (InnoDB) and key_cache_size (MyISAM) –Especially if converting tables –tokudb_cache_size=?G –Defaults to 50% of RAM, I recommend 80% –tokudb_directio=1 –(We Tell that OS should not cache page requested by TokuDB) –Data is cache by tokudb cache –In Experiment I set innodb_buffer_pool_size about 40-50% memory.
  • 31. Advanced Setting •TokuDB Compression method –TOKUDB_ZLIB - This compression is using zlib library and provides mid-range compression with medium CPU utilization. –TOKUDB_QUICKLZ - This compression is using quicklz library and provides light compression with low CPU utilization. –TOKUDB_LZMA - This compression is using lzma library and provides the highest compression with high CPU utilization. –TOKUDB_UNCOMPRESSED - This option disables the compression. •Default TokuDB 7.1  TOKUDB_ZLIB •Query create table t1 ( `ID` int(11) NOT NULL AUTO_INCREMENT ) engine=tokudb, row_format= [tokudb_lzma | tokudb_zlib | tokudb_quicklz]; ALTER TABLE City ROW_FORMAT=TOKUDB_ZLIB;