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

Want to stay up-to-date with Ruby on Rails?

Join 86,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.