Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL...

26
©Continuent 2012. Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, CEO Percona

Transcript of Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL...

Page 1: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012.

Industrial-Strength MySQL Applications using Percona

and ContinuentRobert Hodges, CEO Continuent

Peter Zaitsev, CEO Percona

Page 2: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Introducing Continuent

2

• The leading provider of clustering and replication for open source DBMS

• Our Product: Continuent Tungsten

• Clustering - Commercial-grade HA, performance scaling and data management for MySQL

• Replication - Flexible, high-performance data movement

• Optimized for use with Percona Server and XtraBackup

Page 3: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Quick Continuent Facts

• Largest Tungsten clustering installation processes about 500M transactions each day

• Tungsten Replicator was application of the year at the 2011 MySQL User Conference

• Continuent is well known in the MySQL community for its clustering and replication

• Over 80 customers currently deployed

3

Page 4: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Select Continuent Customers

4

Page 5: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Introducing Tungsten Clustering

5

Tungsten clusters combine o!-the-shelf open source DBMS servers into data services with:

• Fast failover• Zero-downtime maintenance • Scaling of load on replicas

...without app changes or data migration

AmazonUS West

apache/php

GonzoPortal.com

Connector Connector

Page 6: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Doesn’t Replication Do This Already?

6

Application

Libmysqlclient.a

Application

Libmysqlclient.a

Replicator

Db2

Replicator

Db3Db1

Replicator

Slave SlaveMaster

Page 7: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Replication Limitations

Replication alone cannot enable constant access to data...

• What happens if the master fails?

• What happens if a slave is lagging too far behind to be usable?

• How do I maintain the DBMS without stopping apps?

7

Page 8: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

From Replicating to Clustering

8

Application

Tungsten Connector

Application

Tungsten Connector

Replicator

Db2

Replicator

Db3Db1

Replicator

Slave SlaveMaster

Manager Manager Manager

Monitoring and Control

Monitoring and Control

Data Service: sjc

Page 9: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Automatic Failover

9

Application

Tungsten Connector

Page 10: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Automatic Failover

10

Application

Tungsten Connector

1. Detect non-responsivemaster

2. Halt master connections

Page 11: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Automatic Failover

11

Application

Tungsten Connector

3. Select most advanced slave and wait for pending transactions to apply

Page 12: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Automatic Failover

12

Application

Tungsten Connector

4. Promote to master, reconfigure slave(s), and re-enable connections

Page 13: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Automatic Failover

13

Application

Tungsten Connector

5. Recover failed master

Page 14: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Rolling Schema Upgrade

14

Final UpgradeSwitchSlave Upgrade Slave Upgrade

• Shun slave 1, run upgrade, and return to cluster. Discard and recover on failure

• Upgrade old master. Cluster schema is now fully upgraded

• Repeat for additional slave(s)

• Switch master to promote an upgraded slave

Page 15: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Backup, Recovery, and Restore

15

• Backups

/cluster  >  datasource  DB1  backup

• Recover

/cluster  >  datasource  DB2  recover

• Restore

/cluster  >  datasource  DB2  restore

• Out-of-box support for XtraBackup/mysqldump; simple integration for others

Page 16: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Tungsten Connector Basics

• Any MySQL/PostgreSQL client can connect

• Initiates connections using JDBC

16

App NativeprotocolCOM_QUERY

COM_INIT_DBCOM_DROP_DB

Connector

Page 17: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Tungsten Connector Basics

• Pass-through operation after connection

• Full transparency & low overhead for clients

17

App

Protocol packetCOM_QUERY

select * from t

ConnectorProtocol packet

OKResultSet Rows:1

Page 18: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Read-Write Splitting Options

1. Explicit connection to slave: Let Tungsten pick a replica with minimum latency

2. Simple read-write splitting: Route auto-commit reads to slaves

3. SmartScale: Writers see their own writes but load balance unrelated reads

18

Page 19: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

SmartScale Session Load Balancing

19

App

Connect/Write

Connector

TransactionHistory Log

Slavereplay

position

Session xSession y

Slave DBMS

MasterDBMS

Slave DBMS

Initial Write

Page 20: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

SmartScale Session Load Balancing

20

AppRead

Connector

TransactionHistory Log

Slavereplay

position

Session xSession y

Slave DBMS

MasterDBMS

Slave DBMS

Read from master

NO read from slave!

Page 21: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

SmartScale Session Load Balancing

21

AppRead

Connector

TransactionHistory Log

Slavereplay

position

Session x

Slave DBMS

MasterDBMS

Slave DBMS

Read from master

Read from slave

Page 22: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

DEMO!

22

Page 23: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Tungsten Does DR Sites Too!

23

App Server+ Connector

App Server+ Connector

Master Slave

San Jose New York

sj_nyc

Page 24: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

How Do I Obtain Tungsten?

24

• Register at Continuent to get clustering downloadshttp://www.continuent.com/downloads/software

• Documentation is available on Continuent website

• Advanced MySQL replication without clustering is available from Tungsten Replicator project on code.google.comhttp://code.google.com/p/tungsten-replicator/

Page 25: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012

Percona + Continuent = Industrial-Strength

• Percona Server and XtraBackup provide reliable, fast data management

• Tungsten extends Percona to enable 24x7 access and improve resource utilization

• Fast failover

• Zero-downtime maintenance

• SQL load balancing

25

Page 26: Industrial-Strength MySQL Applications using Percona and ... · Industrial-Strength MySQL Applications using Percona and Continuent Robert Hodges, CEO Continuent Peter Zaitsev, ...

©Continuent 2012.

Contact:http://www.continuent.com

Blog:www.continuent.com/news/blogs

Contact:http://www.percona.com

Blog:www.mysqlperformanceblog.com

Meet us at Percona Live in London and Santa Clara!