问题
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