MariaDB for the Enterprise

22
MariaDB for the Enterprise Max Mether @maxmether [email protected] 09.04.2014 © SkySQL Ab. Commercial in Confidence 1

description

Great Wide Open 2014 - Day 1 Max Mether - SkySQL 3:30 PM - Operations 1 (Databases)

Transcript of MariaDB for the Enterprise

Page 1: MariaDB for the Enterprise

MariaDB for the Enterprise Max Mether

@maxmether [email protected]

09.04.2014 © SkySQL Ab. Commercial in Confidence 1

Page 2: MariaDB for the Enterprise

Who is Max ?

Page 3: MariaDB for the Enterprise

A brief history • 1983 - First version of what would become MySQL created by Monty W.

• 1995 – MySQL AB founded

• 2001 Jan – Mårten Mickos joins MySQL as the CEO

• 2005 Oct – Oracle acquires InnoDB (Innobase)

• 2008 Jan – MySQL AB acquired by Sun for $1bn

• 2008 Nov – MySQL 5.1 GA

• 2009 Jan – Monty Program is founded

• 2009 Apr – Oracle acquire Sun for $7.4bn

• 2009 Dec – Oracle makes MySQL promises to EU

09.04.2014

3

Page 4: MariaDB for the Enterprise

A new beginning? • 2010 Feb – MariaDB 5.1 alpha released • 2010 Dec – MySQL 5.5 GA released • 2011 Sep – Oracle: closed source modules for MySQL • 2012 Apr – MariaDB 5.5 GA is released • 2012 Aug – Oracle: closes bugs db and test cases • 2012 Dec – MariaDB Foundation is announced • 2013 Feb – Fedora and OpenSuSE replace MySQL with MariaDB in their

distributions • 2013 Mar – Slackware, Archware follow • 2013 April - SkySQL merges with Monty Program • 2013 June – RHEL announces MariaDB as default • 2014 Mar – MariaDB 10.0 GA

09.04.2014

SkySQL Ab 2011 Confidential 4

Page 5: MariaDB for the Enterprise

MariaDB Versions

09.04.2014 © SkySQL Ab. Commercial in Confidence 5

• MariaDB 5.1 based on MySQL CE 5.1 – MariaDB 5.2 based on MariaDB 5.1

– MariaDB 5.3 based on MariaDB 5.2

• MariaDB 5.5 based on MySQL CE 5.5

• MariaDB 10.0 based on MariaDB 5.5 – Plus features from MySQL 5.6

• MariaDB 10.1 based on MariaDB 10.0 – Plus features from MySQL 5.7

Page 6: MariaDB for the Enterprise

MariaDB Features – Replication

• Multi-source replication (10.0) – Each slave can have multiple masters

• Global Transaction ID (10.0) – Follows the transaction through its life – Based on ”domain” as opposed to UUID

• Parallell slave threads (10.0) – Based on Group Commit instead of schemas

• Original statement logged with RBR events (5.3) • Checksum for binlog events (5.3) 09.04.2014 © SkySQL Ab. Commercial in Confidence 6

Page 7: MariaDB for the Enterprise

Replication before 10.0

09.04.2014 © SkySQL Ab. Commercial in Confidence 7

Page 8: MariaDB for the Enterprise

Replication with 10.0

09.04.2014 © SkySQL Ab. Commercial in Confidence 8

Page 9: MariaDB for the Enterprise

MariaDB Galera Cluster (5.5)

• Combines MariaDB with Galera Cluster

• Provides synchronous replication

• Active – Active nodes

• Works with InnoDB

• No slave lag

• Multi-threaded slave

• Transactions are validated upon commit

• Multi-master possible

09.04.2014 © SkySQL Ab. Commercial in Confidence 9

Page 10: MariaDB for the Enterprise

MariaDB Features - Optimizer • Sub-query optimizations (5.3)

– Subqueries up to several thousand times faster

• Join additions (5.3) – Block nested loop joins for outer joins, Block hash joins, Batch Key

Access

• Optimizations for derived tables and views (5.3) • Disk access optimization (5.3)

– Index Condition Pushdown, Multi-Range Read optimization

• Table Elimination (5.1) • Histogram statistics for non-indexed columns (10.0) • Engine independent statistics (10.0)

– Optimizer no longer reliant on Storage Engine

09.04.2014 © SkySQL Ab. Commercial in Confidence 10

Page 11: MariaDB for the Enterprise

MariaDB Features – Group Commit (5.3)

09.04.2014 © SkySQL Ab. Commercial in Confidence 11

COMMIT

Binary log

XtraDB / InnoDB

3 fsyncs / transaction

2

Page 12: MariaDB for the Enterprise

09.04.2014 © SkySQL Ab. Commercial in Confidence 12

MariaDB Features – Group Commit (5.3)

Page 13: MariaDB for the Enterprise

MariaDB Features – Atomic Writes (5.5)

• Traditionally writes to disk cannot be guaranteed to be completed

– InnoDB uses a doublewrite buffer for safety

• FusionIOs DirectFS supports Atomic Writes

– A write is guaranteed in an all or nothing fashion

• By writing only once

– The flash life time is increased

– The overall throughput is increased

09.04.2014 © SkySQL Ab. Commercial in Confidence 13

Page 14: MariaDB for the Enterprise

MariaDB Features – Performance

• Threadpool (5.1) / (5.5)

– Pools of threads instead of one thread / connection

