I have a very simple php redis application which creates keys at certain events. All the keys are just counters and have an expire time of 24 hours. Basically a rolling window of 24 hours for every key to gather some statistics.
if ($redis->exists($key)) {
$redis->incr($key);
}
else {
$redis->set($key, '1');
$now = time(); // current timestamp
$redis->expireAt($key, $now + 86400);
}
When I extract an overview of all my keys with $list = $redis->keys("*");
(or in a redis-cli console with keys *
), I would suspect a chronological order by creation date. However this is not case. Neither are they ordered alphabetically, by value...
So my question is, how is this list sorted?