We are trying to build a multi-tenant app(using spring boot) with single db per tenant. We currently have less than 100 tenants but we expect around 1000 in 2-3 years.
We have multiple app server which connects to multiple SQL databases that creates connection through AWS secret manager but the problem is the connection is resource heavy and we are facing some time limit to create connection.
One solution we have thought of is to have some in-memory db like Redis which store information of users/tenants requests that have been forwarded to a app-server and that server has connection to a database so any new requests from that tenant is redirected towards the same app-server and so on and any new tenant requests is redirected to new app-server.
Is this a viable solution and are there any tested solution. Can you share some resources to look into?
Sarthak is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.