I am new to Redis and want to know if it is good practice to open a client connection while my Java application is running. This connection will be used by various functions.
Or an alternative is better: defining each connection to a method, which then connects, establishes, or receives data and closes the connection at the end.
Which one is desired?
Thank.
Note. I use Redis customer salad
, , . TCP 1 1 .
. docs state
lettuce Redis Standalone Redis Sentinel. , . . .
. Redis , , , jedis, , .
jedis
, , . , :
, BLPOP, BRPOP,... . , , Redis
BLPOP
BRPOP
Redis, (, ). Redis . - : , , , - .
(MULTI/EXEC). . , , .
MULTI/EXEC
, . null, transactions, , . , .
null
redis . , , .