Flexible switching
This will make multi-host support a first-class citizen in Apartment. By
flexibly choosing the switching technique we can support tenants across many
hosts. This makes logical sharding at the application level very simple.
This will target Rails 5.1 and above only (due to the vastly improved connection handler API) and will not be backported.
Flexible switching
This will make multi-host support a first-class citizen in Apartment. By
flexibly choosing the switching technique we can support tenants across many
hosts. This makes logical sharding at the application level very simple.
config.always_switch_connections = true(or similar), always establisha new connection on switch.
switching (schemas on pg,
useon mysql).correct host first, and then do local swiching.
connection_handler.establish_connection's API by accepting a URL,a configuration hash, or a database.yml connection symbol.
This will target Rails 5.1 and above only (due to the vastly improved connection handler API) and will not be backported.