So far in my all test cases it seems I could have also used python dictionary in place of redis.So I am not able to convince my self why Redis ? Note: I am new to Redis so please forgive me for such a naive question.
No need to ask for forgiveness for asking a question! :) In fact, I just fielded a similar question from a colleague a couple of weeks ago.
Redis objects are very similar to familiar data structures that you're likely to see in lots of other programming languages. Redis hashes are fairly analogous to Python dictionaries, Redis sets are analogous to Python sets, Redis strings are analogous to a Python string, etc. That much is true. But what if instead of a dictionary containing 10 elements, you had to manipulate a dictionary containing 1,000 elements. Or what if you had to store hundreds of dictionaries each containing dozens of keys? What if you have to store an unknown quantity of information (for instance, you want users to be able to sign-up for your service and create profiles)? Redis is a data storage engine (like MySQL, MongoDB, etc.) first and foremost. It just so happens that it also provides you with multiple ways of structuring data that are very similar to how you would structure your data in your application code, so it's really quite simple to implement certain patterns with your data in Redis that you would likely be familiar with as an application developer. Does that make sense?
I'm also of the mindset that "data" should always be stored separately from application logic, but I think that's probably a separate conversation to be had regarding philosophy as opposed to practicality. ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With