如何在GAE中有效实施会议? [英] How to effectively implement sessions in GAE?

查看:96
本文介绍了如何在GAE中有效实施会议?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道为我正在开发的GAE应用实施我自己的会议(更多的是为了一个练习,而不是其他任务)...起初我正在考虑使用数据存储来存储会话数据。但是,每次需要将某些内容添加到会话桶时,都需要将其保存到数据存储区。显然,这是不好的,因为我们想尽量减少我们的写作。然后我想到了使用memcache ......似乎是一个好主意,但之后我们面临着由于memcache被Google内存压力驱逐而导致会话损坏的问题。所以,这意味着我们只剩下以下选项:
$ b


  1. 将所有会话数据存储在cookie中
  2. 将所有会话数据写入数据存储区和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:

  1. Storing all session data in cookies
  2. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