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

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -