Managing Big Data with Percona Server, XtraBackup, and Tungsten

Robert Hodges CEO, Continuent, Vadim Tkachenko, Founder & CTO, Percona

Agenda
/ Introductions / What Is The Big Data Problem? / Percona Server / XtraBackup / Tungsten / Commercial Services and Support

© Copyright 2011 Percona and Continuent

About Percona
/ Percona is the oldest and largest independent MySQL support and consulting company / Our products:
• Percona Server • Percona XtraBackup

/ We provide consulting, support, training and development for MySQL and LAMP

© Copyright 2011 Percona and Continuent

About Continuent
/ Continuent is the leading provider of data replication and clustering for open source relational databases / Our Products:
• Tungsten Replicator - High-performance, MySQL replication • Tungsten Enterprise - Commercial replication and data management solution for MySQL and PostgreSQL • Consulting on Tungsten plus replication and clustering in general • Subscriptions for commercial products

/ Our Services:

© Copyright 2011 Percona and Continuent

What Is the Big Data Problem?

© Copyright 2011 Percona and Continuent

The Big Data Problem
/ Large quantities of data
• Application performance • Slow server starts

/ High transaction loads / Distributed data

• Resource contention • SQL processing overhead • Datasets replicated across servers and sites • Master failover and slave promotion • Slave lag • Hot backup and restore • System upgrades

/ Continuous, 24x7 Operation

© Copyright 2011 Percona and Continuent

Percona Server

© Copyright 2011 Percona and Continuent

Percona Server
/ Drop-in replacement for MySQL / High performance / Diagnostics / Operations / data management / NOSQL

© Copyright 2011 Percona and Continuent

High Performance
/ Tuned for multi-core multi-disks systems / SSD / Flash optimizations

© Copyright 2011 Percona and Continuent

Diagnostic
/ Advanced statistic on query execution
/ / / / / / / / # User@Host: mailboxer[mailboxer] @ [192.168.10.165] # Thread_id: 11167745 Schema: board # QC_Hit: No Full_scan: No Full_join: No Tmp_table: Yes Disk_tmp_table: No # Filesort: Yes Disk_filesort: No Merge_passes: 0 # Query_time: 0.000659 Lock_time: 0.000070 Rows_sent: 0 Rows_examined: 30 Rows_affected: 0 Rows_read: 30 # InnoDB_IO_r_ops: 1 InnoDB_IO_r_bytes: 16384 InnoDB_IO_r_wait: 0.028487 # InnoDB_rec_lock_wait: 0.000000 InnoDB_queue_wait: 0.000000 # InnoDB_pages_distinct: 5 select count(distinct author_id) from art87.article87 force index (forum_id) where forum_id = 240215 and thread_id = '710575'

/ Additional INFORMATION_SCHEMA tables
CLIENT_STATISTICS INDEX_STATISTICS INNODB_BUFFER_POOL_PAGES INNODB_BUFFER_POOL_PAGES_BLOB INNODB_BUFFER_POOL_PAGES_INDEX INNODB_BUFFER_POOL_CONTENT INNODB_INDEX_STATS INNODB_IO_PATTERN INNODB_RSEG INNODB_SYS_INDEXES INNODB_SYS_TABLES INNODB_TABLE_STATS PROCESSLIST TABLE_STATISTICS USER_STATISTICS
© Copyright 2011 Percona and Continuent

Operations / management
/ Export / Import InnoDB tables / Fast warmup
• Move shard from one server to another • Try copy 100GB user1.table1 from Server1 to Server2 • Periodic dump and load at start content of buffer pool • Very important for big (memory, data) slaves • Hints for queries to ignore caching • FlashCache is Flash/SSD cache layer over regular HDD/RAID

/ Integration with FlashCache

© Copyright 2011 Percona and Continuent

NOSQL
/ HandlerSocket plugin
• Access to data without SQL queries / overhead • Wide range of operations on PK/ index
• Batch, range ( < , >, <= X <= ) access

/ Outstanding performance

• Reported 750,000 request/sec

© Copyright 2011 Percona and Continuent

Percona Server plans
/ Cloud support / Flash/SSD
• Scalability + performance • Continue research and improve performance • You never can have enough statistics 

/ Diagnostic

© Copyright 2011 Percona and Continuent

Introducing Percona XtraBackup

© Copyright 2011 Percona and Continuent

Percona XtraBackup
/ OpenSource hot-backup for MySQL/InnoDB / Free

© Copyright 2011 Percona and Continuent

Designed with big data in mind
/ Non-blocking for InnoDB tables / Streaming directly to backup server / host / Incremental ( differential ) backups / Partial backups / Parallel copy / Minimal actions to setup slave

© Copyright 2011 Percona and Continuent

Non-Blocking
/ Copy InnoDB files in background / Server continues to process workload

© Copyright 2011 Percona and Continuent

Streaming
/ Tar-compatible file / Compress
• innobackupex-1.5.1 --stream=tar ./ > backup.tar
• innobackupex-1.5.1 --stream=tar ./ | gzip - > backup.tar.gz

/ Copy to remote host

• innobackupex-1.5.1 --stream=tar ./ | ssh vadim@desthost "cat - > /data/vol1/mysqluc/backup.tar“

© Copyright 2011 Percona and Continuent

Incremental/Differential
/ Differential
• Copy ONLY changes since last full backup
• Copy ONLY changes since last incremental / differential

/ Incremental

© Copyright 2011 Percona and Continuent

Partial Backup
/ Copy only selected databases / tables
• Databases: user1 user2 … user1000

• You want to copy only user567 database from server1 to server2
• Create new database or import into existing

© Copyright 2011 Percona and Continuent

Setup slave
/ innobackupex-1.5.1 --stream=tar /tmp/ --slave-info | ssh user@DESTSERVER "tar xfi - -C /DESTDIR“ / innobackupex-1.5.1 --apply-log --use-memory=2G /DESTDIR

© Copyright 2011 Percona and Continuent

Percona XtraBackup plans
/ Cloud/S3
• Copy / restore data from cloud storage

/ Compression on table level / Improve incremental and partial backup operations

© Copyright 2011 Percona and Continuent

Introducing Tungsten

© Continuent 2011 2010

© Copyright 2011 Percona and Continuent

What Is Tungsten?
/ / Tungsten Replicator is a fast, open-source replication engine for MySQL Tungsten Enterprise is a complete data management solution based on replication 1. Ensure reliable, fast access to data 2. Simplify common management tasks 3. Increase performance and resource utilization …Without changing applications

© Copyright 2011 Percona and Continuent

Tungsten Replicator Architecture
Master MySQL
Tail binlog or login as client (Replicator configuration)

Tungsten Replicator (replicator)

replicator. properties

Binlogs

Transaction History Log
(Transactions + Metadata)

Transport via TCP/IP connection

Apply using JDBC

Transaction History Log

Tungsten Replicator (replicator)

replicator. properties

Slave

MySQL

© Copyright 2011 Percona and Continuent

Tungsten Replicator: So Many Features
/ Global transaction IDs / Transaction filters / Replicate from MySQL to PostgreSQL & Oracle / Time-delay replication / Backup and restore integration / Cross-version replication: 5.5 -> 5.1 -> 5.0 -> 4.1 / Row and statement replication / Automatic consistency checks / Auto-provisioning / Multi-master replication / Parallel replication
© Copyright 2011 Percona and Continuent

Tungsten Replicator Pipelines (Slave)
Tungsten Replicator Process Pipeline Stage
Extractor Filters Applier Extractor

Stage
Filters Applier

Master THL (via network)

THL Transaction History Log
© Copyright 2011 Percona and Continuent

Slave DBMS

Tungsten Enterprise Architecture
Apache/Mod_PHP
libmysqlclient.a

Apache/Mod_PHP
libmysqlclient.a

Connector

Connector

DBMS
Replicator Manager

DBMS
Replicator Manager

DBMS
Replicator Manager

Slave

Master
© Copyright 2011 Percona and Continuent

Slave

Tungsten Enterprise Management
Business Rules
Cctrl Client

Manager Group Communications

(Coordinator)

Manager

Local DBMS Resources Broadcast commands and monitoring data
Cctrl Client

Local DBMS Resources
Cctrl Client

Manager

Local DBMS Resources
© Copyright 2011 Percona and Continuent

Tungsten Replicator vs. Enterprise
Feature
Simple admin with trepctl (MySQL) Row/Statement 5.0/5.1/5.5 Multi-master replication Parallel apply (2.0) Replication to other DBMS types Distributed management Automated failover and recovery Zero-downtime upgrade SQL routing and load-balancing Floating IP support
© Copyright 2011 Percona and Continuent

Replicator
X X X X X

Enterprise
X X X X X X X X X X

Moving Data: Tungsten Replicator

© Continuent 2011 2010

© Copyright 2011 Percona and Continuent

Big Data and Multi-Master Replication
/ Big data is spread across multiple servers and sites / Many-to-one: consolidate updates from multiple servers into one slave
• Roll-up reporting from remote servers

/ Bi-directional: Updates from two masters propagate to each other
• High-volume merchant apps and distributed directories

/ Cross-site/Cross-Host: Processing distributed over multiple hosts and sites
• Sharded, multi-tenant datasets with centralized data

© Copyright 2011 Percona and Continuent

Multi-Master Data Consolidation
Master Pipeline MySQL
Tungsten Replicator

Slave Pipeline
Tungsten Replicator

MySQL MySQL
Tungsten Replicator Tungsten Replicator

MySQL

Tungsten Replicator
master1 master2

MySQL

MySQL

Direct Pipeline, Multiple Services
© Copyright 2011 Percona and Continuent

Bi-Directional Replication
Replicator Replicator
sjc-remote nyc-local

sjc1

nyc-remote njc-local

nyc1

Replicator

Replicator
nyc-local

sjc2

sjc-local

nyc2

Site SJC

Site NYC

Cool feature: Tungsten slaves remember positions on remote and local masters
© Copyright 2011 Percona and Continuent

Big Data and Failover
/ Slave promotion is a severe problem for high-volume applications with multiple slaves / Tungsten global transaction IDs eliminate binlog hacks to reconfigure slaves / Tungsten epoch numbers prevent re-connection when logs diverge after failover / Say goodbye to binlog hacks for failover!

© Copyright 2011 Percona and Continuent

Global ID and Epoch Number Concepts
Master Transfer log from master
Replicator Replicator

Slave

Replicator Log
Seqn o 1 2 3 4 5 Epoch 1 1 3 3 3 Transaction UPDATE CUST.. INSERT INTO CALL_TAB… DELETE FROM CALL_TAB… UPDATE CUST… UPDATE CALL_TAB…

Backup reloadable on any server

Replicator Log
Seqn o 1 2 Epoch 1 1 3 3 Transaction UPDATE CUST.. INSERT INTO CALL_TAB… DELETE FROM CALL_TAB… UPDATE CUST…

Backup seqno=3

3 4

Epoch numbers prevent inconsistent slaves from connecting
© Copyright 2011 Percona and Continuent

DR Site Enabling with Global IDs
Seqno 35 Epoch 1 Master
Replicator Manager

Floating IP

Seqno 25 Epoch 1

Slave (Relay)
Replicator Manager

Slave
Replicator Manager

Seqno 28 Epoch 1

Seqno 21 Epoch 1

Slave
Replicator

Main Cluster

Backup Backup Backups

Backup Backup Backups

Manager

