【问题标题】:memcache alongwith PHPCassa内存缓存和 PHPCassa
【发布时间】:2011-09-22 14:50:08
【问题描述】:

我正在使用 PHPCassa 从我的 cassandra 实例中获取值,其中我的结果数组看起来像:

Array
(
    [1576_AF_ACTS_A300_2011-09-12] => 150
    [1576_AF_ACTS_A300_2011-09-13] => 1565
    [1576_AF_ACTS_A300_2011-09-14] => 1515
    [1576_AF_ACTS_A300_2011-09-15] => 1519
    [1562_AF_ACTS_A300_2011-09-12] => 1510
    [1561_AF_ACTS_A300_2011-09-13] => 15189
    [1563_AF_ACTS_A300_2011-09-14] => 15189
    [1568_AF_ACTS_A300_2011-09-15] => 15125
    [121_AF_ACTS_A300_2011-09-16] => 15123
    [1580_AF_ACTS_A300_2011-09-12] => 15127
    [1580_AF_ACTS_A300_2011-09-15] => 15189
    [1580_AF_ACTS_A300_2011-09-17] => 15158
)

现在,我想将结果存储在 memcache 中。我应该为此设置什么唯一的内存缓存键?

我可以使用的是无穷无尽的键数组,我根据来自 UI 表单的一些输入参数来构建它们。

如何将此信息与唯一的内存缓存键一起保存?

【问题讨论】:

    标签: php memcached cassandra


    【解决方案1】:

    我建议避免使用 memcache 来支持 Cassandra 的行缓存:http://www.datastax.com/docs/0.8/configuration/storage_configuration#rows-cached

    这为您提供了一个更简单的架构,避免了您从两层系统中遇到的cache coherence 问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-12
      • 2011-11-23
      • 2013-12-26
      • 2010-12-21
      相关资源
      最近更新 更多