Redis stores data in the form of key and value.
Value can be any string or hashes or any predefined type
hashes allows you mapping of key and value pairs. key and value are strings only. So, you can store the object type of data. It is similar to HashMap data structure in java language.
That means, You can store the value as an object.
For example, In applications, you have a coded a user object that contains id,name,salary in programe.
to cache users data, you can use value as user object in Redis.
Redis Hashes Commands
Command | Description |
---|---|
SET key value | Assign the value to the key |
GET key | Retrieve the value for given key |
DEL key | Deletes the give key and value from a cache |