Is counting Redis keys not recommended in production even has expiration time?

  laravel, php, redis

I’ve seen post here How to count the number of keys matching a pattern? which comments said it is not advisable to count keys in production. Which I believe is true.

My question is.. is it still not recommended when keys expire? expiration deletes keys.

what im trying to do is I am counting the number of active users via storing them in redis key which has expiration. Im doing it with Laravel. I need to count that matching keys for able to get the number of active users.

Any recommendation? Thanks Guys!

Source: Laravel

Leave a Reply