MariaDB Server 10.2 - The Complete Guide Webminar
MariaDB Server 10.2 - The Complete Guide Webminar
2:
The somewhat
Complete Guide
Colin Charles, Chief Evangelist, Percona Inc
[email protected] / [email protected]
http://bytebot.net/blog/ | @bytebot on Twitter
Originally at Percona Live Santa Clara, California, USA
on 26 April 2017, now as a webminar on 27 June 2017
License
• Creative Commons BY-NC-SA 4.0
• https://creativecommons.org/licenses/by-nc-sa/
4.0/legalcode
whoami
• Chief Evangelist (in the CTO office), Percona Inc
• Founding team of MariaDB Server (2009-2016),
previously at Monty Program Ab, merged with
SkySQL Ab, now MariaDB Corporation
• Formerly MySQL AB (exit: Sun Microsystems)
• Past lives include Fedora Project (FESCO),
OpenOffice.org
• MySQL Community Contributor of the Year Award
winner 2014
3
What is MariaDB
Server?
4
What is MariaDB Server,
really?
• GPLv2 fork of MySQL 5.5 with lots of added
community development
• Different features
• MariaDB Foundation
• Thread pool v1
• Pluggable authentication
• User statistics
MariaDB Server 5.3
• Optimiser, optimser, optimiser - https://
mariadb.com/kb/en/mariadb/optimizer-feature-
comparison-matrix/
• HandlerSocket
• Dynamic columns
MariaDB Server 5.5
• Threadpool v2
• http://mariadb.org/
• Replication
• Window functions
• https://www.percona.com/live/17/sessions/
common-table-expressions-and-window-
functions-simple-maintainable-fast-queries
Client & protocol
• https://mariadb.com/kb/en/mariadb/constraint/
• https://mariadb.com/kb/en/mariadb/create-table/#default
• Default replicate_annotate_row_events is ON
• Slides: https://www.percona.com/live/17/
sessions/flashback-rolling-back-mysqlmariadb-
instance-database-or-table-previous-snapshot
JSON & GeoJSON
• https://www.percona.com/live/17/sessions/
mariarocks-myrocks-mariadb
Manageability
• SQL Roles
• Kerberos authentication
• High Availability
• High Performance
• Operational Ease
• New file_key_management_filename,
file_key_management_filekey,
file_key_management_encryption_algorithm
customer_name varchar(80),
customer_creditcard varchar(20))
ENGINE=InnoDB
page_encryption=1
page_encryption_key=1;
Encryption IV
• Tablespace encryption (Google)
• innodb-encryption-threads=4
• innodb-encryption-rotate-key-age=1800
Encryption V
• /etc/my.cnf.d/enable_encryption.preset
• This does not work with MariaDB Galera Cluster yet (gcache is not
encrypted yet), and also xtrabackup needs additional work (i.e. if
you encrypt the redo log)
Password validation
• simple_password_check password validation plugin
• a MYSQL_AUDIT_PLUGIN
• a MYSQL_AUDIT_PLUGIN
CHANGE MASTER TO
master_host="192.168.2.4",
master_use_gtid=slave_pos;
START SLAVE;
Multi-source replication
• Work from Taobao/Alibaba
• Granular monitoring in
INFORMATION_SCHEMA —
WSREP_MEMBERSHIP, WSREP_STATUS
Optimistic parallel
replication
• Before, transactions committed in parallel on the
master could be run in parallel
• https://mariadb.atlassian.net/browse/MDEV-6676
The parallel replication
slides to review
• MySQL/MariaDB Parallel Replication: inventory,
use cases and limitations by Jean-François
Gagné
• https://www.percona.com/live/17/sessions/
mysqlmariadb-parallel-replication-inventory-use-
cases-and-limitations
Replication: START TRANSACTION
WITH CONSISTENT SNAPSHOT
• Works with the binlog, possible to obtain the binlog position
corresponding to a transactional snapshot of the database without
blocking any other queries.
• https://kb.askmonty.org/en/enhancements-for-start-transaction-with-
consistent/
More in replication
• Enhanced semi-sync replication (like in 5.7 -
thanks FB/Google)
• thread_handling=pool-of-threads
• https://mariadb.com/kb/en/mariadb/thread-pool-in-mariadb/
• I_S.INNODB_SEMAPHORE_WAITS, I_S.INNODB_MUTEXES
• SET STATEMENT
max_statement_time=1000 FOR SELECT
name FROM name ORDER BY name;
Statement timeouts
• https://mariadb.atlassian.net/browse/MDEV-4427
Enhanced KILL syntax
• HARD | SOFT & USER USERNAME are MariaDB-specific (5.3.2)
+---------+-------------------+-----------+----------+
+---------+-------------------+-----------+----------+
+---------+-------------------+-----------+----------+
• Histograms
• ANALYZE <statement>
• includes data from the query execution itself — this is MariaDB only
• https://mariadb.com/kb/en/mariadb/analyze-formatjson-examples/
The Histogram slide deck to
review
• https://www.percona.com/live/17/sessions/
histograms-mysql-and-mariadb
CONNECT
• CONNECT having full JSON/BSON support
• INFORMATION_SCHEMA.SYSTEM_VARIABLES -
information for system variables
• Microseconds in GET_LOCK()
Other bits
• Compiled with security hardening options (fortify
source - https://mariadb.atlassian.net/browse/
MDEV-5730)
• default_tmp_storage_engine option
• see: https://mariadb.com/kb/en/mariadb/mariadb-vs-mysql-
compatibility/
The 10.1 “Community
Release”
• Google - encryption, scrubbing, • Daniel Black - finer grained status
enhanced semisync, dump variables for replication monitoring
thread, thd_specifics plugin
service • FusionIO - atomic writes, page
compression, TRIM, multi-
• Eperi - encryption threaded flushing
• Table/tablespace • cracklib_password_che
encryption ck
5. Building a Web Application with PHP & MariaDB: A Reference Guide, Sai
Srinivas Sriparasa (June 2014)
• https://mariadb.com/kb/en/mariadb/what-is-
mariadb-103/
• Wide distribution
Percona Live Europe Call for Papers &
Registration are Open!
www.percona.com/live/e17
76 © 2017 Percona
Thank you!
Colin Charles
[email protected] / [email protected]
http://bytebot.net/blog | @bytebot on twitter
slides: slideshare.net/bytebot