0

I would like to build a multi tenant Spring Boot application. I prefer persisting the data for every tenant in a separate database.

This approach implies the usage of a data source (and a connection pool) for each tenant/database.

In my scenario I have about 1000 tenants. Does anyone have experience with having 1000 connection pools in a Spring Boot application?

What do you recommend for such a scenario?

Thanks!

Oliver
  • 353
  • 1
  • 4
  • 16
  • Most likely you won't have a single application for 1000 tenants, but it'll have to be splited/load balanced across servers for it to properly serve the load. – Alejandro Apr 26 '21 at 17:35
  • So you would split the deployments by tenants? For examlet 5 applications with 200 tenants for each application? – Oliver Apr 26 '21 at 17:38
  • That could be a starting point. The idea is to split the load across servers. One instance can host multiple small clients, but having very few big ones on another. It greatly depends on usage. – Alejandro Apr 26 '21 at 17:45
  • M concerns are not about load in the first place, but about about a lot of outgoing connections from a single application. – Oliver Apr 26 '21 at 17:48
  • Outgoing connections, as long as the server has enough resources, aren't really a problem, but the DB server is far more likely to experience problems, or outright reject connection after a limit has been reached. Make sure you split the DBs into separate DB servers too. – Alejandro Apr 26 '21 at 18:33
  • Yes, that is what I'm supposed to do. – Oliver Apr 26 '21 at 18:35

0 Answers0