我希望在Redis中存储复杂c#类的集合,这个集合有2种类型的用法:
1. What is the best Redis type for storing this type of data?
2. Is it Ok to store c# object as byte array in Redis String, and when i need to this data deserialize it to my collection? , also if the rate of this data usage is high.
对于c#的缓存数据是否存在更好的解决方案?
发布于 2014-12-09 20:30:27
您可以将红哈希用于C#对象。用HMSET填充它
HMSET objects:classname:id member1type member1value [member2type member2value]...要获取所有对象,只需使用HGETALL,并获取特定成员赫格特 (您也可以使用HMGET获取多个成员)。
根据您的需要,您还可以为每个类添加带有ids的集合,而不是使用排序从所有存储的类对象中获取特定成员。
https://stackoverflow.com/questions/27382964
复制相似问题