|
In the current connection pooling approach, connections are pooled by database+user. As a result, it is not possible to share connections across multiple users.
Take the following settings for instance: a huge number (1000 and more) of components (bundles) are in an OSGI container. They all use the same MongoDB cluster but different
DBs. It makes sense to maintain central pool of connections (say 200 connections) instead of having these clients maintaining each a pool of connections. If each client maintains 10 connections, we end up having 10000 connections; a huge waste of resources. I thought something working alone the following lines would be great.
Whenever a client wants to access the DB, it would:
1) Get a connection from the common pool
2) Before passing the connection to the client, the pool manager would switch the database to the client's DB, and
3) Re-authenticate the connection with the new client's credentials.
Does this make sense?
I can see this
|