MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto...

21
© SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

Transcript of MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto...

Page 1: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

MaxScale

The Pluggable Router

Massimiliano Pinto Vilho Raatikka

Page 2: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

MaxScale Objectives

�2

• Highly scalable

• Transparent to the application

• Highly available

• Extendible

• Flexible

• Modules specify what MaxScale is : router / firewall / data extract tool /…

• Open source, GPL2 software since 8th of Jan. 2014

Page 3: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

How? In a nutshell

�3

Allows multiple protocols for clients and servers

Alter, block or log client requests and

results

Configuration and state aware monitors

Content-aware or unaware routers

Client authenticates once - with MaxScale

Core of MaxScale is multi-threaded, event-driven network IO processor

Page 4: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Typical Scenarios

• MySQL Replication with ‣Read connection load balancing ‣Read/Write statement splitting

• Galera Cluster ‣Connection load balancing and conflict avoidance

�4

DatabaseDatabase

Database Database Database

MaxScale

Page 5: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

MySQL Replication with R/W split

For applications that have been designed to work with a single server and require

read scalability

MaxScale monitors the state of each node and selects only

available nodes

Each application uses only 1 connection

DatabaseDatabase

Database Database Database

MaxScale

MaxScale creates 2 connections, one for R/W on the Master node

and one R/O load balanced on the Slave nodes

Page 6: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Database Database Database

MaxScale

Galera Cluster using Connection Load Balancing

For applications that can use the“all-master” capabilities of

Galera

MaxScale load balances the client connections and whenever possible

writes to one node avoiding conflicts

MaxScale monitors the state of each Galera Cluster node and

selects only synced nodes

Each application uses only 1 connection

Page 7: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Inside MaxScale MySQL Local Authentication

�7

“read user info” connect/auth

Users are loaded at start

Backends

Page 8: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Inside MaxScale MySQL Local Authentication

�7

“read user info”

Users are loaded at start

Backends

ok

Page 9: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Inside MaxScale Basic Read Load Balancing

�8

“select * from T1”

Slaves

select a candidate server

Page 10: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014 �9

“call my_proc(1)”

Inside MaxScale Read/Write Splitting

Master

Slaves

!Call parser and

examine parse treeQuery Classifier

Page 11: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Extending with filters

�10

Filter

Router

MaxScale

Router

Filter

Auth Protoco

l

Mon

itorFilter

Router

Mon

itor

© SkySQL Ab 2014

Protoco

l

Protoco

lProtocol

INSERT INTO DWH.T1 (....)

Log Entry

• May be connected to form arbitrary chains

• Allows inspection, modification and rejection of requests and results

‣ blacklist

‣ data mining / log

Routing Hint

Page 12: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Extending with filters

�10

Filter

Router

MaxScale

Router

Filter

Auth

Protocol

Mon

itor

Filter Router

Mon

itor

© SkySQL Ab 2014

Protoco

lProtocol

Protocol

INSERT INTO DWH.T1 (....)

Log Entry

Routing Hint

Page 13: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Extending with filters

�10

Filter

Router

MaxScale

Router

Filter

Auth

Protocol

Mon

itor

Filter Router

Mon

itor

© SkySQL Ab 2014

Protocol

Protocol

Protocol

INSERT INTO DWH.T1 (....)

Log Entry

Routing Hint

Page 14: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Extending with filters

�10

Filter

Router

MaxScale

Router

Filter

Auth

Protocol

Mon

itor

Filter Router

Mon

itor

© SkySQL Ab 2014

Protocol

Protocol

Protocol

INSERT INTO DWH.T1 (....)

Log Entry

Routing Hint

INSERT INTO T1 (....)

Page 15: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Extending with filters

�10

Filter

Router

MaxScale

Router

Filter

Auth

Protocol

Mon

itor

Filter Router

Mon

itor

© SkySQL Ab 2014

Protocol

Protocol

Protocol

INSERT INTO DWH.T1 (....)

Log Entry

Routing Hint

INSERT INTO T1 (....)

Page 16: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Extending with filters

�10

Filter

Router

MaxScale

Router

Filter

Auth

Protocol

Mon

itor

Filter Router

Mon

itor

© SkySQL Ab 2014

Protocol

Protocol

Protocol

INSERT INTO DWH.T1 (....)

Log Entry

Routing Hint

INSERT INTO T1 (....)

Page 17: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Extending with filters

�10

Filter

Router

MaxScale

Router

Filter

Auth

Protocol

Mon

itor

Filter Router

Mon

itor

© SkySQL Ab 2014

Protocol

Protocol

Protocol

INSERT INTO DWH.T1 (....)

Log Entry

Routing HintINSERT INTO T1 (....)

Page 18: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Extending with filters

�10

Filter

Router

MaxScale

Router

Filter

Auth

Protocol

Mon

itor

Filter Router

Mon

itor

© SkySQL Ab 2014

Protocol

Protocol

Protocol

INSERT INTO DWH.T1 (....)

Log Entry

Routing HintINSERT INTO T1 (....)

Page 19: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Extending with filters

�10

Filter

Router

MaxScale

Router

Filter

Auth

Protocol

Mon

itor

Filter Router

Mon

itor

© SkySQL Ab 2014

Protocol

Protocol

Protocol

INSERT INTO DWH.T1 (....)

Log Entry

Routing Hint

INSERT INTO T1 (....)

Page 20: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Extending with filters

�10

Filter

Router

MaxScale

Router

Filter

Auth

Protocol

Mon

itor

Filter Router

Mon

itor

© SkySQL Ab 2014

Protocol

Protocol

Protocol

INSERT INTO DWH.T1 (....)

Log Entry

Routing Hint

INSERT INTO T1 (....)

Page 21: MaxScale FOSDEM 2014€¦ · © SkySQL Ab 2014 MaxScale The Pluggable Router Massimiliano Pinto Vilho Raatikka

© SkySQL Ab 2014

Get involved

�11

• Check on GitHub https://github.com/skysql/MaxScale!

• MariaDB Source https://downloads.mariadb.org/!

• Bugs report!! ! ! http://bugs.skysql.com/buglist.cgi?product=Maxscale !

• Google groups https://groups.google.com/forum/#!forum/maxscale!

• Binary Tarball http://downloads.skysql.com/files/SkySQL/MaxScale!

• SkySQL website http://www.skysql.com

Thank you !