Skip to content
Advertisement

Fastest way to check key exists in redis – php

Is there any other faster way than EXISTS, to check if a key exists in redis or not?

My problem is, I have over 1 million records in redis and I need to do a key_exists check. This should happen within 10ms.

Any Ideas around this?

Advertisement

Answer

Using the EXISTS command is the fastest way, this should be extremely quick. If you feel that it’s too slow its probably the latency between your server and the redis server and nothing to do with the command itself.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement