Redis Sorted Sets Explained

Поделиться
HTML-код
  • Опубликовано: 6 фев 2025
  • 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.red...
    Redis Labs → www.redislabs....
    Redis.io Sorted Set Documentation → redis.io/topic...
    Need a Redis cluster now? Sign up for a free Redis Cloud Essentials account → bit.ly/2wasiCa
    Join our discord server → / discord

Комментарии • 23

  • @Redisinc
    @Redisinc  3 года назад +6

    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

    • @candrabeqx
      @candrabeqx 2 года назад

      wait, but the output at 3:53 is sorted in descending order which is correct.

    • @J-wd2cx
      @J-wd2cx Год назад

      I think he meant here 3:23

    • @osifoanosike6565
      @osifoanosike6565 Год назад

      @@J-wd2cx that also confused me for a bit, but I realized that the difference was denoted using the direction of the arrow.

    • @yelgabs
      @yelgabs 8 месяцев назад

      how come you set WITHSCORES in the command but it’s only the IDs are showing?

  • @nikitapodshivalov3573
    @nikitapodshivalov3573 3 года назад +17

    You should promote the editor of this video. It is a masterpiece ;)

  • @azizutkuozdemir
    @azizutkuozdemir 2 года назад +4

    I like almost everything about redis and the people working for redis.

  • @FuckUsNew
    @FuckUsNew 3 года назад +7

    Wow, the best tutorial made by creator I've ever seen!

  • @larryquantz195
    @larryquantz195 2 года назад +3

    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!

    • @Redisinc
      @Redisinc  2 года назад +1

      Thanks! We're all a bit nerdy on the DevRel team so this came naturally to us. - Justin

  • @vanshchopra24
    @vanshchopra24 Год назад +1

    Thanks for the video!!

  • @ahxel
    @ahxel 2 года назад

    now I wanna play Mages and Minotaurs!
    seriously, though, great tutorial video.

  • @John-t1d
    @John-t1d 4 месяца назад

    Can you explain in what scenarios you would use redis vs a traditional database system for score tracking? I imagine that in a real time scenario or where scores are frequently updated that Redis would be preferred. But if we are not dealing with live data then something like MySQL would be sufficient?

  • @as5547
    @as5547 2 года назад +2

    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

    • @Redisinc
      @Redisinc  2 года назад

      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.

  • @Naru1243
    @Naru1243 3 года назад

    These Videos really deserve more views. q.q

  • @KanikaDawar1997
    @KanikaDawar1997 Год назад +1

    How can I add high precision values, like double in a sorted set?

    • @Redisinc
      @Redisinc  Год назад

      You can add doubles as a score to members in a Redis Sorted Set.

  • @bovineox1111
    @bovineox1111 2 года назад

    You had me at mages and minotaurs

    • @Redisinc
      @Redisinc  2 года назад +1

      Another proud warrior joins our merry band!

  • @glennedgar5057
    @glennedgar5057 3 года назад +1

    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

    • @Redisinc
      @Redisinc  3 года назад

      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.

    • @enimozhianv2880
      @enimozhianv2880 2 года назад

      @@Redisinc Facing performance issues when using scan command. Could you please help how to overcome it