sortedset - Redis: storing intermediate set results, use random names or wrap in transaction? -
i'm having result based on intersection of multiple unions of (sorted) sets.
e.g.
intersect(union(a,b), union(c,d), e)
the obvious way of doing storing union(a,b) , union(c,d) in temporary sets , using in final intersection command.
but obviously, temporary sets need name , despite redis being single-threaded, if use fixed names it, i'll run concurrency problems.
my solution has been entire 'query' in multi/exec-block (create temporary sets, intersection, fetch results, delete temporary keys).
the obvious alternative not use multi/exec use sufficiently random names temporary sets.
my question is: preferable/best practice?
the former comes performance (/availability other threads) penalty latter adds complexity , isn't guaranteed not cause concurrency problems.
haven't looked doing in lua, i'm assuming that'll make more complex.
Comments
Post a Comment