Percona Live Europe 2016 Launching Vitess
Anthony Yeh, Dan Rogart Amsterdam, Netherlands | October 3 – 5, 2016
Percona Live Europe 2016 Launching Vitess Anthony Yeh, Dan Rogart - - PowerPoint PPT Presentation
Percona Live Europe 2016 Launching Vitess Anthony Yeh, Dan Rogart Amsterdam, Netherlands | October 3 5, 2016 Overview http://vitess.io Why Vitess? Their App YouTube Your App Their Vitess Vitess Sharding Magic Sharding Magic
Anthony Yeh, Dan Rogart Amsterdam, Netherlands | October 3 – 5, 2016
http://vitess.io
3
4
○ Many ways to scale; this is one. ○ More on those opinions next.
○ Huge problems get easier. ○ Simple things get more complex.
○ Understands the query. ○ Generates queries of its own.
○ ... yet. ○ This talk is about the gaps.
http://vitess.io/user-guide/launching.html
7
8
○ sync_binlog off
○ semisync ○ lossless failover ○ routine reparent
○ Same guarantees as MySQL
○ May fail partially across shards ○ Work in progress on 2PC
○ Even with 2PC, may read from shards in different states
9
○ Possible shared fate within cell ○ But failures shouldn't propagate
○ Survive fiber cuts, regional outages ○ Lower regional read latency
○ Writes redirected at frontend ○ Only one inter-cell roundtrip ○ DB writes intra-cell
○ e.g. etcd, ZooKeeper
○ Quorum across multiple cells ○ Survives any given cell death
○ Quorum within a single cell ○ Independent of any other cell
11
○ Use real schema ○ Test sharding
○ Small footprint to run on 1 machine ○ Emulate a full cluster for tests ○ Loads schema from .sql files ○ 1 vtcombo = all Vitess servers ○ 1 mysqld = all shards
○ Client-side prepared statements ○ Vitess query plan cache
○ master: writes, read-after-write ○ replica: live site read traffic ○ rdonly: batch jobs, backups
○ Vitess SQL parser is incomplete ○ Report important use cases
12
○ Rewrite to PK lookups
13
○ Prometheus, InfluxDB
○ Realtime fleet-wide health map
14
○ Restores every day
○ Filesystem (NFS, etc.) ○ Google Cloud Storage ○ Amazon S3 ○ Ceph
Tribute
16
○ Custom Vindex
Dan Rogart, YouTube SRE
18
19
20
21
shard vtgate mysqld vttablet master vtgate decider mysqld vttablet mysqld vttablet replicas mysqld vttablet batch replicas mysqld vttablet vtctld
22
23
24
25
26
27
shard 1 mysqld vttablet master mysqld vttablet mysqld vttablet replicas shard 0 mysqld vttablet master mysqld vttablet mysqld vttablet replicas unsharded mysqld vttablet master mysqld vttablet mysqld vttablet replicas vtworker
source
target
diff to target
28
shard 1 mysqld vttablet master mysqld vttablet mysqld vttablet replicas shard 0 mysqld vttablet master mysqld vttablet mysqld vttablet replicas unsharded mysqld vttablet master mysqld vttablet mysqld vttablet replicas vtworker
source
target
diff to target
29
shard 1 mysqld vttablet master mysqld vttablet mysqld vttablet replicas shard 0 mysqld vttablet master mysqld vttablet mysqld vttablet replicas unsharded mysqld vttablet master mysqld vttablet mysqld vttablet replicas
tablets connect to a source replica
apply statements that belong in that shard
replicated on target to survive restarts
30
31
32