Ruby on Rails
Tested with: Rails 8.0 · pg 1.5 · mysql2 0.5 · redis-rb 5.3 · Ruby 3.3
production: adapter: postgresql host: pg-7f3k.us-east.databasezy.com port: 5432 database: app username: app password: <%= ENV["ZB_PASSWORD"] %> sslmode: verify-full sslrootcert: <%= ENV.fetch("ZB_CA", "databasezy-ca.pem") %> pool: <%= ENV.fetch("RAILS_MAX_THREADS", 5) %> connect_timeout: 10 prepared_statements: <%= ENV["ZB_POOLED"] ? false : true %> # false on the pooled endpointproduction: adapter: mysql2 host: mysql-7f3k.us-east.databasezy.com port: 3306 database: app username: app password: <%= ENV["ZB_PASSWORD"] %> encoding: utf8mb4 sslca: <%= ENV.fetch("ZB_CA", "databasezy-ca.pem") %> sslverify: true ssl_mode: verify_identity pool: <%= ENV.fetch("RAILS_MAX_THREADS", 5) %>Cache, Action Cable and Sidekiq on Valkey
Section titled “Cache, Action Cable and Sidekiq on Valkey”config.cache_store = :redis_cache_store, { ssl_params: { ca_file: ENV.fetch("ZB_CA", "databasezy-ca.pem") }, reconnect_attempts: 3}Action Cable and Sidekiq take the same url and ssl_params.
Migrations and pool sizing
Section titled “Migrations and pool sizing”bin/rails db:migratein the release step, against the direct endpoint.- Connections per replica =
pool× processes (Puma workers). Keep the total under the size’smax_connections. db:prepareon first deploy creates the schema;db:createis not needed, the databaseappalready exists.