阅读背景:

如果从数据库中删除相关对象,为什么Redis会删除对象中的关系?

来源:互联网 

I have Django, PostgreSQL and Redis. I have models that have foreign keys and m2m relationships. Every day I'm caching bunch of objects and dropping their cache at midnight. The problem is when I'm removing object from the database (during the day) - the fields with relationships in cache are also getting changed (id of this objects is removed from foreign keys and m2m). As I read in Redis docs - all objects are stored as Hashes in the server's RAM. I can't understand how database changes could affect to the RAM cache. So why it happens and how can I prevent such behaviour?I have Django, PostgreSQL and Redis. I have mod




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: