Hi I am building a simple movie website and i am using google datastore as my backend.
I am in need to design top movie downloads per day, week, month , all time.
Now I am tracking only number of downloads eg: database is like a single row for a movie with num_of_downloads as a column, i am incrementing this field whenever a user downloads the movie.
Movie Id | Title | Description | num_of_downloads
Now what would be the best optimal way to show top movie downloads per day, week, month, all time.
I am thinking to implement a new table with movie key and date field to keep track of number of downloads per day with which i can calculate for rest of the problem.
Movie ID, Date, Downloads
M1 01/01/2017 1000
M2 01/01/2017 100
M1 02/01/2017 2000
I am not sure this is the best way to design for appengine datastore also writing queries to get top 10 downloads this week, month is difficult as its not as easy as sql queries.