Cookies ahead

Our support chat tool "Intercom" would like to collect some more data on you. See the related link for more details.

Docs

PlanetScale

🪐

PlanetRock

PlanetScale is a MySQL-compatible serverless database platform powered by Vitess.

PlanetScale offers a scalable, serverless MySQL-compatible database. It is built on Vitess, the database clustering system used by YouTube.

Configuration

Since PlanetScale is MySQL compatible, you can use it with standard PHP MySQL drivers (PDO, mysqli) and frameworks like Laravel or Symfony without special adapters, making integration straightforward for applications already built on MySQL.

CA Certificate

PlanetScale requires a secure connection using a CA certificate. You need to download the CA certificate and make it available to your application.

  1. Download the CA certificate from PlanetScale documentation.
  2. Add it to your repository (e.g., config/cacert.pem).
  3. Reference it in your database configuration options.

Laravel example

In your config/database.php:

'mysql' => [
    'driver' => 'mysql',
    'url' => env('DATABASE_URL'),
    'host' => env('DB_HOST', '127.0.0.1'),
    // ...
    'options' => [
        PDO::MYSQL_ATTR_SSL_CA => base_path('config/cacert.pem'),
    ],
],
php

Region

When setting up PlanetScale for your fortrabbit application, select a database region that matches your app's deployment location to minimize network latency; databases in the same region provide faster query responses and better overall performance.

Written by a human. Review, grammar checks and typo fixes by AI.

AI use & editorial processEdit on GitHub ↗