vitess (vitess.io) - percona · 2017-05-02 · battle tested for 6 years at youtube site...

19
Vitess (vitess.io) Sugu Sougoumarane [email protected] ssougou.blogspot.com @ssougou “Red Bugatti Veyron on the Road” by Axion23 Gopher by Renee French

Upload: others

Post on 25-Mar-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Vitess (vitess.io)

Sugu [email protected] @ssougou

“Red Bugatti Veyron on the Road” by Axion23Gopher by Renee French

Page 2: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

MissionTo be the best performing, scalable and most

available NewSQL storage solution in the Cloudbased on MySQL

Page 3: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Database Landscape

NoSQL

RDBMS

NewSQL

Scalability

Feat

ures

Page 4: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Vitess Strengths

● Battle tested for 6 years at YouTube● Site availability of 99.999 or greater● Based on MySQL● Minimize app changes● Pluggable sharding● Diverse environments

Page 5: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Rich Feature Set

● Cluster management

● Resharding automation

● Query services / SQL support

● Production ready

Page 6: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Architecture

shard

vtgate

app server

app server

app server

mysqld

vttablet

master

vtgate

big data

Vitess

etcd

mysqld

vttablet

mysqld

vttablet

replicas

mysqld

vttablet

big data replicas

mysqld

vttablet

vtctld

App

Page 7: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Rethink Sharding

● Sharding Key is a NoSQL concept○ You have only one key

● Relational parallels○ Primary keys○ Secondary indexes○ Unique & non-unique indexes○ Foreign keys

Page 8: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Vitess Sharding

● Range sharded by keyspace id○ Not a physical column

● Primary Vindex maps to keyspace id○ Multiple mapping functions○ Pluggable

● Sequences

Page 9: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Secondary Indexes

● Lookup indexes backed by other tables● Sharded/Unsharded● Can be external

Page 10: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Vitess Community

Production & Testing Contributions

Flipkart . JDBC & bulk DML features

Hubspot . MySQL compatibility

StitchLabs . Static map index

PixelFederation . PHP PDO

Slack . DBA statements

Page 11: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

New shinies

● 2PC● Message Queues● RBR● MySQL protocol● Online schema swap

Page 12: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Looking ahead

● Seeking to join CNCF● 2.1 release● 3.0 MySQL-esque

Page 13: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Demouseruser_id

musicuser_idmusic_id

music_extramusic_id

user_idxhash

music_idlookup

music_lookupmusic_idkeyspace_id

VSchema

Unsharded

user_seqid

music_seqid

Page 14: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Scaling Strategies

Page 15: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Simple Start

Master

Replica● Pros

○ Simple○ Read scaling○ Durability○ Uptime: Reparents & offline

backups

● Cons○ Write scaling○ Data size

Replica

Page 16: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Reshard

● Pros○ Read and Write scaling○ Data size

● Cons○ Transactions○ Cross-shard queries○ Fat client

● As you grow○ Cluster management○ Worldwide latency○ DR

Unsharded

Shard 1

Shard N

Masters Replicas

Page 17: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Planet Scale

● Pros○ DR○ Worldwide latency

● Cons○ Cluster management○ Resharding○ Gets worse over time

Unsharded

Shard 1

Shard N

Masters Replicascell 1

Replicascell 2

Replicascell 3

Page 18: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Scaling With Vitess

Unsharded

Shard 1

Shard N

Point A

Page 19: Vitess (vitess.io) - Percona · 2017-05-02 · Battle tested for 6 years at YouTube Site availability of 99.999 or greater ... big data Vitess etcd mysqld vttablet mysqld vttablet

Why Use Vitess?

● Sharding is a core competency● Contribute instead of building your own● Proven track record● Built to scale: O(1) operator overhead● The cloud is coming