– Less context switching => increased performance in some usage scenarios

• Segmented Key Cache (5.2)

– Increased concurrency for MyISAM usage

09.04.2014 © SkySQL Ab. Commercial in Confidence 14

Page 15: MariaDB for the Enterprise

MariaDB Features – Storage Engines

• Cassandra (10.0) – An integration of the NoSQL database Cassandra – Write and read data to and from a Cassandra Cluster

• Connect (10.0) – Access data from various formats such as DBase, CSV, DOS, FMT

and XML

• TokuDB (5.5) – High performance on write-intensive workloads

• Spider (10.0) – Transparently split data in same table into several MariaDB

servers

09.04.2014 © SkySQL Ab. Commercial in Confidence 15

Page 16: MariaDB for the Enterprise

MariaDB Features – Statistics

• Improved user statistics (5.2) – CLIENT_STATISTICS – USER_STATISTICS

• Improved table statistics (5.2) – INDEX_STATISTICS – TABLE_STATISTICS

• Improved thread information (10.0) – MEMORY_USAGE – EXAMINED_ROWS

09.04.2014 © SkySQL Ab. Commercial in Confidence 16

Page 17: MariaDB for the Enterprise

MariaDB Features – Security

• Pluggable authentication (5.2)

– PAM Plugin

– Allow other authentication methods

• Audit Plugin (10.0)

– Track user access to data in real time

• Roles (10.0)

– Assign users to roles

09.04.2014 © SkySQL Ab. Commercial in Confidence 17

Page 18: MariaDB for the Enterprise

MariaDB Features – Admin

• ALTER TABLE progress report (5.3) • Online ALTER TABLE (10.0) • SHOW EXPLAIN for <thread_id> (10.0) • EXPLAIN for UPDATE/DELETE (10.0) • Table partitioning improvements (10.0)

– Read directly from partition – EXCHANGE PARTITION

• New PERFORMANCE SCHEMA (10.0) • SHUTDOWN Command (10.0) 09.04.2014 © SkySQL Ab. Commercial in Confidence 18

Page 19: MariaDB for the Enterprise

MariaDB Features – “NoSQL”

• Virtual Columns (5.3) – PERSISTENT or VIRTUAL

• Handler socket (5.3) – Direct access to storage layer

• Simple CRUD operations

• Dynamic Columns (5.3) – Columns with dynamic content

– Implemented as a blob with handling functions 09.04.2014 © SkySQL Ab. Commercial in Confidence 19

Page 20: MariaDB for the Enterprise

MariaDB Features – Dynamic Columns

09.04.2014 © SkySQL Ab. Commercial in Confidence 20

MariaDB [test]> create table t1 (id int auto_increment primary key,

-> name varchar(40),

-> type enum ("shirt", "phone", "computer"),

-> price decimal(10,2),

-> dynstr mediumblob);

Query OK, 0 rows affected (0.11 sec)

MariaDB [test]> insert into t1 (name, type, price, dynstr) values

-> ("Funny shirt", "shirt", 10.0, COLUMN_CREATE(1, "blue", 10, "XL")),

-> ("nokia", "phone", 649, COLUMN_CREATE(1, "black", 2, "touchscreen")),

-> ("htc Desire hd", "phone", 579, COLUMN_CREATE(1, "black", 3, "Android")),

-> ("BM/Lenovo Thinkpad X60s", "computer", 419, COLUMN_CREATE(1, "black", 3, "Linux"));

Query OK, 4 rows affected (0.04 sec)

Records: 4 Duplicates: 0 Warnings: 0

MariaDB [test]> select id, name, type, price, length(dynstr) as len, column_list(dynstr) as list from t1;

+----+-------------------------+----------+--------+------+------+

| id | name | type | price | len | list |

+----+-------------------------+----------+--------+------+------+

| 1 | Funny shirt | shirt | 10.00 | 17 | 1,10 |

| 2 | nokia | phone | 649.00 | 27 | 1,2 |

| 3 | htc Desire hd | phone | 579.00 | 23 | 1,3 |

| 4 | BM/Lenovo Thinkpad X60s | computer | 419.00 | 21 | 1,3 |

+----+-------------------------+----------+--------+------+------+

4 rows in set (0.03 sec)

Page 21: MariaDB for the Enterprise

MariaDB Features – Dynamic Columns

09.04.2014 © SkySQL Ab. Commercial in Confidence 21

MariaDB [test]> select name from t1 where COLUMN_GET(dynstr, 1 as char(10)) = "black";

+-------------------------+

| name |

+-------------------------+

| nokia |

| htc Desire hd |

| BM/Lenovo Thinkpad X60s |

+-------------------------+

3 rows in set (0.01 sec)

MariaDB [test]>

MariaDB [test]> select name, COLUMN_GET(dynstr, 1 as char(10)) from t1 where COLUMN_EXISTS(dynstr, 1);

+-------------------------+-----------------------------------+

| name | COLUMN_GET(dynstr, 1 as char(10)) |

+-------------------------+-----------------------------------+

| Funny shirt | blue |

| nokia | black |

| htc Desire hd | black |

| BM/Lenovo Thinkpad X60s | black |

+-------------------------+-----------------------------------+

4 rows in set (0.00 sec)

Page 22: MariaDB for the Enterprise

Questions? Max Mether

@maxmether [email protected]

09.04.2014 © SkySQL Ab. Commercial in Confidence 22