-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple dynamic connections (500 or more) #7504
Comments
Hi! I would suggest you not to use ORM for such purpose & stick to the simple PostgreSQL library. |
Yes, this is a solution, but an ORM would make it a lot easier.
When executing the above code, I get this error: Unhandled rejection SequelizeDatabaseError: relation "users" does not exist. |
Whenever an user joins your application you need to open a connection to new database, you can initialize one sequelize instance with max pool set to Although I feel this is not a good approach, you should use schema instead. If your application need multi tenancy you can use schemas as well, thats what I have to warn you schema support is lacking in Sequelize but can we worked with. Lastly error you are facing is because there is no |
hey i got the same issue will anyone guide me right solution because i have multiple tenant and i want access particular instance of them |
I have an API in nodeJS and need to connect dynamically to different PostgreSQL databases (500 or more connections), all on the same server. I have a default database for all users, which will save the basic data for authentication. After being authenticated, the user's stream will be directed to another database (each user will have access to a specific database).
I could instantiate the Sequelize for each connection, but I think it will be dangerous for app performance. Is there any other solution / resource so I can access different databases through the same instance of Sequelize?
The text was updated successfully, but these errors were encountered: