0
votes

I would like to make a little backend application for a small soccer league with app engine and I consider to use datastore and objectify instead of a traditional SQL database.

I want to display matchdays and league tables. I also would like to be able to display the league table ranking for ceratin matchdays.

example: Lets assume the current matchday is the sixth matchday of the current season. I want to be able to display the league table ranking for the fourth matchdays (its the sum of points of the 1. matchday + 2. matchday + 3. matchday + 4. matchday)

How would I model something like this on app engine using datastore and objectify? How would a query for a league table look like?

Or is this a good example where I should use traditional SQL database, because with SQL you can do SUM() in your sql statements?

1

1 Answers

0
votes

You generally have two choices:

  • Calculate on the fly (possibly caching)
  • Pre-calculate and store

It's hard to say which is better in your case since it depends on data and query volumes. Working on GAE tends to bias developers towards pre-calculation, especially when past data doesn't change. For example, roll up the past data every night. Now your queries are fast.