How does redis optimize memory?

Alibaba cloud Q & A 2022-02-13 08:31:14 阅读数:491

redis optimize memory

Redis How to optimize memory ?

Take the answer 1:

You can make good use of Hash,list,sorted set,set And so on , Because usually a lot of small Key-Value It can be stored together in a more compact way . Use hash table as much as possible (hashes), Hash table ( It means that there is little storage in the hash table ) The memory used is very small , So you should try to abstract your data model into a hash table . Such as your web There is a user object in the system , Don't name for this user , surname , mailbox , Password settings are separate key, Instead, all the information of this user should be stored in a hash table

copyright:author[Alibaba cloud Q & A],Please bring the original link to reprint, thank you.