My work system consists of Spring web applications and it uses Redis as a transaction counter and it conditionally blocks transaction requests.
The transaction is as follows:
- Check whether or not data exists. (HGET)
- If it doesn't, saves new one with count 0 and set expiration time. (HSET, EXPIRE)
- Increases a count value. (INCRBY)
- If the increased count value reaches a specific configured limit, it sets the transaction to 'blocked' (HSET)
The limit value is my company's business policy.
Such read and write operations are requested one after another, immediately. Currently, I use one Redis instance at one machine. (only master, no replications.) I want to get Redis HA, so I need slave insntaces but at the same time, I want to have all reads and writes to Redis only to master insntaces because of slave data relication latency.
After some research, I found that it is a good idea to have a proxy server to use Redis HA. However, with proxy, it seems impossible to use only the master instances to receive requests and the slaves only for failover. Is it possible??
Thanks in advance.