PlanetScale
Read every insert, update and delete from a PlanetScale branch as a typed event in Tessel. Use it to start workflows, look up rows and write results back across sharded keyspaces.
Database
Category
CDC
Sync mode
p95 500 ms
Latency
5 min
Setup time
What it can do
- Row insertedCDC
- Row updatedCDC
- Row deletedCDC
- Run a read queryRead
- Insert a rowWrite
- Update rowsWrite
- Create a database branchWrite
Overview
The PlanetScale connector reads changes from Vitess through the VStream API, the same feed PlanetScale uses for its own replication. Workflows react to writes on every shard without polling, and every event shows up in the trace of the run it started.
Teams use it to sync new accounts into Intercom, to load order events into BigQuery for reporting and to refund a Stripe charge when a cancellation row is written.
Supported databases
PlanetScale Vitess databases, MySQL 8.0 compatible
Sharded and unsharded keyspaces, read from every shard
Production and development branches, production recommended
How VStream works
Tessel opens a VStream for each shard in the keyspaces you choose and tracks a VGTID position for each one. Events are checked against the schema and delivered in commit order per shard. If Tessel pauses, it resumes from the stored position.
Schema changes
PlanetScale ships schema changes through deploy requests. When a deploy request merges, Tessel reads the new schema before the next event, so added columns show up in typed events right away. Dropped columns are flagged in the trace of the first run that misses them.
Permissions needed
Create a dedicated password for the branch Tessel reads. A read-only password is enough for change events and read queries. Writer access and a service token are only required for the write and branch actions.
A password with the
readonlyrole for events and readsA password with the
readwriterrole only if workflows write backA service token with
create_branchonly for the branch action
Four steps. About five minutes.
Most of the time goes into choosing tables. Tessel opens a test stream on each shard before you continue.
- Create a read-only password for the main branchPlanetScale2 min
- Paste the host, username and passwordTessel1 min
- Pick keyspaces and tables to watchTessel2 min
- Insert a test row and watch the event arriveVerify500 ms
Your branches, in a workflow today.
Connect PlanetScale on the free plan. Up to three builders and 10,000 runs a month, no card required.