DEV Community

In Praise of Multiple DB setups and Rails 6

Joe Cannatti on March 18, 2019

It looks like Rails 6 is going to include first class support for configuring your app to talk to multiple databases. I’m not going to get too de...
Collapse
 
jwesorick profile image
Jake Wesorick

We currently use a second database for our event tracking.

Collapse
 
cescquintero profile image
Francisco Quintero πŸ‡¨πŸ‡΄

This feature is going to be very useful. The last time I needed to setup a read replica DB in a Rails project, I remember that was achievable using a ruby gem.

Way better if it's a default of the framework.

Collapse
 
ben profile image
Ben Halpern

This is indeed really exciting. I definitely think this is something we'll eventually make use of with dev.to. Great writeup.

Collapse
 
ben profile image
Ben Halpern

I've thought about getting to this point with DEV since we already emphasize this at other layers of the stack in terms of edge caching. But I thought that it seemed like overkill in terms of important choices at the time.

Thoughts on whether Rails 6 will make this use case a bit more straightforward?

Collapse
 
andrewbrown profile image
Andrew Brown πŸ‡¨πŸ‡¦

I don't remember needing to use a gem for multi-db connection in the past or maybe they just didn't exist 7 years ago. I took over this codebase that had 1 database connection for every client, it was bizarre. I suppose every feature is a double edge sword.

Collapse
 
rhymes profile image
rhymes

Love this, thanks! This is definitely my favorite upcoming feature :D