mercredi 14 janvier 2015

What's the most efficient way to sort dynamodb data by location and time

I am using the geo library for amazon dynamodb to retrieve dynamodb data entries within a 10 mile radius of the user. I have that part working but I am now trying to sort the results by time, and only the 50 most recent entries.


I have two tables in dynamodb: the one that is created by the geo library in which each entry contains a geo hash key and the hash key for my other table. The other table has additional info like time (in the format of time since 2000, in seconds*100) and user ID.


My idea is to take the list of results (in a 10 miles radius) and then sort them by time, returning only the 50 most recent results. But if the amount of posts in an area gets large, this may not be very efficient.


Is there a better way to do this?





Aucun commentaire:

Enregistrer un commentaire