Maria db the new mysql (Colin Charles)Presentation Transcript
MariaDB: The New MySQL? Colin Charles, Monty Program Abcolin@montyprogram.com | email@example.com http://montyprogram.com/ | http://mariadb.org/ http://bytebot.net/blog/ | @bytebot on Twitter HighLoad++, Moscow, Russia 23 October 2012
whoamiMariaDB guy at Monty Program AbFormerly MySQL AB/Sun MicrosystemsPast lives included Fedora Project (FESCO),OpenOffice.org
Aims32 months, four major releases(5.1,5.2,5.3,5.5) & more (Galera Cluster, 10.0)Discuss the broader MySQL ecosystemThe future of MariaDB
First up...Thank you Oracle & Percona and the largerMySQL community for continuing to do workthat is great
MariaDB is... (currently) Community developed Feature enhanced a better MySQL Fully compatible with MySQL not a fork feature complete
OwnershipMySQL (database) owned by MySQL AB(company) -> Sun -> OracleMonty Program is a (major) sponsor ofMariaDBmaria-captains: 50% MP, 50% communityincluding Sphinxsearch, Twitter, SkySQL,Taobao, Facebook, Percona, Codership, &more
Aims of MariaDB100% compatible, drop-in replacement to MySQL i.e. no changes in connectors, app doesn’t care its MariaDB unless using new features, easy upgrade (uninstall mysql, install mariadb, magic!)Stable (bug-free) releases with no regressionsGPLv2
Compatibility with MySQLNDB cluster included, but not enabled by defaultClient libraries, client server protocol, SQL dialect,master-slave replication all sameData files supported as long as same versionsXtraDB enabled by default now. InnoDB included too &may change to defaultMariaDB Galera Cluster is a separate downloadhttp://kb.askmonty.org/v/mariadb-versus-mysql-compatibility
XtraDBENGINE=InnoDB uses XtraDB by defaultLess checkpointing (smoother), less flushing to disk,stable performance
MariaDB 5.5GA April 2012https://kb.askmonty.org/en/what-is-mariadb-55/Current release: MariaDB 5.5.27By far the most popular release of MariaDBdownloaded, in use, today
MariaDB 5.5: anopensource threadpoolModified from 5.1 (libevent based), great for CPU boundloads and short running queriesWindows (threadpool), Linux (epoll), Solaris (event ports),FreeBSD/OSX (kevents)No minimization of concurrent transactions with dynamicpool size
MariaDB 5.5: Better for DBAsnon-blocking client library start operation, do work in thread, operation processed, result travels back use cases: multiple queries against single server (utilize more CPUs); queries against multiple servers (SHOW STATUS on many machines) fast node.js driver available: mariasqlSELECT now has LIMIT ROWS EXAMINED to consume lessresources SELECT * from t1, t2 LIMIT 10 ROWS EXAMINED 1000;
That’s it?From December 2010 to April 2012, 3 features for a 16 month delay?!?
MariaDB 5.3Biggest change in the optimizer since it waswritten - more complete than MySQL 5.6RC!!!Replication improvementsReleased February 2012Based on the MySQL 5.1 codebase
Better replicationOriginal statements logged with row basedreplication (RBR) eventsChecksum for binlog eventsRBR works for tables with no primary keyConsistent snapshot between storage engines
Group commit in the binary logsync_binlog=1, innodb_flush_log_at_trx_commit=1https://www.facebook.com/note.php?note_id=10150261692455933http://kb.askmonty.org/en/group-commit-for-the-binary-log
MariaDB 5.3: GIS support!MySQL has OpenGIS SFS (Simple featureaccess, SQL access method)Now, SQL with full geometry typesST_ prefixhttp://kb.askmonty.org/en/gis-features-in-533
Optimizer enhancements Join additions block nested loop joins for outer-joins, block hash joins, Batched Key Access (BKA) Optimization for derived tables & views mergeable derived tables processed like VIEWs + optimizer creates indexes over materialized derived tables Disk access optimization Index Condition Pushdown (ICP), Multi-Range Read (MRR)
Subquery optimizations Semi-join optimization, materialization for non- correlated IN queries, subquery cache Goodbye rewriting as JOINs or separate queries DBT-3, 60M rows, 29GB XtraDB
Welcome MySQL 5.6Instant EXPLAINhttps://kb.askmonty.org/en/optimizer-feature-comparison-matrix/
Progress reporting For ALTER TABLE or LOAD DATA INFILEMariaDB [mail]> alter table mail engine = maria;Stage: 1 of 2 copy to tmp table 17.55% of stage doneMariaDB [mail]> select id, user, db, command, state,-> time_ms, progress from information_schema.processlist;+---------+-------------------+-----------+----------+| command | state | time_ms | progress |+---------+-------------------+-----------+----------+| Query | copy to tmp table | 23407.131 | 17.551 |+---------+-------------------+-----------+----------+1 row in set (0.47 sec)
NoSQL access methods Comes with HandlerSocket direct access to XtraDB/InnoDB for CRUD operations Dynamic columns create columns with dynamic content basically a blob with handling functions
MariaDB 5.2Released November 2011Pluggable authentication w/PAM pluginUser statistics: CLIENT_STATISTICS,USER_STATISTICS, INDEX_STATISTICS,TABLE_STATISTICS (userstats=1)Virtual columns - PERSISTENT or VIRTUAL
Still using MyISAM?Mitigates thread contention for key cache lock,with notable performance improvementsKey caches divided into different segments,allowing for better key cache concurrency1-64 segments
SphinxSECREATE TABLE t1 (..) ENGINE=SPHINXCONNECTION=”sphinx://localhost:9312/test”;Engine connects to Sphinx searchdLet indexing, searching, sorting, filtering be performed bySphinx instead of WHERE, ORDER BY, LIMIT Sphinx is optimized/fast for these tasksMost of the Sphinx API is exposed to engineJOIN search table with other MySQL tables
What is Aria?Still just a crash-safe MyISAMused for temporary tables internallygroup commit added in 5.2 to speed up multi-user inserts
How do we support all this? Support LatestVersion Released MySQL till release5.1.42 Feb 2010 Feb 2015 5.1.62 5.1.63 5.2.3 Nov 2010 Nov 2015 5.2.12 5.1.63 5.3.5 Feb 2012 Feb 2017 5.3.8 5.1.655.5.23 Apr 2012 Apr 2017 5.5.28 5.5.28
Oh, and we’re fast Oracle loves MySQL performance on Microsoft Windows. So do weOLTP read-only OLTP write-only
How open is MariaDB?Mailing lists: Launchpad firstname.lastname@example.org email@example.comCode hosting: Launchpad http://launchpad.net/maria/Bugs database/feature worklog: Jira http://mariadb.atlassian.net/#maria on freenode
Deployments!happy users: pap.fr, wabtec, Paybox Services,OLX, Jelastic, Web of Trust, SaltOS, ERP5, etc. “We made the switch on Saturday -- and we’re seeing benefits“MariaDB had these same bugs that we ran into already -- our daily optimizationwith MySQL. However the big difference was that time is down from 24 minutes towhen we reported these bugs, they were quickly just 4 minutes” -- Ali Watters,resolved within 48 hours!” -- Dreas van Donselaar, CEO, travelblog.orgChief Technology Officer, SpamExpertsB.V. after migrating over 300 servers from MySQL5.0 to MariaDB 5.1. “Migrating from MySQL 5.1 to MariaDB 5.2 was as simple as removing MySQL RPMs and installing the MariaDB packages, then running mysql_upgrade.” - Panayot Belchev, proprietor, Host Bulgaria on providing MariaDB to over 7,000 of their web hosting customers.
Other branches MariaD PerconMySQL Percona MySQL MariaDB B a5.5.20 7.7M 61M 5.5.20 222299 15878435.5.22 16M 60M 5.5.22 438567 1540932
What are we missingfrom Percona Server?percona_innodb_buffer_pool_shm - requiresbig shmax not default on many systemspercona_log_slow_query_log-log_slow_verbosity - InnoDB filteringinformation not fully in MariaDBDisabled test suite is resource
Faster even? read only? InnoDB/XtraDB is fineInnoDB has higher throughput, but stalls & checkpoints w/high write load
Track recordWe found the latest MySQL security bug and MariaDB was first to bepatched (sql/password.c & memcmp())We don’t like regressions http://www.skysql.com/blogs/hartmut/nasty-innodb-regression-mysql-5525 http://www.skysql.com/blogs/kolbe/heads-no-more-query-cache-partitioned-tablWe care about backward compatibility & introduce features carefully XtraDB innodb_adaptive_checkpoint=none|reflex|estimate| keep_average (no more reflex...)
We care about qualityAutomated test suite run upon every pushBetter QA & code coverageMySQL test cases: 1,765Percona Server test cases: 1,837MariaDB test cases: 2,180
User stats plugin Disabled by default, consider enabling it to show use! http://mariadb.org/feedback_plugin/data from over 85 countries!
We love the community Tokutek’s TokuDB ships with MariaDB too groonga/spider may be merged next Multiple software packages talk about us (as an alternative to MySQL): Drupal, MediaWiki, Plone, phpMyAdmin, WordPress, etc.
FutureMySQL 5.6 just RC, we have most features in 5.5MariaDB 10.0 new InnoDB inside MariaDB (done) Global transaction ID support Multi-source replication (done) Enhanced semisync replication Persistent InnoDB statistics (done) Cassandra Storage Engine (done), HBase Storage Engine virtual machine for Cassandra made by community!
MariaDB Galera Cluster http://kb.askmonty.org/en/galera/ Scale your read & write Now in ALPHA!workloads, automatically, without the need for NDB Cluster!
Supportmariadb.org/service-providers/SkySQL, Percona, PalominoDB, etc.Monty Program does developer support &NRE http://montyprogram.com/developer-support/
We’re incredibly socialfacebook: fb.com/MariaDB.dbmstwitter: @mariadbgoogle plus: gplus.to/mariadbwe also have a LinkedIn group