HI ,we have an application with high velocity transactions in bursts, to ensure that RACE condition is controlled , we intend to use WATCH with MULTI and EXEC to ensure that the data update is atomic, in addition our data type is JSON, at the moment we are using an inefficient method of using GET to get the stringified data , convert to JSON , append the new data and then stringify and then SET, we intend to change this over by using REDISJSON so we append only a single record directly instead of the entire data set in that key. The questions are as below

1) When WATCH is used, is it only for that particular transaction /process, say process A for a particular KEY say KEY 1 , i.e. if there are other clients that are reading and updating the data via processes , say process B and C for the same KEY 1 , where WATCH is not used/not required, will the process B and C will be impacted in any way by the WATCH implemented in process A. 2) Can WATCH be used in conjunction with JSON.SET 3) Is REDISJSON supported on AWS Memory DB or native REDIS data store is needed for the same.

Many thanks in advance

Comment From: gkorland

  1. WATCH is connected to specific client connection
  2. Yes it can.
  3. (NOTE, Edited by @madoslon to avoid the explicit recommendation of a Redis cloud provider) RedisJSON is maintained by Redis ltd. as a separate project, please see https://oss.redis.com/redisjson/ for more information about it.

Comment From: ankitkumaragarwal

Thanks a lot @gkorland

2) understood, 3) we signed up for for redis enterprise cloud on AWS , so all good.

Could you further clarify on 1)

Say i have 100 clients connected and 96 of them are reading from the same key as also writing to the same key (Say GET/SET) using process A , but there is no watch implemented for process A, and 4 clients are using process B , where WATCH is implemented, it it correct to state that for 96 of them the process A will continue without any interruption, however only the 4 clients which are using the process B will be impacted and any change in the key will render any SET transaction to fail for these 4 clients only.

Rgds Ankit

Comment From: gkorland

Any transaction following the WATCH call will fail if the key was changed between the WATCH and EXEC call. Please see https://redis.io/topics/transactions

Comment From: madolson

Seems resolved.