Save 36% for Black Friday! Learn more

How to Configure Multiple Databases with Rails

October 21, 2024

Track your progress

Sign in to track your progress and access subscription-only lessons.

Log In

Your Teacher

Hi, I'm Chris. I'm the creator of GoRails, Hatchbox.io and Jumpstart. I spend my time creating tutorials and tools to help Ruby on Rails developers build apps better and faster.

About This Episode

Rails 8 now ships with multiple databases by default. In this lesson, we'll learn how the configuration works and how to deploy to production with environment variables

Notes

To deploy Rails 8 with Solid Queue, Solid Cache, and Solid Cable, you can set the following environment variables to configure the databases.

PRIMARY_DATABASE_URL || DATABASE_URL
QUEUE_DATABASE_URL
CACHE_DATABASE_URL
CABLE_DATABASE_URL