I realize there are a lot of questions already on here about querying the App Engine Datastore, but I want to get opinions on my particular case.
I'm querying scores to build a high score table, so I want them ordered by score descending. Now, it is possible for two scores to have the same score value, so paging through based on this value is not possible, because you could end up skipping scores based on the page's filter.
I want to build the query around a dynamic date. For instance, the top 10 scores in the past month. What is the best way to go about this?
I obviously don't want to have to page through every score every time. Do I need to load these scores into the memcache and update when a submitted score is greater than one in the top 10? This doesn't make sense because I would have to define my time ranges ahead of time, but setting up a cron to refresh it every day to get the scores that have reached the time limit out would be doable. Can this be done efficiently dynamic? Another option would be to just have a cron run through all the scores every N hours or something, but I would really prefer to stay away from needing to do that.
Is there literature out there that would help me make these decisions?