API specifying which Database to connect to #13674
Unanswered
chaffeqa
asked this question in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
As a multi-tenant application, we chose to make a separate database (not schema) per tenant. This has relegated us to being thread-unsafe since we must be connected to the correct tenant per request, and therefore have the overhead of connecting/disconnecting on every request (Ruby on Rails codebase). There are thousands of databases, but most share a database host instance. Having a persistent connection per app instance to each database doesn't scale on both the app and database instance level.
It would be awesome if we didn't have to connect/disconnect at an application level and instead just pass a header (or
SET SCHEMAsimililar call) to the load balancer. The load balancer could maintain a connection per database since that is scalable, and simply direct the app queries based on the header / session of the app instance.Happy to contribute! Been looking for a DB load balancer to build this functionality into. I feel there must be other multi-tenant apps out there that have a similar setup
All reactions