This document discusses how to get the most out of MariaDB MaxScale. It provides an overview of MariaDB MaxScale and the MariaDB platform. It then demonstrates how MariaDB MaxScale can be used to handle multiple paths and listeners, routing queries using hints, masking data, and rerouting queries. Live demos are shown of these MaxScale features. The document concludes by discussing MaxScale's flexible plugin-based architecture and capabilities for load balancing, failover, and transforming queries.
Report
Share
Report
Share
1 of 32
More Related Content
Getting the most out of MariaDB MaxScale
1. Getting the most out of
MariaDB MaxScale
Anders Karlsson
Principal Sales Engineer
MariaDB Corporation
2. Agenda
● MariaDB MaxScale and MariaDB Platform Overview
● Multiple paths / listeners with MariaDB MaxScale
○ Demo
● Using hints with MariaDB MaxScale
○ Demo
● Data Masking using MariaDB MaxScale
○ Demo
● Query rerouting with MariaDB MaxScale
○ Demo
● Questions / Answers
12. MariaDB MaxScale – Multiple listeners
Clients
Protocol
Protocol
Router
Server State
Monitor
MariaDB Server Backend
Protocol
Filter Router
13. MariaDB MaxScale – Demo setup
● A single MariaDB MaxScale instance, with two hosts
● Accessing a 3-node MariaDB Galera Cluster
$ maxctrl list servers
14. MariaDB MaxScale – Demo setup
● MariaDB MaxScale has 2 services and 2 listeners
$ maxctrl list services
19. MariaDB MaxScale - Hints overview
● Hints use the hints filter
● Hints are sent using SQL comments
● Hints allows you to force a particular query routing
● Routing can be to a specific server
● INSERT INTO t VALUES(1); -- maxscale route to server server1
● Routing can be to a specific role
○ INSERT INTO t VALUES(1); -- maxscale route to master
● Routing can be to the server as the previous query
○ INSERT INTO t VALUES(1); -- maxscale route to last
20. MariaDB MaxScale – Hints configuration
● The hints filter requires no options at all
● Note that you may have several filters
for one service
● The configuration w are using here has
the log filter for one service and the hint
filter for the other
● Note that the mysql command line tool
will strip comments by default!
22. MariaDB MaxScale – The masking filter
● The MariaDB MaxScale data masking filter allows masking of specified
columns
● The masking is transparent to applications
● The masking has several options allowing partial values to be masked, certain
users to be excluded etc.
● Masking can be specified on all columns with a given name or only in certain
databases and/or tables
● Masking can not overridden by using functions
23. MariaDB MaxScale – Masking configuration
● The filter is configured as any other filter in maxscale.cnf
● The actual masking is configured in a separate file in JSON format
26. MariaDB MaxScale - Query rerouting
● Sometimes there is different data on different servers
○ A Data Warehouse servers
○ A reporting server
● Transparent rerouting of queries allows
○ Applications can access all data through the same MariaDB MaxScale server
○ Reporting data can be in a special server and can be moved around, without having
to change applications
28. MariaDB MaxScale – Rerouting configuration
● We assume we add a new reporting
server
● The reporting server replicates from the
Galera Cluster
● The reporting server also has some
unique statistics tables
● Queries to the txhistory table must
always go to the Reporting server
SELECT * FROM txhistory ORDER BY
txtime LIMIT 100
30. Conclusion
● MariaDB MaxScale is a database proxy included in MariaDB Platform
● MariaDB MaxScale has a very flexible architecture based on plugins
● The MariaDB MaxScale primary use case is as a load balancer and for failover
with Replication Clusters and Galera, but many functions can be added
● MariaDB MaxScale handles multiple differently configured paths through the
same MariaDB instance
● MariaDB MaxScale has filters and other plugins for Hints, Data Masking,
Query Redirection and much more
● The current version of MariaDB MaxScale is 2.3