App Engine数据建模问题
我对数据模型建模以进行有效查询有点陌生 GAE,但对 RDBMS 有广泛的了解。
问题是这样的: 我有大约一百万个术语(字符串),需要查询和比较 将数值作为时间序列与每周数据点相关联。 将其视为 X 轴为时间、Y 轴为线性的图表 显示数值测量。
到目前为止,我得到了每个学期和天的离散数据点 数据存储区,我正在寻找一种按周聚合数据的方法 并存储数据,以便我可以有效地查询数据存储。 我正在考虑预先计算一些不同的时间序列 每个学期的长度(4周、5周、6周等)并存储每个条目 as {term, start_week, [time series]}
使用 RDBMS,我可以轻松地按周分组并以编程方式(作为存储过程或在应用程序后端)创建数据系列。由于 GAE 的限制以及 BigTable 作为高度分布式系统的性质,这不是一个选择。
任何想法都受到高度赞赏!
I'm kinda new to modeling my data model for efficient querying with
GAE, but have extensive knowledge with RDBMS.
Here's the problem:
I got roughly a million terms (strings) and need to query and compare
associated numerical values as a time series with weekly data points.
Think of it as a graph with time on the X axis and a linear Y axis
showing the numerical measures.
So far I got the discrete data points per term and day in the
datastore, and I'm looking for a way to aggregate the data by week
and store the data so that I can query the datastore efficiently.
I was thinking of precalculating a number of time series of different
length (4 weeks, 5 weeks, 6 weeks etc.) per term and store each entry
as {term, start_week, [time series]}
With RDBMS I could easily group by week and create the data series programatically, either as stored procedure or in the application back end. Due to GAE constraints and the nature of BigTable as a highly distributed system, this is not an option.
Any ideas are highly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您所采用的方法似乎是合理的,但这完全取决于您需要执行的查询类型。假设您需要按名称(字符串)和周查找时间序列,并且您通常希望获取连续 1 到 100 周之间的数据,我建议如下:
The approach you're heading towards seems reasonable, but it all depends on the sort of queries you need to execute. Assuming you need to look up time series by name (string) and week, and you generally want to fetch between, say, 1 and 100 consecutive weeks worth of data, I would suggest the following: