Redis sorted set for post-vote and user-reputation

372 Views Asked by At

I use Stackexchange.Redis in c# . How StackOverflow use sorted set to calculate the post-vote and user-reputation in Redis. How to use ZADD ,ZUNIONSTORE or ZINTERSTORE . How to use [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX] parameter to calculate the post-vote and user-reputation.

1

There are 1 best solutions below

2
On BEST ANSWER

How StackOverflow use sorted set to calculate the post-vote and user-reputation in Redis.

we don't, although it is on my list to look at

How to use ZADD ,ZUNIONSTORE or ZINTERSTORE .

SortedSetAdd and SortedSetCombineAndStore

How to use [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX] parameter

The SortedSetCombineAndStore overload including the weights and aggregate parameters

to calculate the post-vote and user-reputation.

I can only tell you what the commands are. How you use them in your case is up to you. Personally, I'd be looking more at SortedSetRangeByRankWithScores.