/

PlanetScale

Database connector

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.

Connect PlanetScale
Connect PlanetScale
See setup steps
See setup steps

Database

Category

CDC

Sync mode

p95 500 ms

Latency

5 min

Setup time

What it can do

Triggers · 3
  • Row insertedCDC
  • Row updatedCDC
  • Row deletedCDC
Actions · 4
  • 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.

host: aws.connect.psdb.cloud
database: shop
branch: main
username: tessel_readonly
tables: [orders, customers]
start_position: current
host: aws.connect.psdb.cloud
database: shop
branch: main
username: tessel_readonly
tables: [orders, customers]
start_position: current
host: aws.connect.psdb.cloud
database: shop
branch: main
username: tessel_readonly
tables: [orders, customers]
start_position: current

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 readonly role for events and reads

  • A password with the readwriter role only if workflows write back

  • A service token with create_branch only for the branch action

Setup

Four steps. About five minutes.

Most of the time goes into choosing tables. Tessel opens a test stream on each shard before you continue.

  1. Create a read-only password for the main branchPlanetScale2 min
  2. Paste the host, username and passwordTessel1 min
  3. Pick keyspaces and tables to watchTessel2 min
  4. 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.

Connect PlanetScale
Connect PlanetScale
All integrations
All integrations

One email a month. Only what shipped.

A1

Product

C1

Layouts

D1

Company

E1

Template

F1

All systems operational
fra41 ms
iad38 ms
sin52 ms

C2

Elsewhere

XLinkedInGitHubYouTube

E2

Move across the wordmark168 blocks · iso 30°

One email a month. Only what shipped.

A1

Product

C1

Layouts

D1

Company

E1

Template

F1

All systems operational
fra41 ms
iad38 ms
sin52 ms

C2

Elsewhere

XLinkedInGitHubYouTube

E2

Move across the wordmark168 blocks · iso 30°

One email a month. Only what shipped.

A1

Product

C1

Layouts

D1

Company

E1

Template

F1

All systems operational
fra41 ms
iad38 ms
sin52 ms

C2

Elsewhere

XLinkedInGitHubYouTube

E2

Move across the wordmark168 blocks · iso 30°

Create a free website with Framer, the website builder loved by startups, designers and agencies.