1

I have a question that I didn't find an answer. Yet ;-)

I have a Django/MySQL application that runs memcached in the background. One of my tables change every access. I mean, when the user access the page I have a "count" field that is incremented, this same table contains all data that is going to be displayed.

Is recommended to use memcached in this scenario? Or should I create a new relation table that will contain only "id" and "count" field?

Thanks!

4

1 回答 1

0

当然,这是 memcached 的有效用途。基本规则是,无论何时update,或者delete在 mysql 的意义上,您都需要做一些事情来保持 memcache 记录的一致性。通常这是通过在此处调整值或删除它来完成的,以便下一次访问它来构建它并保存它。

在你的情况下,我只会get增加它的值,然后增加set它。根据准确性对您的重要性以及您获得的并发流量,您应该考虑本文中概述的事务的原子

于 2013-02-06T00:59:18.013 回答