Do I need to create and destroy every connect after executing ?
No!
Pools aren't needed either. Since Node and Redis are both (practically) single-threaded a single connection per Node process is the general pattern. Just use createClient
at the top level of your script and move on. Exceptions would be blocking commands (BLPOP, XREAD, etc.) and SUBSCRIBE - those need their own connection.
Most helpful comment
No!
Pools aren't needed either. Since Node and Redis are both (practically) single-threaded a single connection per Node process is the general pattern. Just use
createClient
at the top level of your script and move on. Exceptions would be blocking commands (BLPOP, XREAD, etc.) and SUBSCRIBE - those need their own connection.