如何在GAE中有效实施会议? [英] How to effectively implement sessions in GAE?
问题描述
$ b
- 将所有会话数据存储在cookie中
- 将所有会话数据写入数据存储区和memcache,然后仅从memcache读取
- 将所有会话数据写入数据存储区和memcache,然后仅从memcache读取
任何人有任何其他想法?
我建议您在推出自己的应用程序之前检查(并参与)这三个appengine会话的实现:
您的选项看起来不错,但在它们之间进行选择可能取决于应用程序中会话数据的大小。
I was wondering about implementing my own sessions (more for an exercise than anything else) for a GAE app I'm working ... at first I was thinking of using the datastore to store the session data. However, every time something needs to be added to the session 'bucket', it would require saving to the datastore. Obviously that's bad since we want to minimize our writes. Then I thought about using memcache ... seemed like a good idea but then we're faced with issues of possible session corruption due to memcache being "evicted through memory pressure" by Google. So does that mean we are left with only the following options:
- Storing all session data in cookies
- Writing all session data to datastore and memcache, and then only reading from memcache
Anyone have any other ideas?
I suggest checking out (and contributing to) these three implementations of appengine sessions before rolling out your own:
Your options look fine but choosing between them probably depends on the size of the session data in your application.
这篇关于如何在GAE中有效实施会议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!