Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

My First 90 days with Vitess

A walk through Vitess from the perspective of a long-time MySQL user.

  • Be the first to comment

My First 90 days with Vitess

  1. 1. My first 90 days with Vitess October 2019 Morgan Tocker
  2. 2. Agenda 1. What is Vitess? 2. Terminology Essentials 3. My Questions (MySQL Compatibility, Consistency Model..) 4. Other Quirks and Features 5. The Best Use Case 6. Where Vitess Could Improve 2
  3. 3. What is Vitess? 3 Middleware/Proxy ● Sits in between your application and MySQL ● Provides Routing, Query Consolidation, Connection Pooling Orchestration ● Includes Monitoring & Backup ● Integrates with Orchestrator and provides failover And More... ● VReplication ● Vitess Messaging ● Easier deployment path into Kubernetes Not a straightforward single-category answer
  4. 4. Vitess Architecture 4 PlanetScale Data Platform - Deploy, Manage, Monitor VitessApp
  5. 5. Vitess serves millions of QPS in production 5 Quiz of Kings
  6. 6. Terminology: The Essentials VTGate: The Proxy that your applications connect to. Topo Server: The etcd server containing meta data. Tablet: A combination of a vttablet and a MySQL server. Keyspace: a logical “MySQL database” (aka schema). Keyspaces can be sharded or unsharded. Cell: A data center 6 https://vitess.io/docs/concepts/
  7. 7. My-MySQL Questions 7 ● What version of MySQL is it? VTGate currently advertises itself as MySQL 5.5. ● What versions of MySQL does it support? MySQL 5.6+ and MariaDB 10.0+ Requires RBR + GTIDs enabled Strongly recommends semi-sync
  8. 8. My Questions: What queries are supported? 8 ● Depends on if keyspace is sharded ● Major Limitations: ○ SET [SESSION] var = x; ○ GROUP BY key ORDER BY different_key; https://vitess.io/docs/faq/queries/#is-there-a-list-of-supported-unsupported-queries
  9. 9. Questions: Consistency Model? 9 ● READ-COMMITTED for reads ● Atomic within a shard on update ○ 2PC also available but not recommended ● Has elements of opt-in eventual consistency (VReplication provides materialized views).
  10. 10. Quirks and Other Features • All queries are SQL parsed • They may be changed before routing to mysqld, but best attempt is made to preserve comments! 10
  11. 11. Quirks (cont.) • The original designed used a gRPC protocol to VTGate instead of MySQL - it still exists! • The original design also had type safety - very different from MySQL’s history! • This pedantic design helps a lot • Easier to add flexibility later vs. remove it 11
  12. 12. Quirks (cont.) • Scalability Philosophy = 250G shards • Makes sense once explained • Biggest benefit is fast recovery time 12
  13. 13. (Translucent) Sharding • Still designing a VSchema • Recommend modeling updates to be single shard • vs. transparent: • Distributes data everywhere • Possible latency penalty; typically a new engine 13
  14. 14. Vitess Integrations • Orchestrator • ZooKeeper/etcd/Consul • XtraBackup • MySQL/MariaDB Replication 14
  15. 15. The “Best Use Case” Signs you might be a fit include: • You currently have schema-per-tenant • You have a multi-tenant Application • You need an upgrade path from MySQL to sharded MySQL • Your monolithic databases are blocking your Kubernetes adoption 15
  16. 16. To Be Aware Of Still MySQL underneath • Including the MySQL Optimizer (good for OLTP) • In some cases may improve analytics (VReplication + parallel scatter gather). Not All. Born as an Internal Company Project • Ease of use not Day 1 Priority • It is a Priority for PlanetScale 16
  17. 17. Questions Join the Vitess Slack Community! https://vitess.io 17
  18. 18. Features I’ve worked on MySQL Flavor detection Used to bootstrap MySQL Server correctly (mysql_install_db versus mysqld --initialize etc). Go modules support 18
  19. 19. Things I would like to see improved Reduce delta from MySQL default configuration Add support for additional SQL syntax: NOOP where safe for connectors Reduce pedantic-ness of design for compatibility Reduce shell scripting in examples (use ~/.vitess.cnf etc) Embrace smaller footprint for development environments: VTCombo 19

×