Rails 6.1 adds support for role switching and sharding in database | Saeloun Blog

Rails 6.1 adds the ability to switch a role or shard for an application with multiple databases. This means it is possible to switch connections for one database instead of all databases globally.To use this feature, we need to set the below config in our application.config.active_record.legacy_connection_handling = falseLet’s say we have two databases, primary and vehicles. And we have shards and replica configured for each of them in database.yml as below:.
Rails 6.1 adds support for role switching and sharding in database | Saeloun Blog #ruby #rubydeveloper #rubyonrails #blog #database https://rubyonrails.ba/single/rails-6-1-adds-support-for-role-switching-and-sharding-in-database-saeloun-blog

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles