# Brainstorming approaches to reconcile Rails 8's default multi-DB setup with DATABASE\_URL

**URL:** <https://discuss.rubyonrails.org/t/brainstorming-approaches-to-reconcile-rails-8s-default-multi-db-setup-with-database-url/86769>\
**Category:** rubyonrails-core\
**Created:** [September 24, 2024, 9:20am UTC](https://discuss.rubyonrails.org/t/brainstorming-approaches-to-reconcile-rails-8s-default-multi-db-setup-with-database-url/86769 "2024-09-24T09:20:21Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Hampton](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/hampton/32/2616_2.png) [@Hampton](https://discuss.rubyonrails.org/u/Hampton)\
**Post date:** [October 2, 2024, 6:43pm UTC](https://discuss.rubyonrails.org/t/brainstorming-approaches-to-reconcile-rails-8s-default-multi-db-setup-with-database-url/86769/8 "2024-10-02T18:43:15Z")

</div>

[EDIT: I should have read closer the original post here, where it seems that DATABASE\_URL should actually be used for primary based on the code. I’m going to go investigate what was going on with my set up that caused my primary to ignore the DATABASE\_URL. Please ignore literally everything below here.]

I have a Documentation PR related to this already open… as I had production downtime due to this change when switching to SolidQueue.

> <https://github.com/rails/rails/pull/53019>
>
> The Guide on Multiple Databases has a NOTE added that addresses a potential gotc…ha (thatgotma’) where migrating to a multi-database setup means that the DATABASE\_URL configuration method that is often used in simpler application stops working entirely.
> 
> The solution to this is shown if the user wants to keep using that method with an explicit \`url:\` configuration example.
> 
> Hopefully this will help out the next person from not being surprised!
> 
> \### Motivation / Background
> 
> When you move from a single-database setup to a multi-database configuration (which is how SolidQueue recommends, even for simple apps), the DATABASE\_URL autoconfiguration method of the \`primary\` database stops working.
> 
> This caused me to crash my production environment and I couldn't figure out what was wrong for many hours.
> 
> Hopefully this will give someone else a heads up!
> 
> \### Detail
> 
> The guide is updated with a NOTE, and also some sample configuration that allows you to continue to use DATABASE\_URL.
> 
> 
> \### Checklist
> 
> Before submitting the PR make sure the following are checked:
> 
> \* \[x\] This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
> \* \[x\] Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: \`\[Fix #issue-number\]\`
> \* \[x\] Tests are added or updated if you fix a bug or add a feature.
> \* \[x\] CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

It doesn’t mention anywhere in the rails guide that mulit-databases ignores DATABASE\_URL. I think it’s fine for us to move away from that, but at least the guide should mention how to fix it!

---

_[View the full topic](https://discuss.rubyonrails.org/t/brainstorming-approaches-to-reconcile-rails-8s-default-multi-db-setup-with-database-url/86769)._
