PlanetScale
Published
Updated
🪐
PlanetRock
PlanetScale runs MySQL-compatible databases on Vitess. A fortrabbit app connects with the standard PDO driver over TLS, with the credentials as ENV vars.
PlanetScale runs MySQL-compatible databases on Vitess, the clustering system originally built at YouTube.
Configuration
PlanetScale speaks MySQL, so PDO, mysqli, Laravel and Symfony connect without adapters.
CA Certificate
PlanetScale requires TLS. Point the connection to a CA bundle, either one in the repository, such as config/cacert.pem from the PlanetScale docs, or the system bundle at /etc/ssl/certs/ca-certificates.crt.
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
Create the database in the AWS region of the app, see database hosting.