mongoose icon indicating copy to clipboard operation
mongoose copied to clipboard

Redis store for useDb cache

Open bgrgndzz opened this issue 5 years ago • 2 comments

Do you want to request a feature or report a bug? Feature

What is the current behavior? Connections created using useDb are cached in process memory, leading to high memory usage in clustered apps.

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior? Option to store connections in redis to share between clusters

What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version. Node v10.21.0, Mongoose v5.9.14, MongoDB v4.2.8

bgrgndzz avatar Mar 29 '21 07:03 bgrgndzz

Oops, I realized redis isn't the solution to this problem because a connection object can not be stored with it. Is there any other way to share a mongodb connection between clusters?

bgrgndzz avatar Apr 03 '21 21:04 bgrgndzz

No there isn't, you can't share a socket between multiple machines AFAIK.

vkarpov15 avatar Apr 15 '21 18:04 vkarpov15