SlideShare a Scribd company logo
Sergei Petrunia
sergey@mariadb.com
MyRocks in MariaDB
Why and How
MariaDB Developer UnConference
April 9-10th
2017
New York
11:00:56 2
About MariaDB
What is MyRocks?
11:00:56 3
What is MyRocks
●
RocksDB + MySQL = MyRocks
●
LSM architecture
●
Better compression
●
Better IO efficiency
●
Write optimizations
− Bulk load
− No-read writes
●
Used and verified at Facebook
11:00:56 4
MyRocks needs adoption and community
● Currently, it is in github.com/facebook/mysql­5.6 
●
No binaries
●
No packages
●
Very much “in-house” experience
− Special branch of MySQL
− Special way to compile
− Special command to run tests
− ...
11:00:56 5
MyRocks + MariaDB = ♥
●
New technology
●
Adoption
●
Packaging
●
Community
●
MariaDB features
11:00:56 6
Plan
1. Tasks for porting MyRocks
2. Current status
3. Future
11:00:56 7
Tasks for putting MyRocks into MariaDB
●
Port MyRocks
from facebook/mysql-5.6 to MariaDB
●
Do builds and packages
●
Catch a MariaDB release train
11:00:56 8
Checklist for putting MyRocks into MariaDB
●
Port MyRocks
from facebook/mysql-5.6 to MariaDB
●
Do builds and packages
●
Catch a MariaDB release train
11:00:56 9
Porting MyRocks
SQL layer
RocksDB
MyRocks
11:00:56 10
Porting MyRocks
SQL layer
RocksDB
Read-free
replication
More
counters
Gap lock
use detector
Extra
range info
Bloom
filter use
MyRocks
...
counter++
...
●
MyRocks is not just storage/rocksdb/*
11:00:56 11
Porting MyRocks
●
Resolve the SQL layer differences
●
Resolve MariaDB vs MySQL
differences
− Index Condition pushdown
− Extended Keys
− Group Commit
− EXPLAIN output changes
− Extra/missing warnings
− …
11:00:56 12
Checklist for putting MyRocks into MariaDB
●
Port MyRocks
from facebook/mysql-5.6 to MariaDB
●
Do builds and packages
●
Catch a MariaDB release train
11:00:56 13
Do builds and packages
●
Facebook/mysql-5.6 builds statically
●
We want ha_rocksdb.so
●
We want packages
− deb, rpm, bintar, windows zip, ...
●
RocksDB uses compression libraries
− Need to link against them
− Need to have proper dependencies
11:00:56 14
Checklist for putting MyRocks into MariaDB
●
Port MyRocks
from facebook/mysql-5.6 to MariaDB
●
Do builds and packages
●
Catch a MariaDB release train
11:01:01 15
MariaDB releases
●
MariaDB 10.0:
− Alpha: 12 Nov 2012
− Stable: 31 Mar 2014
●
MariaDB 10.1 (Stable)
− Alpha: 30 Jun 2014
− Stable: 17 Oct 2015
●
MariaDB 10.2 (RC)
− Alpha: 18 Apr 2016
− RC: 17 Feb 2017
− Stable: soon
Get into a MariaDB Release before it is declared stable
●
MariaDB 10.3
− “alpha soon”
11:01:01 16
Plugin Maturity
●
Plugins declare their maturity
− unknown, experimental, alpha, beta, gamma, stable
●
mysqld --plugin-maturity=level
− will not load plugins less mature than level.
●
This is how MyRocks can get into MariaDB 10.2
− Plugin with maturity=alpha.
11:00:56 17
Current status
11:01:01 18
Current status
●
MariaDB 10.2.5 RC2 includes MyRocks
●
Features
●
Packaging
●
Quality
11:01:01 19
Current status
●
MariaDB 10.2.5 RC2 includes MyRocks
●
Features
●
Packaging
●
Quality
11:00:56 20
Feature status
●
Working
− General server functionality
− Optimizer-related
● Bloom filter support
− Tests
●
Non-working yet
− Interplay between the storage engine and the binlog
● Group commit
● Read-Free-Slave
● GTID
− Gap Lock detector
11:01:01 21
diff -u mariarocks myrocks
3K line diff for the code
- CMake build changes
- MariaDB's differences in Extended Keys
- MariaDB's differences in Index Condition Pushdown
- MariaDB calls ha_statistic_increment(...) above the storage engine
- Implement prepare_*_scan(), Bloom Filter works for ORDER BY DESC
- Storage Engine API function signature changes
- s/MySQL/MariaDB/ in names of structs, constants, etc
- #ifdef-away code related to replication and binlog
- #ifdef-away extra diagnostics like SHOW ENGINE TRANSACTION STATUS
- ...
8K lines diff for tests:
- MariaDB has different default values for SQL columns
- EXPLAIN output is slightly different
- Handler_xxx counters counted a bit differently
- MTR explicitly logs connection open/switch/etc
- mysql-test/suite/$MYROCKS_TEST → storage/rocksdb/mysql-test/$MYROCKS_TEST
- ...
11:00:56 22
Gap Lock Detector
●
SQL level feature
●
Detects queries that use gap locking
●
Workflow
− Run with InnoDB, detect and remove the querie
− Migrate to MyRocks
●
Objections to pushing
− MyRocks has features on SQL layer!
●
?
11:01:01 23
Current status
●
MariaDB 10.2.5 RC2 includes MyRocks
●
Features
●
Packaging
●
Quality
11:01:01 24
Packaging in facebook/mysql-5.6
●
MyRocks is linked statically
●
RocksDB is a submodule (@revno)
− Not a dependency
●
Can compile with compression libraries
− Snappy
− Zlib
− ZStandard
− ...
11:01:01 25
Packaging in MariaDB
●
MyRocks is built as ha_rocksdb.so
●
RocksDB is a submodule (@revno)
− Linked in statically in the .so
●
Compression libraries
− Bintar: links statically (snappy, zlib)
− .deb/.rpm: package has a dependency (snappy, zlib)
− Windows zip/MSI: zlib
●
rocksdb_hotbackup is missing
− but works (have an MDEV for this)
11:01:01 26
Compiling in MariaDB
●
MyRocks is built as ha_rocksdb.so
●
MyRocks is compiled by default
− Except for unsupported platforms
●
MyRocks tests can be run as regular tests
./mysql-test-run rocksdb.type_varchar
11:01:01 27
Current status
●
MariaDB 10.2.5 RC2 includes MyRocks
●
Features
●
Packaging
●
Quality
11:01:01 28
MyRocks Quality
●
Alpha-maturity plugin in RC-level MariaDB Server
●
MyRocks tests are run in MariaDB buildbot
●
There are failing testcases
− Not necessarily MyRocks bugs
− Working on this
●
There are missing features
− Can finish those that touch
only storage/rocksdb
− May be harder if the feature
touches the SQL layer.
11:00:56 29
Future
11:01:01 30
Future
●
Fix the failing tests
− Some failures are from the upstream
●
Usability improvements
●
Interplay between the Storage Engine and Binlog
− Get it to work
− MariaDB's Group Commit
− Per-engine mysql.slave_gtid_pos
− Parallel Slave support?
●
Keep merging from upstream.
11:00:56 31
Thanks!

More Related Content

PDF
MyRocks in MariaDB
PDF
Say Hello to MyRocks
PPTX
When is MyRocks good?
PDF
MyRocks in MariaDB | M18
PDF
MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?
PDF
M|18 How to use MyRocks with MariaDB Server
PPTX
M|18 How Facebook Migrated to MyRocks
PPTX
M|18 Writing Stored Procedures in the Real World
MyRocks in MariaDB
Say Hello to MyRocks
When is MyRocks good?
MyRocks in MariaDB | M18
MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?
M|18 How to use MyRocks with MariaDB Server
M|18 How Facebook Migrated to MyRocks
M|18 Writing Stored Procedures in the Real World

What's hot (20)

PPTX
Myrocks in the wild wild west! FOSDEM 2020
PDF
MariaDB 5.5 and what comes next - Percona Live NYC 2012
PDF
M|18 Under the Hood: Galera Cluster
PDF
Distributions from the view a package
PDF
When is Myrocks good? 2020 Webinar Series
PDF
Percona XtraDB Cluster ( Ensure high Availability )
PDF
MariaDB: The 2012 Edition
PDF
MySQL High Availability Solutions
PDF
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
PDF
MyRocks Deep Dive
PDF
InnoDB Cluster Experience (MySQL User Camp)
PDF
High Availability with Galera Cluster - SkySQL Road Show 2013 in Berlin
PDF
Tuning Linux for your database FLOSSUK 2016
PDF
My first moments with MongoDB
PDF
MariaDB 10.0 - SkySQL Paris Meetup
PDF
A beginners guide to MariaDB
PDF
MariaDB - a MySQL Replacement #SELF2014
PDF
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
PDF
MariaDB 10: A MySQL Replacement - HKOSC
PDF
A26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
Myrocks in the wild wild west! FOSDEM 2020
MariaDB 5.5 and what comes next - Percona Live NYC 2012
M|18 Under the Hood: Galera Cluster
Distributions from the view a package
When is Myrocks good? 2020 Webinar Series
Percona XtraDB Cluster ( Ensure high Availability )
MariaDB: The 2012 Edition
MySQL High Availability Solutions
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
MyRocks Deep Dive
InnoDB Cluster Experience (MySQL User Camp)
High Availability with Galera Cluster - SkySQL Road Show 2013 in Berlin
Tuning Linux for your database FLOSSUK 2016
My first moments with MongoDB
MariaDB 10.0 - SkySQL Paris Meetup
A beginners guide to MariaDB
MariaDB - a MySQL Replacement #SELF2014
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
MariaDB 10: A MySQL Replacement - HKOSC
A26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
Ad

Similar to MyRocks in MariaDB: why and how (20)

PDF
MariaDB 10.2 & MariaDB 10.1 by Michael Monty Widenius at Database Camp 2016 @ UN
PDF
Differences between MariaDB 10.3 & MySQL 8.0
PDF
SkySQL MariaDB 云数据组件
PPT
Maria db the new mysql (Colin Charles)
PDF
The New MariaDB Offering - MariaDB 10, MaxScale and more
PDF
MySQL features missing in MariaDB Server
PPTX
High performance and high availability proxies for MySQL
PPTX
ProxySQL for MySQL
PDF
Webinar - Key Reasons to Upgrade to MySQL 8.0 or MariaDB 10.11
PDF
MariaDB: Connect Storage Engine
PDF
DebConf16 BoF on MariaDB/MySQL packaging
PPTX
The New MariaDB Offering: MariaDB 10, MaxScale and More
PDF
Meet MariaDB Server 10.1 London MySQL meetup December 2015
PDF
MariaDB: in-depth (hands on training in Seoul)
PPTX
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
PDF
MySQL Parallel Replication: inventory, use-case and limitations
PDF
MyRocks introduction and production deployment
PDF
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
PDF
Webinar slides: Introducing Galera 3.0 - Now supporting MySQL 5.6
MariaDB 10.2 & MariaDB 10.1 by Michael Monty Widenius at Database Camp 2016 @ UN
Differences between MariaDB 10.3 & MySQL 8.0
SkySQL MariaDB 云数据组件
Maria db the new mysql (Colin Charles)
The New MariaDB Offering - MariaDB 10, MaxScale and more
MySQL features missing in MariaDB Server
High performance and high availability proxies for MySQL
ProxySQL for MySQL
Webinar - Key Reasons to Upgrade to MySQL 8.0 or MariaDB 10.11
MariaDB: Connect Storage Engine
DebConf16 BoF on MariaDB/MySQL packaging
The New MariaDB Offering: MariaDB 10, MaxScale and More
Meet MariaDB Server 10.1 London MySQL meetup December 2015
MariaDB: in-depth (hands on training in Seoul)
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
MySQL Parallel Replication: inventory, use-case and limitations
MyRocks introduction and production deployment
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
Webinar slides: Introducing Galera 3.0 - Now supporting MySQL 5.6
Ad

More from Sergey Petrunya (20)

PDF
MariaDB's New-Generation Optimizer Hints
PDF
New optimizer features in MariaDB releases before 10.12
PDF
MariaDB's join optimizer: how it works and current fixes
PDF
Improved histograms in MariaDB 10.8
PDF
Improving MariaDB’s Query Optimizer with better selectivity estimates
PDF
JSON Support in MariaDB: News, non-news and the bigger picture
PDF
Optimizer Trace Walkthrough
PDF
ANALYZE for Statements - MariaDB's hidden gem
PDF
Optimizer features in recent releases of other databases
PDF
MariaDB 10.4 - что нового
PDF
Using histograms to get better performance
PDF
MariaDB Optimizer - further down the rabbit hole
PDF
Query Optimizer in MariaDB 10.4
PDF
Lessons for the optimizer from running the TPC-DS benchmark
PDF
MariaDB 10.3 Optimizer - where does it stand
PDF
New Query Optimizer features in MariaDB 10.3
PDF
Histograms in MariaDB, MySQL and PostgreSQL
PDF
Common Table Expressions in MariaDB 10.2
PDF
Эволюция репликации в MySQL и MariaDB
PDF
Common Table Expressions in MariaDB 10.2 (Percona Live Amsterdam 2016)
MariaDB's New-Generation Optimizer Hints
New optimizer features in MariaDB releases before 10.12
MariaDB's join optimizer: how it works and current fixes
Improved histograms in MariaDB 10.8
Improving MariaDB’s Query Optimizer with better selectivity estimates
JSON Support in MariaDB: News, non-news and the bigger picture
Optimizer Trace Walkthrough
ANALYZE for Statements - MariaDB's hidden gem
Optimizer features in recent releases of other databases
MariaDB 10.4 - что нового
Using histograms to get better performance
MariaDB Optimizer - further down the rabbit hole
Query Optimizer in MariaDB 10.4
Lessons for the optimizer from running the TPC-DS benchmark
MariaDB 10.3 Optimizer - where does it stand
New Query Optimizer features in MariaDB 10.3
Histograms in MariaDB, MySQL and PostgreSQL
Common Table Expressions in MariaDB 10.2
Эволюция репликации в MySQL и MariaDB
Common Table Expressions in MariaDB 10.2 (Percona Live Amsterdam 2016)

Recently uploaded (20)

PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
history of c programming in notes for students .pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Cost to Outsource Software Development in 2025
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
medical staffing services at VALiNTRY
Advanced SystemCare Ultimate Crack + Portable (2025)
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Salesforce Agentforce AI Implementation.pdf
17 Powerful Integrations Your Next-Gen MLM Software Needs
Design an Analysis of Algorithms II-SECS-1021-03
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Wondershare Filmora 15 Crack With Activation Key [2025
Designing Intelligence for the Shop Floor.pdf
Design an Analysis of Algorithms I-SECS-1021-03
How to Choose the Right IT Partner for Your Business in Malaysia
history of c programming in notes for students .pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Cost to Outsource Software Development in 2025
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Monitoring Stack: Grafana, Loki & Promtail
wealthsignaloriginal-com-DS-text-... (1).pdf
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
L1 - Introduction to python Backend.pptx
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
medical staffing services at VALiNTRY

MyRocks in MariaDB: why and how

  • 1. Sergei Petrunia [email protected] MyRocks in MariaDB Why and How MariaDB Developer UnConference April 9-10th 2017 New York
  • 3. 11:00:56 3 What is MyRocks ● RocksDB + MySQL = MyRocks ● LSM architecture ● Better compression ● Better IO efficiency ● Write optimizations − Bulk load − No-read writes ● Used and verified at Facebook
  • 4. 11:00:56 4 MyRocks needs adoption and community ● Currently, it is in github.com/facebook/mysql­5.6  ● No binaries ● No packages ● Very much “in-house” experience − Special branch of MySQL − Special way to compile − Special command to run tests − ...
  • 5. 11:00:56 5 MyRocks + MariaDB = ♥ ● New technology ● Adoption ● Packaging ● Community ● MariaDB features
  • 6. 11:00:56 6 Plan 1. Tasks for porting MyRocks 2. Current status 3. Future
  • 7. 11:00:56 7 Tasks for putting MyRocks into MariaDB ● Port MyRocks from facebook/mysql-5.6 to MariaDB ● Do builds and packages ● Catch a MariaDB release train
  • 8. 11:00:56 8 Checklist for putting MyRocks into MariaDB ● Port MyRocks from facebook/mysql-5.6 to MariaDB ● Do builds and packages ● Catch a MariaDB release train
  • 9. 11:00:56 9 Porting MyRocks SQL layer RocksDB MyRocks
  • 10. 11:00:56 10 Porting MyRocks SQL layer RocksDB Read-free replication More counters Gap lock use detector Extra range info Bloom filter use MyRocks ... counter++ ... ● MyRocks is not just storage/rocksdb/*
  • 11. 11:00:56 11 Porting MyRocks ● Resolve the SQL layer differences ● Resolve MariaDB vs MySQL differences − Index Condition pushdown − Extended Keys − Group Commit − EXPLAIN output changes − Extra/missing warnings − …
  • 12. 11:00:56 12 Checklist for putting MyRocks into MariaDB ● Port MyRocks from facebook/mysql-5.6 to MariaDB ● Do builds and packages ● Catch a MariaDB release train
  • 13. 11:00:56 13 Do builds and packages ● Facebook/mysql-5.6 builds statically ● We want ha_rocksdb.so ● We want packages − deb, rpm, bintar, windows zip, ... ● RocksDB uses compression libraries − Need to link against them − Need to have proper dependencies
  • 14. 11:00:56 14 Checklist for putting MyRocks into MariaDB ● Port MyRocks from facebook/mysql-5.6 to MariaDB ● Do builds and packages ● Catch a MariaDB release train
  • 15. 11:01:01 15 MariaDB releases ● MariaDB 10.0: − Alpha: 12 Nov 2012 − Stable: 31 Mar 2014 ● MariaDB 10.1 (Stable) − Alpha: 30 Jun 2014 − Stable: 17 Oct 2015 ● MariaDB 10.2 (RC) − Alpha: 18 Apr 2016 − RC: 17 Feb 2017 − Stable: soon Get into a MariaDB Release before it is declared stable ● MariaDB 10.3 − “alpha soon”
  • 16. 11:01:01 16 Plugin Maturity ● Plugins declare their maturity − unknown, experimental, alpha, beta, gamma, stable ● mysqld --plugin-maturity=level − will not load plugins less mature than level. ● This is how MyRocks can get into MariaDB 10.2 − Plugin with maturity=alpha.
  • 18. 11:01:01 18 Current status ● MariaDB 10.2.5 RC2 includes MyRocks ● Features ● Packaging ● Quality
  • 19. 11:01:01 19 Current status ● MariaDB 10.2.5 RC2 includes MyRocks ● Features ● Packaging ● Quality
  • 20. 11:00:56 20 Feature status ● Working − General server functionality − Optimizer-related ● Bloom filter support − Tests ● Non-working yet − Interplay between the storage engine and the binlog ● Group commit ● Read-Free-Slave ● GTID − Gap Lock detector
  • 21. 11:01:01 21 diff -u mariarocks myrocks 3K line diff for the code - CMake build changes - MariaDB's differences in Extended Keys - MariaDB's differences in Index Condition Pushdown - MariaDB calls ha_statistic_increment(...) above the storage engine - Implement prepare_*_scan(), Bloom Filter works for ORDER BY DESC - Storage Engine API function signature changes - s/MySQL/MariaDB/ in names of structs, constants, etc - #ifdef-away code related to replication and binlog - #ifdef-away extra diagnostics like SHOW ENGINE TRANSACTION STATUS - ... 8K lines diff for tests: - MariaDB has different default values for SQL columns - EXPLAIN output is slightly different - Handler_xxx counters counted a bit differently - MTR explicitly logs connection open/switch/etc - mysql-test/suite/$MYROCKS_TEST → storage/rocksdb/mysql-test/$MYROCKS_TEST - ...
  • 22. 11:00:56 22 Gap Lock Detector ● SQL level feature ● Detects queries that use gap locking ● Workflow − Run with InnoDB, detect and remove the querie − Migrate to MyRocks ● Objections to pushing − MyRocks has features on SQL layer! ● ?
  • 23. 11:01:01 23 Current status ● MariaDB 10.2.5 RC2 includes MyRocks ● Features ● Packaging ● Quality
  • 24. 11:01:01 24 Packaging in facebook/mysql-5.6 ● MyRocks is linked statically ● RocksDB is a submodule (@revno) − Not a dependency ● Can compile with compression libraries − Snappy − Zlib − ZStandard − ...
  • 25. 11:01:01 25 Packaging in MariaDB ● MyRocks is built as ha_rocksdb.so ● RocksDB is a submodule (@revno) − Linked in statically in the .so ● Compression libraries − Bintar: links statically (snappy, zlib) − .deb/.rpm: package has a dependency (snappy, zlib) − Windows zip/MSI: zlib ● rocksdb_hotbackup is missing − but works (have an MDEV for this)
  • 26. 11:01:01 26 Compiling in MariaDB ● MyRocks is built as ha_rocksdb.so ● MyRocks is compiled by default − Except for unsupported platforms ● MyRocks tests can be run as regular tests ./mysql-test-run rocksdb.type_varchar
  • 27. 11:01:01 27 Current status ● MariaDB 10.2.5 RC2 includes MyRocks ● Features ● Packaging ● Quality
  • 28. 11:01:01 28 MyRocks Quality ● Alpha-maturity plugin in RC-level MariaDB Server ● MyRocks tests are run in MariaDB buildbot ● There are failing testcases − Not necessarily MyRocks bugs − Working on this ● There are missing features − Can finish those that touch only storage/rocksdb − May be harder if the feature touches the SQL layer.
  • 30. 11:01:01 30 Future ● Fix the failing tests − Some failures are from the upstream ● Usability improvements ● Interplay between the Storage Engine and Binlog − Get it to work − MariaDB's Group Commit − Per-engine mysql.slave_gtid_pos − Parallel Slave support? ● Keep merging from upstream.