Redis Sorted Sets Explained
Vložit
- čas přidán 21. 07. 2021
- Sorted Sets are a tool every developer should know. In this explainer, we’ll introduce you to the most common Sorted Set commands, including ZADD, ZINCRBY, ZRANGE, and ZRANK. We’ll also show you how to use Redis Sorted Sets to maintain an online gaming leaderboard!
Links:
Redis University → university.redislabs.com/
Redis Labs → www.redislabs.com/
Redis.io Sorted Set Documentation → redis.io/topics/data-types#so...
Need a Redis cluster now? Sign up for a free Redis Cloud Essentials account → bit.ly/2wasiCa
Join our discord server → / discord - Věda a technologie
Hello, there is a slight error in one part of the video. ZREVRANGE will traverse a sorted set from highest to lowest score values. The output we see at 3:53 is incorrect. The list should be inverted or in 'descending' order. Sorry about that! - Justin
wait, but the output at 3:53 is sorted in descending order which is correct.
I think he meant here 3:23
@@J-wd2cx that also confused me for a bit, but I realized that the difference was denoted using the direction of the arrow.
how come you set WITHSCORES in the command but it’s only the IDs are showing?
You should promote the editor of this video. It is a masterpiece ;)
I like almost everything about redis and the people working for redis.
Wow, the best tutorial made by creator I've ever seen!
Thanks for the video!!
This is a really well-made video and the technical explanations are terrific. And I'm not even into Dungeons and Dragons or Elden Ring!
Thanks! We're all a bit nerdy on the DevRel team so this came naturally to us. - Justin
now I wanna play Mages and Minotaurs!
seriously, though, great tutorial video.
I am a newbie, how did you paste the list of 11 values with the correct tabs, and the command did not execute after the first set of values. Thanks
That was a bit of movie magic. We use a script to "type" for us so it doesn't show typos. In truth it was just a very long string with a lot of spaces.
These Videos really deserve more views. q.q
How can I add high precision values, like double in a sorted set?
You can add doubles as a score to members in a Redis Sorted Set.
good set of videos. a question about last video on hashes. Redis does not have a native facility to handle an array of hash tables. there are adhoc mechanisms and a module dbx.
what is the semi official way to handle an array of redis hash tables?...
Thanks
Great question! There is no real way to store an array of hash data types in open source Redis. If you have multiple hashes within an array on your client and would like to store them in a similar fashion within Redis, you could have all Redis key names store a list name within their value, like ':' where array_name is the name of the array of hashes and the index is the position of the hash. You can then run the SCAN command to pull all hashes that match your array_name value. This can get pretty costly though; it might be worth checking out the RedisJSON module. You can store an array of JSON objects in Redis without a problem.
@@Redisinc Facing performance issues when using scan command. Could you please help how to overcome it
You had me at mages and minotaurs
Another proud warrior joins our merry band!