Skip to content

Instantly share code, notes, and snippets.

Vitess Codebase Overview

Figure: High-level architecture of Vitess, showing how stateless VTGate proxies route application queries to VTTablet servers (each managing a MySQL instance) and how a global topology service coordinates cluster state. Vitess control tools like vtctl/vtctld interact with the topology and tablets to manage the cluster.

Main Components and Packages

VTGate

VTGate is the query router and proxy layer in Vitess. It is a stateless server that clients connect to instead of connecting directly to MySQL. VTGate:

  • Parses incoming SQL queries, plans how to satisfy them across shards, and dispatches them to the appropriate VTTablets.
(3^2 - 3) * 4
@sbaker617
sbaker617 / latency.markdown
Created February 8, 2020 08:59 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs