How to structure Google Datastore (App Engine) web traffic model?

瘦欲@ 提交于 2019-12-13 00:51:13

问题


Simple Task: keep track of web traffic (hits) so that I can graph the number of hits per day for the last 30 days.

Current Datastore Model (2 fields): 1) Website ID 2) Timestamp of Hit

Problem: I'm using Google App Engine's datastore and don't have the ability to do a group-by or count.

Can anyone offer a simple way to structure my Google Datastore database to achieve this task? By returning all of the hits and then grouping them in my code seems like a performance hog. Any ideas?


回答1:


I would use sharding counters for this specific task; have a look to the last example of this documentation.



来源:https://stackoverflow.com/questions/4686938/how-to-structure-google-datastore-app-engine-web-traffic-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!