In Redis, some operations such as SINTERSTORE
have
Time complexity: O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.
In my use case, I expect to be comparing sets of upwards of 15,000 items each. Performing an N*M operation on these sets would be O(30,000). There is no time requirement for the operation, meaning I don't care how long it takes. My question is whether my Redis will lock while this calculation is happening. Any ideas?
The simple answer is "Yes", because Redis is based on a single threaded architecture.
The non-simple answer is "it depends" - if you shard your Redis in an optimized manner, only the shard that does this complex operation is blocked, the other shards are not.
Redis is single-threaded. It doesn't lock anything, but it won't process any other commands until that one finishes. So it's as if Redis were locked, which I think is what you meant.
See also: Locking and Redis
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With