Académique Documents
Professionnel Documents
Culture Documents
• SchoonerSQL Q&A
©
p22012
| © 2011
Schooner
Schooner
Information
Information
Technology,
Technology.
p2 All rights reserved.
20
Real-‐World
Use
Cases
©
p32012
| © 2011
Schooner
Schooner
Information
Information
Technology,
Technology.
p3 All rights reserved.
Part
One
©
p42012
| © 2011
Schooner
Schooner
Information
Information
Technology,
Technology.
p4 All rights reserved.
Parallelism,
or
the
Lack
of
©
p52012
| © 2011
Schooner
Schooner
Information
Information
Technology,
Technology.
p5 All rights reserved.
Answer
to
Parallelism:
SchoonerSQL
4,000,000
6,000,000
3,000,000
4,000,000
3,235,410
3,239,277
2,000,000
1,693,476
1,782,231
2,000,000
1,000,000
0
Percona
5.5.20
Stock
5.5.21
Schooner
SYNC
Schooner
0
ASYNC
Percona
5.5.20
Schooner
Schooner
SYNC
Stock
5.5.21
ASYNC
TPCC-‐mysql
Throughput
@
5000W
2500
2200
2190
2000
500
0
Schooner
5.1.3
Async
Percona
5.5.20
Async
©
p62012
| © 2011
Schooner
Schooner
Information
Information
Technology,
Technology.
p6 All rights reserved.
Flow
Control
©
p72012
| © 2011
Schooner
Schooner
Information
Information
Technology,
Technology.
p7 All rights reserved.
Flow
Control
in
ReplicaSon
©
p92012
| © 2011
Schooner
Schooner
Information
Information
Technology,
Technology.
p9 All rights reserved.
Things
to
Watch
Out
for
in
Parallel
ReplicaSon
ImplementaSons
TransacSon
Ordering
(1/2):
Master
T1
T2
T3
Commit
order
T1
T2
T3
T4
T5
(In
InnoDB
and
binary
log)
©
p10
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p10 All rights reserved.
Things
to
Watch
Out
for
in
Parallel
ReplicaSon
ImplementaSons
TransacSon
Ordering
(2/2):
Slave
or
2nd
Master
T5 T4 T3 T2 T1
T1
T2
T3
Commit
order
T5
T4
T3
T2
T1
(In
InnoDB
and
binary
log)
©
p11
2012
| © 2011
Schooner
Schooner
Information
Information
Technology,
Technology.
p11 All rights reserved.
MySQL
ReplicaSon
Technology
1. Asynchronous
– Oldest, most popular and widely deployed
2. Semi-synchronous
– Introduced in v5.5.
– Objective: avoid many data-loss situations
3. Synchronous (“Virtual Synchrony”, not 2PC)
– Not available from Oracle/ MySQL
– SchoonerSQL: >1 year in production
– XtraDB Cluster: announced last week
©
p12
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p12 All rights reserved.
#1
MySQL
Asynchronous
ReplicaSon
©
p14
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p14 All rights reserved.
#3
SchoonerSQL
Synchronous
ReplicaSon
Master
mysqld
Log
for
tx=100
pushed
to
Slave
Slave
mysqld
Slave
ACK
for
tx=100
Repl.apply(100)
Tx.Commit(101)
Commit
consistency
Y
Y
Y
Y
N
Y
Auto
recovery
with
high
consistency
Medium
High
Medium
High
Medium
High
* Future release
©
p16
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p16 All rights reserved.
Part
Two
©
p17
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p17 All rights reserved.
#1
High
Write
Rate
• Async/ semi-sync
– Issue: Slave lags the Master
– Issue: Master hits limits (code + H/W)
• Typical solutions
– Use more main-memory and/or Flash memory
– Shard database
• SchoonerSQL
– SchoonerSQL is optimized for multi-cores, Flash memory and fast
network
– Master scales vertically with H/W resource (CPU, memory, storage).
– Async and sync Slave have parallel threads for replication that match
the speed of the Master.
©
p18
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p18 All rights reserved.
#2
Read
Scaling
150000
• SchoonerSQL
– Schooner sync supports consistent reads from up to 7 Slaves
– Schooner async allows same unlimited number of Slaves
©
p19
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p19 All rights reserved.
#3
Use
of
Flash
Memory
• Typical solutions
– Use Flash to provide more IOPS to single threaded Slave
– Use Flash for faster random access to read and write database files
• SchoonerSQL
– SchoonerSQL is designed for fast storage (such as Flash memory) to reduce
writes, increase flushing and checkpoint efficiencies, executing more read
and write IOs in parallel.
– Slave parallelism and vertical scalability helps avoid sharding and provides
factors of better price/performance, order of magnitude when compared with
©
p20
2012
disks
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p20 All rights reserved.
#4
High
Availability
(HA)
• Async/ semi-sync
– Issue: MySQL provides weak out-of-the-box availability
– Issue: Replication and application connections are not failed over
• Sync
– Issue: Requires failover of application connections
• Typical solutions
– Use a proxy
– Use Virtual IPs (MMM)
Information
Information
Technology,
Sync
replicaSon
(LAN)
Technology.
Auto
client
connecSon
7)
abi
#4
High
Availability
(HA):
SchoonerSQL
repair
y
Self
healing
#5
Server
Sprawl,
Inefficient
Hardware
USlizaSon
commit/1800s
3,000,000
• Typical solutions
– Use a Slave solely for backups 2,000,000
1,693,476
1,782,231
0
Percona
5.5.20
Schooner
Schooner
SYNC
Stock
5.5.21
ASYNC
• SchoonerSQL
– Provides high consolidation via high
vertical scalability and 2-10X faster Slave replication
©
p23
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p23 All rights reserved.
#5
Server
Sprawl,
Inefficient
Hardware
USlizaSon
SchoonerSQL
VerScal
Scalability
8000
1200
7000
1000
6000
IOPS
5000
800
4000
Read
IOPS
600
3000
Write
IOPS
400
2000
200
1000
0
0
1
4
16
64
1
4
16
64
Total
concurrent
connecPons
Total
concurrent
connecPons
Network
Scalability
30
20
0
Benchmark:
5000
warehouse
TPCC-‐MySQL
1
4
16
64
©
p24
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p24 All rights reserved. Total
concurrent
connecPons
#6
Full
and
Incremental
Backup
• Async/ semi-sync
– Issue: Slave instance may lag due to backup
• Sync
– Issue: Flow control may be triggered slowing down the commits
• Typical solutions
– Reserve a slave solely for backup (non-sync mode)
– Schedule or execute backup during periods with low write activity
– Throttle down backup speed (increasing the time taken to backup)
– Separate storage device and controller for backup target
• SchoonerSQL
– Slave parallelism reduces or eliminates these issues
– Schooner backup includes adaptive throttling to reduce contention
©
p25
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p25 All rights reserved.
#7
WAN
and
MulS-‐Data
Center
Deployments
• Semi-sync/ Sync
– Issue: Increases in network latency slow down commits
– Issue: Failure detection over higher latency networks is slow
• Typical solutions
– Use semi-sync or async within DC (or with metro-area networks)
– Use async for high latency networks (WAN)
• SchoonerSQL
– Use sync and/or async within DC (or with metro-area networks)
– Use async for WAN (automatic failover supported)
– High throughput maintained across WAN, as permitted by network
bandwidth & quality
©
p26
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p26 All rights reserved.
#7
WAN
and
MulS-‐Data
Center
Deployments:
SchoonerSQL
Synchronous
Synchronous
Cluster
Cluster READS
WRITES
READS
READS
READS
READS
WRITES
READS
READS
Parallel
READS
REPL
Async
REPL
Read
Read
REPL
REPL
REPL
Master
REPL
Master
MASTER
MASTER
©
p27
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p27 All rights reserved.
#7
WAN
and
MulS-‐Data
Center
Deployments:
SchoonerSQL
©
p28
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p28 All rights reserved.
#8
Online
Schema
Updates
• Typical solutions
– Use Flash memory for small-medium tables
– Leverage one of several solutions (open-ark, pt-online-schema..)
• SchoonerSQL
– Supports asynchronous and synchronous for an instance.
– Fully compatible with existing mechanisms to update schema.
©
p29
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p29 All rights reserved.
#9
Online
Maintenance
and
Upgrades
• Typical solutions
– Use scripts, manual steps
• SchoonerSQL
– GUI and CLI includes features to migrate an instance to another
server and moving application connections. SchoonerSQL supports
automated full and incremental database provisioning and recovery.
– Automation reduces errors.
©
p30
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p30 All rights reserved.
#10
Minimize
AdministraSon
• Typical solutions
– Add MySQL experienced members on the dev/ops team
• SchoonerSQL
– Auto provisioning of a Peer/ Slave
– Mark a sync instance as Master
– Auto-sync after an instance is restarted
– Schedule full & incremental backups
– Alerts for notification
– State and progress of startup and shutdown
©
p31
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p31 All rights reserved.
#10
Minimize
AdministraSon
SchoonerSQL:
GUI
for
Management
©
p32
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p32 All rights reserved.
#10
Minimize
AdministraSon
SchoonerSQL:
Monitoring
&
Backup
Schedules
©
p33
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p33 All rights reserved.
#10
Minimize
AdministraSon
SchoonerSQL:
Alerts
• Sample alerts
– Instance created/deleted
– Instance up/down
– Instance attached/detached
– Group created/removed
– Async failover
– VIP configuration
©
p34
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p34 All rights reserved.
#11
MySQL
Master-‐Master
Setup
(AcSve/Passive)
• Async/ semi-sync
– Issue: Require quick failover upon active Master’s failure
• Async
– Issue: May loose transactions upon active Master’s failure
• Typical solutions
– Configure two MySQL instances as Master-Master (setup to replicate
to and from each other)
– Use external failure-detection and load (re-) direction mechanisms
(e.g. MMM, Flipper, HAProxy)
• SchoonerSQL
– SchoonerSQL sync cluster setup is similar to an active-passive
Master-Master setup. Automatic failure detection and application
failover is integrated in the solution.
©
p35
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p35 All rights reserved.
#11
MySQL
Master-‐Master
Setup
(AcSve/Passive)
Synchronous Synchronous
Cluster READS
WRITES
Cluster READS
WRITES
READS
READS
READS
WRITES
READS
READS
READS
Instantaneous
Failover
©
p36
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p36 All rights reserved.
#12
MySQL
with
DRBD
Setup
• Async
– Issue: Possibility of data loss when active Master fails & immediate
failover is required
– Issue: Reconnecting Slaves to new Master is not straightforward
• Typical solutions
– Use semi-sync replication in v5.5
– Use DRBD to replicate at physical storage block device level
• SchoonerSQL
– Instead of wasting resources on a stand-by and long failover time
(recovery and warm-up), SchoonerSQL sync cluster provides logical
replication (avoiding corruption propagation in DRBD) with no data
loss, instantaneous failover and automatic failover of replication
connections (sync or async).
©
p37
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p37 All rights reserved.
#13
Resilience
• Sync
– Issue: Sensitive to N/W quality, splits cluster at any fault
– Issue: Read capacity compromised
• Typical solutions
– Semi-sync falls back to async mode
– Async Slaves disconnect without affecting the Master, and reconnect
at a later time
• SchoonerSQL
– Sync falls back to async* without affecting the Master or
compromising the read capacity
©
p38
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p38 All rights reserved.
#14
Point
In
Time
Recovery
(PITR)
• Sync
– Issue: Binary logs within a cluster may not contain transactions in the
same sequence. PITR becomes difficult if the same instance that
created backup files is unavailable.
• Typical solutions
– Backup database and binary log for all or majority of cluster
instances (increases disk space requirements and may cause slow
down during backup)
• SchoonerSQL
– SchoonerSQL Slave instances using any replication type commit in
the same order as Master, even when parallelizing writes. Global
transaction IDs help stitch state of any cluster member. Backup from
one instance of a cluster is sufficient.
©
p39
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p39 All rights reserved.
#15
Delayed
Slave
• Sync
– Issue: Instances in the cluster are in lock-step with Master and do not
read binary log (as an async Slave does)
• SchoonerSQL
– SchoonerSQL supports multiple replication types in the same
database cluster. An async Slave instance can be used for this
purpose.
©
p40
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p40 All rights reserved.
#16
Very
Large
Databases
Commits
/
sec
– Issue: Large databases take longer 1500
to backup Master
1000
700
Slave
500
• Typical solution
0
– Throttle backup and control database size Schooner
5.1.3
Percona
5.5.20
Async
Async
– Use snapshots for backup
• SchoonerSQL
– Adaptive backup helps with file copy based backup
– Parallel Slave replication helps to hide high rate of reads
– Gains seen hard disks as well as Flash
©
p41
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p41 All rights reserved.
#17
Automated
ReplicaSon
Failover
• Async/ semi-sync
– Issue: MySQL does not include failover of replication
• Typical solutions
– Use custom external tool-kits
– Manual work when instances fail
• SchoonerSQL
– Integrated support for failover of all replication types
©
p42
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p42 All rights reserved.
#17
Automated
ReplicaSon
Failover
(with
Sync
replicaSon)
Synchronous Synchronous
Cluster READS
WRITES
Cluster READS
WRITES
READS
READS
READS
WRITES
READS
READS
READS
Instantaneous
Failover
©
p43
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p43 All rights reserved.
#17
Automated
ReplicaSon
Failover
(with
Async
replicaSon)
–
1/2
Synchronous
Synchronous
Cluster
Cluster READS
WRITES
READS
READS
READS
WRITES
READS
READS
READS
READS
REPL
Read
Async
REPL
REPL
REPL
Master
REPL
MASTER
MASTER
©
p44
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p44 All rights reserved.
#17
Automated
ReplicaSon
Failover
(with
Async
replicaSon)
–
2/2
Synchronous
Synchronous
Cluster
Cluster READS
WRITES
READS
READS
READS
READS
READS
READS
READS
Read
REPL
WRITES
Async
REPL
Master
REPL
REPL
MASTER
MASTER
ReplicaPon
Failover
©
p45
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p45 All rights reserved.
#18
Mixed
Hardware
• Async/ semi-sync
– Issue: Smaller hardware for Slave causes it to lag
• Sync
– Issue: Cluster executes commits at the pace of the weakest H/W
• Typical solutions
– Use better (or identical) hardware for Slave servers
– Use Flash memory in Slave servers (alleviate single threaded Slave)
• SchoonerSQL
– SchoonerSQL sync commits at the pace of weakest H/W
– SchoonerSQL async with parallel replication has higher chances of
staying close with Master’s commit speed
©
p46
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p46 All rights reserved.
#19
Virtualized
or
Cloud
Environments
• Typical solutions
– Working-set or database is maintained in main-memory (avoid read
IOs)
– Databases are heavily sharded (to reduce read and write IOs)
• SchoonerSQL
– Support sync only on well provisioned servers, typically with elevated
failure detection timeouts.
– Async provides speedup (parallel threads hide longer latencies)
©
p47
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p47 All rights reserved.
#20
ElasScity
Requirements
• Typical solutions
– Manual work, scripts, proxies
• SchoonerSQL
– Sync instance is online while provisioning another instance
– A click in the GUI provisions a Slave that starts servicing read load. A
click removes an instance from the cluster
– Dynamically add virtual IPs that load balance between instances
©
p48
2012
| © Schooner
2011 Schooner
Information
Information
Technology,
Technology.
p48 All rights reserved.
Part
Three
What is SchoonerSQL ?
www.schoonersql.com
@schoonerinfo