Home > Back-end >  Questions about redis hash table set expiration time
Questions about redis hash table set expiration time

Time:12-25


The timing of the hash table, redisTemplate expire () for a hash of each hashkey set an expiration time alone?
If not, the hash structure and string architecture have what differentiation?

CodePudding user response:

https://stackoverflow.com/questions/16545321/how-to-expire-the-hset-child-key-in-redis

Redis hash value set expire not be a separate hash function

CodePudding user response:

Hash structure cannot be alone for each key set expiration time,
If you simply by a key value, the difference between it and the string is not big, you can take a hash name as a prefix, then add the key as a string with the name of the
For example:
Hash structure
Aaa: {
BBB: "123",
CCC: "456"
}

string structureAaa_bbb: "123"
Aaa_ccc: "456"

There is nothing wrong with it, but the hash structure can be one-time all key operation, the string structure can not provide this kind of support,
  • Related