Redis configuration leading to dirty reads

已查看 28 次
跳至第一个未读帖子

aditya.g...@zemosolabs.com

未读,
2016年4月28日 09:47:012016/4/28
收件人 Redis DB
Hi
     In our application we are using redis as a caching layer between the nodejs server and postgresql DB using sql query as key and resultset as value. To achieve this we are using catbox-redis. Whenever a user requests a resource we check whether the sql is present in redis and return the result if present and if its not stale. Else it is fetched from DB which may in some cases take some time say 5s. The issue is before the query returns if another request with same sql is hitting the server redis is returning null since its value is not set by the previous request yet. Is there any configuration change i can make to lock the key so that till the value is set it has to go to the DB rather fetch the value from redis.

Thank You

Aditya    
回复全部
回复作者
转发
0 个新帖子