Show or update the VSchema

sharding & workflows

// what it does

The VSchema tells Vitess how rows distribute across shards (vindexes) and where tables live. show prints a keyspace's current VSchema as JSON; update applies a new one from a file — the step where you define each table's sharding key.

// shell

$ pscale keyspace vschema show mydb main sharded-ks
$ pscale keyspace vschema update mydb main sharded-ks --vschema ./vschema.json

// gotcha

A wrong vindex choice concentrates traffic on one shard and defeats the whole exercise — model your query patterns before writing the VSchema, and keep the JSON in version control like any other schema artifact.

// resources