Upload
mariadb
View
640
Download
1
Embed Size (px)
DESCRIPTION
MaxScale - The Pluggable Router by Serge Frezefond. Presented 26.6.2014 at the MariaDB Roadshow in Paris, France.
Citation preview
© SkySQL Corpora-on Ab. Company Confiden-al.
MaxScale – The Pluggable Router Serge Frezefond,
Cloud Solution Architect, SkySQL
© SkySQL Corpora-on Ab. Company Confiden-al.
MaxScale Objec-ves
• Highly scalable • Transparent to the applica-on • Highly available • Extendible • Flexible • Modules specify what MaxScale is : router / firewall / data extract tool /…
• Open source, GPL2 soSware since 8th of Jan. 2014
© SkySQL Corpora-on Ab. Company Confiden-al.
How? In a nut shell
Core of MaxScale is mul--‐threaded, event-‐driven network IO processor
10/06/2014
Client authen-cates once -‐ with MaxScale
Alter, block or log client requests and results
Content-‐aware or unaware routers
Configura-on and state aware monitors
Allows mul-ple protocols for clients and servers
© MariaDB. Company Confiden-al.
Read Scalability with MySQL Replica-on using MaxScale’s Connec-on Load Balancing
Client Client Client For applica*ons that need read scalability and load balancing and can use separate connec*ons for reads and writes.
Each client establishes one connec-on for writes and one for reads
Master Slave Slave
[write service] type=service router=readconnroute router_options=master servers=s1,s2,s3,..,sn
[read service] type=service router=readconnroute router_options=slave servers=s1,s2,s3,..,sn
Slave Slave ...
© MariaDB. Company Confiden-al.
Consistent Read Scalability with Galera using MaxScale’s Read/Write Split Router
Client Client Client For applica*ons that require read scalability with consistent reads and High Availability with fast failovers.
MaxScale selects one as a master and one or more cluster members to slave(s)
If node fails a new master can be chosen immediately.
© MariaDB. Company Confiden-al.
Query rewrite and filtering by using MaxScale’s filters
Client Client Client For applica*ons with mul*ple different backend databases. For database firewalling, etc.
CREATE TABLE SUPPLIER(ID INTEGER, NAME VARCHAR) TYPE=INNODB
[regex] type=filter module=regexfilter match=TYPE replace=ENGINE
CREATE TABLE SUPPLIER(ID INTEGER, NAME VARCHAR) ENGINE=INNODB
© MariaDB. Company Confiden-al.
Query rewrite and filtering (cont.) by using MaxScale’s filters
Client Client Client For sloppy administrators :-‐)
Select count(*) f0rm mysql.user
[regex] type=filter module=regexfilter match=[Ff][Oo0][Rr][Mm] replace=FROM
Select count(*) FROM mysql.user
© MariaDB. Company Confiden-al.
MaxScale 0.7
● Galera support ○ Read/Write Split router for Galera Cluster
● Multiple slaves support
○ Read/Write Split router allows multiple slave connections and balancing load between them
● Debug Interface enhancements ○ Support for wide variety of MaxScale objects which can be referenced by their names instead of memory
addresses ○ User mode to prevent access by using memory addresses
● Maintenance mode for servers ● Configurable monitoring interval ● Replication Lag Heartbeat Monitor ● Filters API ● MariaDB 10 Replication support in MySQL monitor
Release notes: https://github.com/skysql/MaxScale/blob/release-0.7/Documentation/Debug%20And%20Diagnostic%20Support.pdf
© MariaDB. Company Confiden-al.
Basic Setup
● Clients access MaxScale ● MaxScale in the app server,
UNIX sockets ● Database servers accessed
via TCP
● Clients ● Applica-on Server
Database Cluster
© MariaDB. Company Confiden-al.
Typical Scenarios
● MySQL Replica-on with ● Read connec-on load
balancing ● Read/Write statement
splilng ● Galera Cluster
● Connec-on load balancing ● Read/Write statement
splilng ● Write conflict avoidance
(planned)
© MariaDB. Company Confiden-al.
Inside MaxScale MySQL Local Authen-ca-on
Backends Clients
ok
“read user, host” connect/auth
Users are loaded at start
© MariaDB. Company Confiden-al.
Inside MaxScale Read/write splilng
“call my_proc(1)”
Master
Slave
Query Classifier
© MariaDB. Company Confiden-al.
Inside MaxScale Rou-ng
© MariaDB. Company Confiden-al.
Inside MaxScale Rou-ng
© MariaDB. Company Confiden-al.
What’s new in R/W split router
● Session Commands ● Local variables, User change,
SET auto commit ● Execute in master & slave but
maintain execu-on order ● Current limita-on : queries not
supported in session commands
SET @a=(SELECT COUNT(*) FROM mysql.user) is executed in both nodes. ● Galera H/A Support
● Fault Tolerance ● Replica-on consistency ● Transac-on support
● Within ac-ve transac-on everything is routed to master
● Detec-on of implicit BEGIN and ROLLBACK/COMMIT
© MariaDB. Company Confiden-al.
What’s coming
● Filters ● Rou-ng hints ● Mul-ple Slave Support ● Weight based rou-ng ● Backend failure tolerance ● Enforce Node Replica-on consistency for MariaDB 10 & MySQL 5.6
© MariaDB. Company Confiden-al.
Extending with filters
● May be connected to form arbitrary chains ● Allows inspec-on, modifica-on and rejec-on of requests and results
● blacklist ● data mining / log
© MariaDB. Company Confiden-al.
Get involved
● Check on GitHub hsps://github.com/skysql/MaxScale ● MariaDB Source hsps://downloads.mariadb.org/ ● Bugs report
hsp://bugs.skysql.com/buglist.cgi?product=Maxscale ● Google groups
hsps://groups.google.com/forum/#!forum/maxscale ● Binary Tarball
hsp://downloads.skysql.com/files/SkySQL/MaxScale ● SkySQL website hsp://www.skysql.com
© MariaDB. Company Confiden-al.
MaxScale -‐ Thank you!