PlanetScale (Vitess)

Prerequisites

  • A PlanetScale account with a database set up.

PlanetScale Setup

PlanetScale is built on Vitess, a database clustering system for horizontal scaling of MySQL. PlanetScale is using Vitess connector under the hood, enabling change data capture (CDC) for PlanetScale databases.

A user can subscribe to multiple shards in a keyspace, making it a convenient tool to feed downstream CDC processes.

To read and process database changes, the Connector subscribes to VTGate's VStream gRPC service. VTGate is a lightweight, stateless gRPC server, which is part of the Vitess cluster setup. The Connector gives you the flexibility to choose to subscribe to the MASTER nodes, or to the REPLICA nodes for change events.

1. Granting Privileges

Because the Connector reads change events from the VTGate VStream gRPC server, it does not need to connect directly to MySQL instances. Therefore, no special database user and permissions are needed.

2. Enable Change Data Capture

The Connector does not require any specific configuration for use with PlanetScale. However, make sure that these are accessible to Streamkap:

  • PlanetScale host and its port (443)
⚠️

Snapshot

Current version of the connector does not support incremental snapshotting. By default, connector will setup with initial snapshotting mode. This means that the connector will read all the data from the specified keyspace and tables when it starts for the first time.

This mode is blocking and will not allow the connector to stream changes until the initial snapshot is completed.

Streamkap Setup

Follow these steps to configure your new connector:

1. Create the Source

2. Connection Settings

  • Name for your Connector
  • Hostname - IP address or hostname of the PlanetScale database server.
  • Port (default: 443) - port number of the PlanetScale database server.
  • Username - The username of the PlanetScale database.
  • Password - The password of the PlanetScale database.
  • Keyspace Name - The name of the keyspace from which to stream the changes.
  • Tablet Type - The type of Tablet (hence MySQL) from which to stream the changes.
  • Connect via SSH Tunnel: The Connector will connect to an SSH server in your network which has access to your database. This is necessary if the Connector cannot connect directly to your database.

Click Next.

3. Keyspace and Table Capture

  • Add Keyspace/Tables: Specify the Keyspace(s) and table(s) for capture
    • You can bulk upload here. The format is a simple list of keyspaces and tables, with each entry on a new row. Save as a .csv file without a header.

Click Save.