What's the performance of the Redis Hashes? I want to store several properties in the Hash that I will be updating/removing on a regular basis (every 1 second). Is there any performance impact?
Understood all. But how do people manage to cache query along with its results set. Specifically filter queries/search queries. In a typical scenario, people input some values/conditions in input field, based on that input, system goes to database, finds the records and sent it back to the user, displayed in grid. How this search params and conditions should be stored in redis?
Whoah! Good catch! That was an error. I think we reused some of the command line interface footage after I called HINCRBY at 4:16. It should have been 20 still at 2:23. Sorry about that! - Justin
Every time I was in an interview, the interviewer always asked me about how the Redis Hashes were implemented. And I said, "I don't know. What I know is how to use them".
Looking under the hood of Redis and examining the data structures *under* the Redis data structures could be a good topic for a stream or video! - Justin
Hi there - no, in a hash the values are always string types although you can store binary data / JSON encoded data in there etc. To have Redis operate on data like a list, check out the List, Stream and JSON data types.
Amazing explanation 🎉🎉🎉 Imagine you want to return field X from a list of players, how can you select them? Player:1 Player:3 Player:5 How to get values for the players 3 and 5 in one go? To avoid round trips to the db? Thank you
Hi Alberto! You might want to check out integrating Lua scripts with your Redis server to atomically execute multiple commands. Check out the docs here: redis.io/docs/manual/programmability/ Hope this helps! - Justin
I'd counter by saying that a JSON file is just like a Hash. Hashes have existed before JSON, and as a simple look up table of just keys and associated values, it meets a LOT of needs. This was also released before we launched our JSON capability. Now people are free to pick and choose which data structure works best for them. Hashes can still excel over JSON in a few scenarios due to their flat nature, so care should be given when deciding the best data structure to use.
Thanks, Fernando! I would recommend integrating RediSearch for filtering and searching within hashes. The Redis Om client has made this a pleasure to do.
Nice video. I'm currently using Redis-OM with FastAPI, NO SUCH INDEX using the find method. I'm using the aredis_om module. Any idea why this is happening? Thank you.
And that, ladies and gentleman, is how you make an educational video! Bravo!
Thank you very much! Always appreciate hearing that! - Justin
These videos are so amazingly produced, thank you so much. These deserve so much more attention. q.q
Wow, thank you so much Naru! Much appreciated! - Justin
This is explained incredibly well! Really, REALLY well. Thank you :)
Awesome and funny instructor. Big thanks to him ❤
Is it possible to set an expiration time for each field and not for the key?
What's the performance of the Redis Hashes? I want to store several properties in the Hash that I will be updating/removing on a regular basis (every 1 second). Is there any performance impact?
Very nice! Much thanks for this video. amazing content!
Understood all. But how do people manage to cache query along with its results set. Specifically filter queries/search queries. In a typical scenario, people input some values/conditions in input field, based on that input, system goes to database, finds the records and sent it back to the user, displayed in grid. How this search params and conditions should be stored in redis?
Thank you for the video!
I have questions... because HashSlots is 16,384 so we can only do hset up to 16,384? (* if no HDel executed)
The value of the gold is set to 20 during the player 42 init at 2:15. Why the value of the gold is 140 after running hgetall command at 2:23?
Whoah! Good catch! That was an error. I think we reused some of the command line interface footage after I called HINCRBY at 4:16. It should have been 20 still at 2:23. Sorry about that! - Justin
Every time I was in an interview, the interviewer always asked me about how the Redis Hashes were implemented.
And I said, "I don't know. What I know is how to use them".
Looking under the hood of Redis and examining the data structures *under* the Redis data structures could be a good topic for a stream or video! - Justin
Thank you sir!
Is redis field and value could be of List type on python3.9.16 ? Thanks
Hi there - no, in a hash the values are always string types although you can store binary data / JSON encoded data in there etc. To have Redis operate on data like a list, check out the List, Stream and JSON data types.
Хорошо объяснил. Спсибо. (explained well. Thanks.)
Wow, this was an amazing example 👏
Thanks Alex! We keep talking about actually making a Mages & Minotaurs game someday. Maybe we'll make an open source crowd effort? - Justin
you have specified gold of 20 and when running the command of HGETALL it print out 140, i suppose the video was made is different times
Amazing explanation 🎉🎉🎉
Imagine you want to return field X from a list of players, how can you select them?
Player:1
Player:3
Player:5
How to get values for the players 3 and 5 in one go? To avoid round trips to the db?
Thank you
Hi Alberto! You might want to check out integrating Lua scripts with your Redis server to atomically execute multiple commands. Check out the docs here:
redis.io/docs/manual/programmability/
Hope this helps! - Justin
This is awesome!
Why use the word hash to name it? It is just like a JSON file.
I'd counter by saying that a JSON file is just like a Hash. Hashes have existed before JSON, and as a simple look up table of just keys and associated values, it meets a LOT of needs. This was also released before we launched our JSON capability. Now people are free to pick and choose which data structure works best for them. Hashes can still excel over JSON in a few scenarios due to their flat nature, so care should be given when deciding the best data structure to use.
Nice explanation!!
Its possible to filter a key with especific value?
All players in level 4 e.g.
Thanks!
Thanks, Fernando! I would recommend integrating RediSearch for filtering and searching within hashes. The Redis Om client has made this a pleasure to do.
Nice dice
thanks
I'm doing RU101 now, and in my humble opinion, it would be great if you can turn off the background music.
Thanks for that, we removed audio in future videos.
Nice video.
I'm currently using Redis-OM with FastAPI, NO SUCH INDEX using the find method. I'm using the aredis_om module. Any idea why this is happening?
Thank you.
Hi Aremoh, this is a great question to post in our discord, we can definitely help you! discord.com/invite/redis