24
Mark Riddoch Scalability with MariaDB and MaxScale Reaching New Heights 1 Monday, 22 September 14

Scalability with MariaDB and MaxScale: Reaching New Heights

  • Upload
    mariadb

  • View
    1.604

  • Download
    3

Embed Size (px)

DESCRIPTION

Presented by Mark Riddoch, Chief Architect, at the MariaDB Roadshow in London, 18. Sep. 2014

Citation preview

Page 1: Scalability with MariaDB and MaxScale: Reaching New Heights

Mark  Riddoch

Scalability  with  MariaDB  and  MaxScaleReaching New Heights

1Monday, 22 September 14

Page 2: Scalability with MariaDB and MaxScale: Reaching New Heights

Who  am  I?

•Mark  Riddoch•Chief  Architect  and  designer  for  MaxScale

22Monday, 22 September 14

Page 3: Scalability with MariaDB and MaxScale: Reaching New Heights

Agenda

•What  is  MaxScale?

•How  does  MaxScale  improve  scalability?

•Current  status  of  MaxScale?

33Monday, 22 September 14

Page 4: Scalability with MariaDB and MaxScale: Reaching New Heights

What  Is  MaxScale?Router

ProtocolAuth

entica

tion

Mon

itorFilters

MaxScaleCore

4Monday, 22 September 14

Page 5: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 6: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 7: Scalability with MariaDB and MaxScale: Reaching New Heights

Pluggable  Architecture

•Generic  Core

•Flexible  plugins  provide•Protocol  support•Database  monitoring•Request  filters•Routers•Authentication  support

77Monday, 22 September 14

Page 8: Scalability with MariaDB and MaxScale: Reaching New Heights

MaxScale  Core

•Provides  core  services  for•configuration•networking•scheduling•query  classification•logging•buffer  management•plugin  loading•request  flow

8

MaxScaleCore

8Monday, 22 September 14

Page 9: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 10: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 11: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 12: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 13: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 14: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 15: Scalability with MariaDB and MaxScale: Reaching New Heights

How  does  MaxScale  give  scalability?Router

ProtocolAuth

entica

tion

Mon

itorFilters

MaxScaleCore

15Monday, 22 September 14

Page 16: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 17: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 18: Scalability with MariaDB and MaxScale: Reaching New Heights

Write  Partitioning

•Intended  for  multi-­‐master  environments

•Direct  writes  to  “appropriate”  servers

•Reduce  inter-­‐node  contention  is  clustered  environments

1818Monday, 22 September 14

Page 19: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 20: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 21: Scalability with MariaDB and MaxScale: Reaching New Heights

MaxScale  StatusRouter

ProtocolAuth

entica

tion

Mon

itorFilters

MaxScaleCore

21Monday, 22 September 14

Page 22: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 23: Scalability with MariaDB and MaxScale: Reaching New Heights

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

Page 24: Scalability with MariaDB and MaxScale: Reaching New Heights

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