Quiz on connection pool

Look at this picture from the video:

And yet the answer

Multiple database clients can share a connection pool.

is incorrect…

Guys, you have to get your story straight (AKA: Stop confusing me!)…:smile:


@torus_ot I wonder what a Data Lake picture should really look like. :laughing:

You are confusing 2 types of client.

  1. The web client that acces your application. In this case your application is a server.
  2. Your application is the client in respect to the mongod server.

The (mongo) connection pool is used between 1 client (your application) and the mongod server.


Is there a use case that represents the answer to the question? This is still confusing for me. All the clients represented in the use case diagram are connected to a connection pool that in turn connects to several Mongo DB servers/nodes.

I am not sure of what you want. However I can comment on the picture shared by torus_ot. In there the Multiple Clients are clearly web browsers as exemplified by the shopping carts. The big circle is your application server. But it is the client when you look at it from the MongoDB servers. It is this single client that shares the connections from the connection pool. Since multiple clients (shopping carts in web browser) access your (application) server where you implement your business logic. Your server (your MongoDB client) needs to have multiple connections with the database server.

1 Like

To complement what @steevej-1495 explained, establishing a connection to a mongod or mongos instance is time consuming. In order to circumvent this, the MongoClient pool is a set of established connections that are available to use without the waiting time!
These pool of unused connections use up RAM and are constrained to the node’s available max number of connections (db.serverStatus().connections) and your machine’s settings. As a result, you need to be careful when changing the default from 100 to greater and know what the constraints are.

1 Like

Hi Everyone,

The question is referring to “database client” which means application, which cannot share the same pool. But “web clients” can share the connection pool.

Thanks for notifying this, we will update the options to avoid any confusion. :slight_smile:



I think the part that is least clear is that the big circle represents our server application as a client to the database server. If I understand right, we have multiple web clients connecting to our server application which is itself a client of the mongod server. The connection pool is set up by our application server for it to have ready-made connections to the database and will persist only as long as our server is active. As our application receives requests from the various web clients, it uses the pool of connections to fire off database operation requests to the mongod server. The details are still a bit fuzzy, but the overall idea is fairly clear. Thanks!

1 Like

Thanks for sharing this detailed information. :slight_smile: I will share it with the team.