MariaDB - The Future of MySQL?

43
MariaDB - The Future of MySQL? CFCamp 2015 MariaDB - The Future of MySQL? © photoart.com

Transcript of MariaDB - The Future of MySQL?

Page 1: MariaDB - The Future of MySQL?

MariaDB - The Future of MySQL? CFCamp 2015

MariaDB - The Future of MySQL?

© photoart.com

Page 2: MariaDB - The Future of MySQL?

MySQL Brief Histor y

Page 3: MariaDB - The Future of MySQL?

• Developed by Monty Widenius and David Axmark

• Named after Montys daughter My• First release was v3.1 in 1997• Acquired by Sun Microsystems in 2008• Oracle acquired Sun Microsystems in

January 2010• v5.6 released in Febuary 2013

MySQL

Page 4: MariaDB - The Future of MySQL?

MariaDB Brief Histor y

Page 5: MariaDB - The Future of MySQL?

• Forked by Monty Widenius• Named after Montys younger daughter

Maria• First release v5.1 in October 2010• MariaDB Foundation announced in

December 2012 by Monty Widenius and David Axmark

• v10.1 released in June 2014

MariaDB

Page 6: MariaDB - The Future of MySQL?

• Starts with v5.1• v5.2 and v5.3 were service releases• v5.5 ist the last version that ist officially

binary compatible• After 5.5 MariaDB continued with v10+• v10+ not guaranteed to be binary

compatible• v10.1 application level compatible

MariaDB

Page 7: MariaDB - The Future of MySQL?

Companies supporting MariaDB

• Google• Wikipedia• Mozilla• booking.com

MariaDB

Page 8: MariaDB - The Future of MySQL?

Linux Distributions with MariaDB as default Database• Fedora• Gentoo• openSUSE (from 12.3)• Red Hat Enterprise Linux (from 7)• CentOS 7• Oracle Linux (from 7)

MariaDB

Page 9: MariaDB - The Future of MySQL?

Why MariaDB

Page 10: MariaDB - The Future of MySQL?

• Founded by the original MySQL team• Only DB software by this Foundation• Faster development• Open development (look at github)• Quick and transparent security releases• More storage engines

MariaDB

Page 11: MariaDB - The Future of MySQL?

• Better Performance• Easy migration• Master - Master Replication (with Galera

Cluster)• Compatible with default MySQL JDBC

Connector in CF10 / 11• MySQL future unclear

MariaDB

Page 12: MariaDB - The Future of MySQL?
Page 13: MariaDB - The Future of MySQL?

Galera Cluster

Page 14: MariaDB - The Future of MySQL?

Galera Cluster

Page 15: MariaDB - The Future of MySQL?

• Multi Master Replication • Client can connect to

any node• Read and write access

to any node• Synchronous

Replication

Galera Cluster

Page 16: MariaDB - The Future of MySQL?

Galera Cluster

commit

Galera Replication

ok

Transaction processed on node upon commit

Transaction replicated to cluster

Client gets ok

Transaction applied to slaves

Page 17: MariaDB - The Future of MySQL?

• Distributed with MariaDB since v10.19• Works in LAN and WAN• No Impact on reads / transactions• Commits slower• Needs odd number of nodes (quorum)• Will be slower with high numer of

nodes

Galera Cluster

Page 18: MariaDB - The Future of MySQL?

Galera Cluster

Cluster Partitioning:

• Majority partition has quorum

• Minority cannot commit and will try to reconnect

Page 19: MariaDB - The Future of MySQL?

Galera Cluster

Cluster Partitioning:

• Majority partition has quorum

• Minority cannot commit and will try to reconnect

Page 20: MariaDB - The Future of MySQL?

Galera Cluster

Moving to galera cluster in live environment

MySQL Master

MySQL Slave

Page 21: MariaDB - The Future of MySQL?

Galera Cluster

Moving to galera cluster in live environment

MySQL Master

MySQL Slave

GaleraNode 1

Page 22: MariaDB - The Future of MySQL?

Galera Cluster

Moving to galera cluster in live environment

MySQL Master

MySQL Slave

GaleraNode 1

GaleraNode 2

GaleraNode 3

Page 23: MariaDB - The Future of MySQL?

Galera Cluster

Moving to galera cluster in live environment

MySQL Master

MySQL Slave

GaleraNode 1

GaleraNode 2

GaleraNode 3

Page 24: MariaDB - The Future of MySQL?

Galera Cluster

