How to acheive Shared Connection Pool with Multitenant Schema based approach


When ever we register tenant for schema ( using Mysql ), 10 new connection is created. How can I achieve shared connection pool for all the schema together. Please provide with sample.

I want to use 1000 of schema, If it grows exponentially by 10 per schema, it will be pain point for us.

Please assist on this.


That’s currently not possible out of the box. However, you could wrap your own DataSource implementation and change the way connections get handled (but this is a low level kind of thing). We’ve done experimentations in the past here, but nothing yet on master for this.