问题描述
一般而言,在特定的AppEngine上的Memcache是不可靠的,因为无论出于何种原因,我的数据都可能在任何时候从缓存中删除。但是,在某些情况下,可能会出现这样的情况:使用memcache可能会带来一些小风险,例如更新memcache中的一些数据,这些数据会定期保存到其他更可靠的存储中。考虑到我保持在我的配额范围内,有没有Google提供的任何数字可以指示在高速缓存到期之前memcache条目从缓存中丢失的实际可能性?除了硬件故障和管理操作(如数据中心处的计算机正在升级/移动/更换)之外,是否有任何其他原因会导致条目被提前从memcache中删除?像任何缓存一样,Memcache应该用作... a 如果您无法在缓存中找到某些内容,则必须有策略在永久存储中找到它。
除了您提到的原因外,Memcache和其他缓存方法对它们将保存的项目数量也有限制(通常在缓存满时通常会丢弃最少使用的项目),并且通常也会设置其他缓存失效策略(例如,刷新一小时内未使用的所有内容)。
如果您不自己配置和操作缓存,则无法保证何时以及如何项目可能会故意从缓存中删除/由设计。
Memcache in general and on AppEngine in specific is unreliable in the sense that my data may be deleted from the cache for whatever reason at any point in time. However, in some cases there might be cases where a small risk may be worth the added performance using memcache could give, such as updating some data in memcache that gets saved periodically to some other, more reliable storage. Are there any numbers from Google that could give me an indication of the actual probability that a memcache entry would be lost from the cache before its expiration time, given that I keep within my quotas?
Are there any reasons other than hardware failure and administrative operations such as machines at the data centers being upgraded/moved/replaced that would cause entries to be removed from memcache prematurely?
Memcache, like any cache, should be used as... a cache. If you can't find something in the cache, there must be a strategy to find it in permanent storage.
In addition to the reasons you mention, Memcache and other caching approaches have limits to the amount of items they will hold (discarding usually the least recently used ones when the cache is full), and often also set other cache invalidation policies (e.g. flush everything unused for one hour).
If you don't configure and operate the cache yourself, you have NO guarantee of when and how items might be removed from the cache intentionally / by design.
这篇关于Google AppEngine上的memcache会多久失去一次数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!