Explore Vitess
Why do we need Vitess
MySQL does not have a good support of sharding, re-sharding, routing.(MySQL cluster is not open source). In addition, the performance of purely using MySQL is low: Client needs to establish connection for each query.
Architecture
- Topology Service:
- It enables tablets to coordinate among themselves as a cluster.(A coordinator).
- It enables Vitess to discover tablets, so it knows where to route queries.(For service discovery).
- It stores Vitess configuration provided by the database administrator that is needed by many different servers in the cluster, and that must persist between server restarts.(For disaster recovery).
- VTGate: Stateless proxy to route queries.
- VTTablet: Daemon agent running along with
mysqld
on the same machine.
Try Vitess Operator on K8S
https://vitess.io/docs/get-started/operator/
Pros and Cons
Pros
- Query rewrite.
- Sharding mgmt for MySQL.
- Plug-in model for supporting topology service(Distributed lock manager, Repository for topology metadata): ETCD, ZooKeeper, Consul
Cons
- Migration is painful because you have to modify schema.