-
Notifications
You must be signed in to change notification settings - Fork 460
Flexible switching for multihost/sharding support #438
Copy link
Copy link
Open
Description
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.
- If
config.always_switch_connections = true(or similar), always establish
a new connection on switch. - If the database host matches the current tenant's host, use 'local'
switching (schemas on pg,useon mysql). - If the host does not match the current tenant's host, connect to the
correct host first, and then do local swiching. - Mirror
connection_handler.establish_connection's API by accepting a URL,
a configuration hash, or a database.yml connection symbol. - All modes of switching 100% threadsafe.
This will target Rails 5.1 and above only (due to the vastly improved connection handler API) and will not be backported.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels