Reputation: 100486
Are Redis connection pools necessary with Node.js asynchronous I/O?
Most of the Redis libraries I see allow you to create client connections but there aren't many connection pool modules so I assume it's not as important.
The one thing that confuses me is that Redis has a default of 16 different/segmented databases in one Redis instance.
So if you create a connection pool, which database of the 16 are you connected to? Can you connect to all 16 at once with the same connection pool?
Is there a Node.js Redis library that creates a connection pool with 1 client per database, depending on how many databases you are using?
Upvotes: 7
Views: 22782
Reputation: 6890
You've asked too many questions in one post.
Trying to answer them;
Are Redis connection pools necessary with Node.js asynchronous I/O?
Duplicate of Node.js Redis Connection Pooling
So if you create a connection pool, which database of the 16 are you connected to?
By default you're always connected to database 0. Databases in redis are numbered if you're thinking why 0. They cannot be renamed to a string.
Can you connect to all 16 at once with the same connection pool?
Connection pools are not necessary
Is there a Node.js Redis library that creates a connection pool with 1 client per database, depending on how many databases you are using?
After searching i find two :
Upvotes: 13