Skip to main content

Getting Started

Make sure to first set up your PlanetScale developer environment. Once you’ve installed the pscale CLI, you can interact with PlanetScale and manage your databases straight from the command line.

The vdiff command

Run Vitess VDiff against a VReplication workflow on a Vitess database branch. Use it to verify that source and target tables match before you switch traffic on a MoveTables workflow. JSON output for create and show includes a next_steps field with a suggested next command. Usage:
pscale branch vtctld vdiff also works.
You must be an Organization Administrator or a Database Administrator of the database to create and change VDiffs. Service tokens need read_workflow to list and show VDiffs, write_workflow to create, stop, or resume them, and delete_workflow to delete them.

Available sub-commands

* Flag is required

Sub-command flag descriptions

Available flags

Global flags

Lifecycle

  1. Create a MoveTables workflow and wait until streams are Running.
  2. Create a VDiff and note the uuid.
  3. Show until the VDiff completes with no mismatches.
  4. Switch replica traffic, then primary traffic.
  5. Optionally stop, resume, or delete a VDiff.
The Workflows page shows the latest VDiff for a MoveTables workflow. Creating a VDiff stays in the CLI or API.

Examples

API

Matching API paths under /v1/organizations/:org/databases/:db/branches/:branch/vdiff/workflows/:workflow/vdiffs.

Need help?

Get help from the PlanetScale Support team, or join our Discord community to see how others are using PlanetScale.