PlanetScale
Reviewedbyfl
🪐
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.
- Download the CA certificate from PlanetScale documentation.
- Add it to your repository (e.g.,
config/cacert.pem). - 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'),
],
],
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.