Answer the question
In order to leave comments, you need to log in
How to deal with race conditions when using redis?
I am looking for algorithms for dealing with race conditions when using redis, are there any implementation examples (preferably in php).
I clarify the question.
//некий долгий запрос
$key = md5("SELECT....");
$get_result = $redis>get($key);
if($get_result) {
print_r($get_result);
} else {
$query="SELECT...";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$redis->set($key,$row);
print_r($row);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question