Upload
bokowsky-laymann-gmbh
View
580
Download
0
Embed Size (px)
Citation preview
MariaDB - The Future of MySQL? CFCamp 2015
MariaDB - The Future of MySQL?
© photoart.com
MySQL Brief Histor y
• 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
MariaDB Brief Histor y
• 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
• 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
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
Why MariaDB
• 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
• Better Performance• Easy migration• Master - Master Replication (with Galera
Cluster)• Compatible with default MySQL JDBC
Connector in CF10 / 11• MySQL future unclear
MariaDB
Galera Cluster
Galera Cluster
• Multi Master Replication • Client can connect to
any node• Read and write access
to any node• Synchronous
Replication
Galera Cluster
Galera Cluster
commit
Galera Replication
ok
Transaction processed on node upon commit
Transaction replicated to cluster
Client gets ok
Transaction applied to slaves
• 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
Galera Cluster
Cluster Partitioning:
• Majority partition has quorum
• Minority cannot commit and will try to reconnect
Galera Cluster
Cluster Partitioning:
• Majority partition has quorum
• Minority cannot commit and will try to reconnect
Galera Cluster
Moving to galera cluster in live environment
MySQL Master
MySQL Slave
Galera Cluster
Moving to galera cluster in live environment
MySQL Master
MySQL Slave
GaleraNode 1
Galera Cluster
Moving to galera cluster in live environment
MySQL Master
MySQL Slave
GaleraNode 1
GaleraNode 2
GaleraNode 3
Galera Cluster
Moving to galera cluster in live environment
MySQL Master
MySQL Slave
GaleraNode 1
GaleraNode 2
GaleraNode 3
Galera Cluster
Moving to galera cluster in live environment
GaleraNode 1
GaleraNode 2
GaleraNode 3
Galera Cluster
Moving to galera cluster in live environment
GaleraNode 1
GaleraNode 2
GaleraNode 3
• 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
MaxScale
• 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
• 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
• 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
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
MaxScale
GaleraNode 1
GaleraNode 2
GaleraNode 3
GaleraNode 4
GaleraNode 5
MaxScale
CF Server
read/write
w r r r r
Read / Wr/te
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…
MaxScale
Shard 1 Shard 2 Shard 3 Shard 4 Shard 5
MaxScale
CF Server
Shard/ng
• 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
• Separates Database and application logic• Allows simple scaling of database
without influencing application logic• Allows high availability / failover
configuration• Easy maintenance
MaxScale
• 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
What about ColdFusion?
• 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
Conclusion(at least for us…)
• 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
Find these slides and much more stuff at
www.bokowsky.net/de/knowledge-base/
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