DR Cluster

© Copyright 2011 Percona and Continuent

Reconfiguration After Failover
Old Master
Replicator Manager

Seqno 35 Epoch 1 (epoch number prevents reconnect as slave)

Seqno 25 Epoch 1

Slave (Relay)
Replicator Manager

Floating IP

New Master
Replicator Manager

Seqno 21 Epoch 1

Seqno 29 Epoch 29
Backup Backup Backups Backup Backup Backups

Slave
Replicator Manager

Main Cluster

DR Cluster

© Copyright 2011 Percona and Continuent

Big Data and Resource Utilization
/ Single-threaded MySQL replication suffers from impedance mismatch between CPU and I/O for highvolume data replication / Tungsten optimizes resource utilization for largescale data transfer / Pipeline parallelism - Spread work across stages / Service parallelism -- Spread work across different replicators and replication services within replicators / Parallel apply -- Spread apply operations across multiple threads

© Copyright 2011 Percona and Continuent

Parallel Slave Apply -- Internals View
Tungsten Replicator Process Pipeline
Stage
Extractor Applier

Stage
Extractor Applier
Parallel Queue

Stage
Extractor Extractor Extractor Applier Applier Applier

Transaction History Log Master THL (via network) THL shard.list file Slave DBMS

© Copyright 2011 Percona and Continuent

Demo: Parallel Apply with TPC-B Tests
TPC-B Test TPC-B Test TPC-B Test

Slave Master
db1 db2 db3
db1 db2 db3

Replicator

Replicator

© Copyright 2011 Percona and Continuent

Future Plans Tungsten Replicator will go fully GPL V2 in 2011! Initial Replicator-Only Builds available in February Keep Watching www.continuent.com

© Copyright 2011 Percona and Continuent

Commercial Services and Support

© Copyright 2011 Percona and Continuent

Continuent Product Subscriptions
/ Per-server subscriptions for Tungsten Enterprise; pricing based on number of DBMS servers / Software-only -- Software license; use consulting for support; bug-fixes are free / Software + Support -- Software license + 24x7 support (SLAs negotiable)

© Copyright 2011 Percona and Continuent

Continuent Consulting
/ Practical consulting by industry experts on any aspect of Tungsten or replication/clustering for open source databases / Hourly support contracts / Projects
• Advice, troubleshooting, bug fixes • Cluster design, roll-outs, upgrades, special replication problems • Implementation of features large and small

/ Sponsored development

/ Offered for both open source and commercial products

© Copyright 2011 Percona and Continuent

Percona Software and Services
/ Consulting
• Our specialties include MySQL architecture and design, diagnosing and solving performance problems, recovering corrupted data, setting up high availability, clustering, and much more. • Expert technical support for MySQL • Insurance against bugs in MySQL • Customized MySQL server binaries • Public and custom onsite • Percona Server with XtraDB 5.1 and 5.5 coming • Percona XtraBackup

/ Support & Maintenance

/ Training

/ Software

© Copyright 2011 Percona and Continuent

Conclusion
/ Big data has a unique set of challenges for MySQL deployments
• • • • Large volumes High transaction rates Distribution across servers and sites Constant availability

/ Percona Server, XtraBackup, and Tungsten address big data problems / Combine Percona and Continuent for your next project!

© Copyright 2011 Percona and Continuent

Contact Information

Continuent, Inc.
560 S. Winchester Blvd., Suite 500 San Jose, CA 95128 Tel +1-866-998-3642 Fax +1-408-668-1009

Percona, Inc.

+1-888-316-9775 or +1-208-473-2904 (USA) +44-208-133-0309 (UK)

e-mail: sales@continuent.com

http://www.percona.com/contact/ sales/

Continuent Web Site: http://www.continuent.com Percona Web Site: http://www.percona.com
© Copyright 2011 Percona and Continuent

Sign up to vote on this title
UsefulNot useful