memcached/Couchbase 中的 Flask 会话;他们安全吗?

Flask sessions in memcached/Couchbase; are they safe?

目前运行几个Flask网站在IIS/Windows2008 Server下,我们需要实现session和application scope的存储。 我正在检查 Flask 中会话的可能性,运行 在 Windows 2008 或多或少排除了 Redis 作为可行的存储选项(我知道有一个 Windows端口,但似乎还不太成熟)。

下一个最佳选择似乎是 memcached。 Windows 以 Couchbase 的形式有一个非常漂亮的实现,但我们有一些 concerns/questions;

  1. 如果会话中的数据太多,并且可用内存已满,会发生什么情况,memcached 是否会开始删除较旧(但可能仍然合法)的会话数据?
  2. 如果是这样,Couchbase/memcached 中是否有解决方案来防止这种情况发生?
  3. 在 couchbase 主页上,它说也可以安装 couchbase as a key/value store。这可能是存储会话数据的更好选择,还是会遇到与将 Couchbase 安装为内存缓存兼容存储相同的问题?

在 Couchbase 服务器的上下文中:

  1. What happens if there is too much data in the sessions, and the available memory is full, will memcached just start deleting older (but maybe still legitimate) session data?

是 - memcached 是一个 缓存 - 您指定内存配额并且该 RAM 量用于缓存项目。当您填满该数量时,它将弹出(即删除)旧项目。这是标准的缓存行为。

  1. If so, is there a solution in Couchbase/memcached to prevent this?
  2. On the couchbase homepage it says it's possible to install couchbase as a key/value store as well. Could this be a better option for storing session data, or would it have the same problems as installing Couchbase as a memcache compatible storage?

对于 memcached - 不是真的 - 这就是它的全部意义所在。

对于 Couchbase 服务器 - 是的。除了memcache类型的bucket,Couchbase Server还有Couchbase类型的bucket。这有一个内存配额,用于保留最近使用的项目,但所有项目都 persisted 到磁盘。如果某个项目在内存中不可用,那么它将从磁盘中获取它。