Mark Riddoch
Scalability with MariaDB and MaxScaleReaching New Heights
1Monday, 22 September 14
Who am I?
•Mark Riddoch•Chief Architect and designer for MaxScale
22Monday, 22 September 14
Agenda
•What is MaxScale?
•How does MaxScale improve scalability?
•Current status of MaxScale?
33Monday, 22 September 14
What Is MaxScale?Router
ProtocolAuth
entica
tion
Mon
itorFilters
MaxScaleCore
4Monday, 22 September 14
What is MaxScale?
•Simple Answer•A Classical Proxy• It sits between the database servers and clients and forwards requests
•More Complex Answer•Database aware•Query Router•...with a pluggable architecture
55Monday, 22 September 14
Database Aware Query Router
•Understands the database environment
•Is aware of the state of the database components
•Understands the data that flows through it
•Routes requests based on defined algorithms and the above knowledge
66Monday, 22 September 14
Pluggable Architecture
•Generic Core
•Flexible plugins provide•Protocol support•Database monitoring•Request filters•Routers•Authentication support
77Monday, 22 September 14
MaxScale Core
•Provides core services for•configuration•networking•scheduling•query classification•logging•buffer management•plugin loading•request flow
8
MaxScaleCore
8Monday, 22 September 14
Protocol Plugin
•Provides protocol implements•Client to MaxScale•MaxScale to Database
•Also used for administration protocols
•Potential to allow for non-‐MySQL database protocols
9
Protocol
9Monday, 22 September 14
Authentication Plugin
•Provides for authentication mechanisms•between Client & MaxScale•MaxScale to database
•Responsible for mapping disjoint authentication schemes
10
Authent
icatio
n
10Monday, 22 September 14
Monitor Plugin
•Monitors the database environment
•Provides available and status information
•Tailored to particular database configurations
•Maps to common concepts
11
Mon
itor
11Monday, 22 September 14
Filter Plugin
•A filter may block, modify or log a request as it passes through MaxScale
•Filters may be built up into chains
•Filters may duplicate requests
12
Filter
12Monday, 22 September 14
Router Plugin
•Routes requests to backend database servers using a combination of•Data from monitoring•Routing algorithm•Hints from filters•Request characteristics
•Two classes of router•Connection routing•Statement routing
13
Router
13Monday, 22 September 14
Putting it all together
14
Protoco
l
Router
Protoco
l
Filter
MaxScaleCore
RouterFilter
Auth Protoco
l
Mon
itorFilter
Filter
Router
Mon
itor
Protoco
l
14Monday, 22 September 14
How does MaxScale give scalability?Router
ProtocolAuth
entica
tion
Mon
itorFilters
MaxScaleCore
15Monday, 22 September 14
Traditional Load Balancing
•Connection based router
•Low overhead
•Balances a set of connections over a set of servers•Uses monitoring feedback•Connection weighting
1616Monday, 22 September 14
Read Load Distribution
•Good for traditional replication environments
•Two approaches possible•Either using connection routing with separate read connections•Or statement routing, classify the statements to read, write or session modification
•Monitoring allows for tailoring to particular failover environments
1717Monday, 22 September 14
Write Partitioning
•Intended for multi-‐master environments
•Direct writes to “appropriate” servers
•Reduce inter-‐node contention is clustered environments
1818Monday, 22 September 14
Replication Fan-‐out
•MaxScale acts as a transparent MySQL replication relay
•Reduces load on the master server
•Provides improved group commit semantics over traditional relay servers
•Allows improved master failover semantics
1919Monday, 22 September 14
Binlog Router
20
DatabaseMySQLClient
MySQLBackend
MyS
QLM
on
BinlogRouter
Database DatabaseDatabase Database DatabaseDatabase DatabaseDatabase Database Database Database Database DatabaseDatabase Database DatabaseDatabase DatabaseDatabase Database Database Database
binlog cache binlog cache
MySQLClient
MySQLBackend
MyS
QLM
on
BinlogRouter
20Monday, 22 September 14
MaxScale StatusRouter
ProtocolAuth
entica
tion
Mon
itorFilters
MaxScaleCore
21Monday, 22 September 14
MaxScale Status
•Currently in Beta
•Protocol plugins for MySQL client and server connections, telnet and MaxScale admin connections
•Monitor plugins for MySQL Replication and Galera
•Filter plugins for logging, simple modification and duplication
•Routers for connection routing and read/write splitting
2222Monday, 22 September 14
Under Development
•In development•binlog router -‐ allow MaxScale to be a replication relay server•MySQL cluster monitor•MMM multi-‐master monitor•Query logging via message queues•Canonical query logging•MaxScale hints in queries•Firewall filter
2323Monday, 22 September 14
Where can you find MaxScale?
•Binary packages on the MariaDB website
•Source in GitHub: SkySQL/MaxScale
•Discussion via the Google Group: [email protected]
•Bugs database: http://bugs.skysql.com
•MaxScale blogs: https://mariadb.com/blog-‐tags/MaxScale
2424Monday, 22 September 14