[JAVA-308] Pooling Connections independently of the User Created: 27/Mar/11  Updated: 19/Oct/16  Resolved: 27/Mar/11

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Max Bridgewater Assignee: Antoine Girbal
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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



 Comments   
Comment by Eliot Horowitz (Inactive) [ 27/Mar/11 ]

See: http://api.mongodb.org/java/2.6-pre-/com/mongodb/Mongo.Holder.html
Its designed pretty much for this purpose.
If there is something else you need please comment.

Generated at Thu Feb 08 08:51:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.