Moving to galera cluster in live environment

GaleraNode 1

GaleraNode 2

GaleraNode 3

Page 25: MariaDB - The Future of MySQL?

Galera Cluster

Moving to galera cluster in live environment

GaleraNode 1

GaleraNode 2

GaleraNode 3

Page 26: MariaDB - The Future of MySQL?

• Can be mixed with standard replication • Galera node can act as MySQL Master

or Slave• Offers high availability• Slightly slower on commits• Can be used with MaxScale as

Loadbalancer

Galera Cluster

Page 27: MariaDB - The Future of MySQL?

MaxScale

Page 28: MariaDB - The Future of MySQL?

• Loadbalancer for MySQL and MariaDB offers:

• Support for different Client and backend protocols

• Request filtering• Routing and load balancing• Authentication and Monitoring• Nagios Plugin

MaxScale

Features

Page 29: MariaDB - The Future of MySQL?

• Support for MySQL / MariaDB connectors

• Works with CF10/11 MySQL or MariaDB JDBC Connector

• Support for MySQL/MariaDB replication• Support for Galera Cluster

MaxScale

Cl/ent and Backend

Page 30: MariaDB - The Future of MySQL?

• Offers routing and load balancing• Connection (port) based routing:

doesn’t examine requests• Statement based Routing: examines

requests based on given statements• Rewrite SQL queries based on regular

expressions• Query duplication (second database)

MaxScale

Rout/ng and Loadbalanc/ng

Page 31: MariaDB - The Future of MySQL?

MaxScale

GaleraNode 1

GaleraNode 2

GaleraNode 3

GaleraNode 4

GaleraNode 5

MaxScale

CF Server

read/write

r/w r/w r/w r/w r/w

Loadbalanc/ng

Page 32: MariaDB - The Future of MySQL?

MaxScale

GaleraNode 1

GaleraNode 2

GaleraNode 3

GaleraNode 4

GaleraNode 5

MaxScale

CF Server

read/write

w r r r r

Read / Wr/te

Page 33: MariaDB - The Future of MySQL?

MaxScale

GaleraNode 1

GaleraNode 2

GaleraNode 3

GaleraNode 4

GaleraNode 5

MaxScale

CF Backend

r/w

w r r r r

CF Front A CF Front B

r/wr/w

ww rr

dd some colors…

Page 34: MariaDB - The Future of MySQL?

MaxScale

Shard 1 Shard 2 Shard 3 Shard 4 Shard 5

MaxScale

CF Server

Shard/ng

Page 35: MariaDB - The Future of MySQL?

• Rewrite Queries:e.g. replace „engine“ with „type“ for CREATE statements

• Block Queries:e.g. block queries with „OR“ operators on table „users“

MaxScale

F/rewall and rewr/te

Page 36: MariaDB - The Future of MySQL?

• Separates Database and application logic• Allows simple scaling of database

without influencing application logic• Allows high availability / failover

configuration• Easy maintenance

MaxScale

Page 37: MariaDB - The Future of MySQL?

• Visible as one MariaDB Server to CF• Easy to use for Developers as DB

clustering / scaling doesn't have to be integrated in applications

• Change in cluster doesn't influence application logic

• Focus on Application, not DB

MaxScale

Page 38: MariaDB - The Future of MySQL?

What about ColdFusion?

Page 39: MariaDB - The Future of MySQL?

• ColdFusion / Lucee are compatible to MariaDB without restrictions

• Use standard MySQL driver• No change in application logic needed• Some restrictions to MaxScale (check

User Permissions, Stored Procedures)• When using MaxScale, try to separate

Read/Write requests to DB

ColdFusion

Page 40: MariaDB - The Future of MySQL?

Conclusion(at least for us…)

Page 41: MariaDB - The Future of MySQL?

• Faster development and more features• Galera cluster and Maxscale load-

balancer „out of the box“• Easy migration• Compatible with ColdFusion / Lucee,

again out of the box• …and somehow it just feels „smarter“

MariaDB

Page 42: MariaDB - The Future of MySQL?

Find these slides and much more stuff at

www.bokowsky.net/de/knowledge-base/

Page 43: MariaDB - The Future of MySQL?

Thank you

Matthias [email protected]

Bokowsky + Laymann GmbHwww.bokowsky.de@BokowskyLaymannalso on Facebook, Slideshare, YouTube, Flickr

P.S: Bokowsky + Laymann is looking for ColdFusion Developers

[email protected] - or any social network of your choice