如何使用 python 使用 google appengine 存储和检索时间序列

How to store and retrieve time series using google appengine using python

我们正在开发一种工具来分享特定行业的案例研究。

  1. 我们想存储人们观看案例研究的时间(时间序列)
  2. 我们希望以与 Google Analytics 在其主页上相同的方式显示分析(参见附件)

数据模型很简单:

from google.appengine.ext import ndb
from webapp2_extras.appengine.auth.models import User

class CaseStudy(ndb.Model):
    title = ndb.StringProperty()
    published  = ndb.BooleanProperty( default=False)

class Hits(ndb.Model):
    case_study = ndb.StructuredProperty(CaseStudy, repeated=False)
    by_whom = ndb.StructuredProperty(User, repeated=False)
    timestamp = DateTimeProperty(auto_now_add=True)
  1. 我们想使用以下组件之一:Google AppEngine、NDB、BigTable、MapReduce,Python
  2. 我们想向案例研究的所有者显示时间序列
  3. 我们希望避免使用 D3js(太复杂?))
  4. 我们想用Morris来显示那些时间序列http://morrisjs.github.io/morris.js/

问题

  1. 如何设计存储数据的架构? NDB 还是其他?
  2. 如何设计聚合数据的架构?
  3. 如何设计显示数据的架构?
  4. 我们需要集成 http://Goo.Gl 吗?

提前致谢,欢迎任何建议

完全避免使用数据存储 (BigTable),它太昂贵而且速度太慢。 看看this projectBig Query 可能是您需要的。