AppEngine Analytics Model with Lists of Times
I want to log analytics data (when someone loads page X, loads a js plugin, cancels a transaction) for my AppEngine app.
I'm going to set it up as follows:
1. Event X occurs. 2. Add to taskqueue to put this event in the datastore. 3. Filter over datastore to graph and analyze usage data.So here's the issue: I'd like create a single Analytics Model and store each event as a timestamp on a corresponding list for that action. I'm going to shard this single Model into several instances in the datastore and wr开发者_如何学Pythonite to each one randomly and then combine the results for graphing.
BUT, GAE can't filter on lists, so I can't do things like filter for all events TODAY (which is what I'd really like to do).
Any help or advice is appreciated.
There's no reason to shard a model. There's no limit on the number of entities you can have with a given kind name - they're all stored in the same Bigtable anyway!
It's not clear what you're trying to do that requires filtering on a list. Can you clarify? What sort of query do you want to perform?
Instead of logging this data inside your app, have you considered imbedding a proper analytics software, such as Google Analytics in your app?
Your app is not really all that different from a normal website, even if you require logins. Google Analytics will provide you a much better reporting suit than just putting data into datastore.
We did similar stuff with Omniture at my previous gig, and it worked wonderfully, for example allowing us to focus on specific browsers to support.
精彩评论