Search code examples
databasegoogle-app-engineconstantsstore

Best way to store constant data on Google App Engine


I'm making a (quite) simple python web application on GAE. The web app basically, ask user input, do basic calculation, then spew out some question from several module based on previous calculation, do basic calculation, spew out more information to the user.

Now, the problem is

  • The data that need to be fetched is located throughout the constant data (eg, several small part of the whole data)
  • The total whole data is about 100kb, required data per user is about 10 kb.
  • The data is constant, and may be modified (by me).
  • I want to conserve cpu cycle. :-)

So far, I've had been hard coding the data in python string literal separated with some if-elif-else as python module, but it is soo ugly (the data is formatted in HTML and more than one line per data). I could store it in the database but it may required the more cpu cycle and I don't know an easy way to store constant (non user modifiable) on the datastore. Putting it in a file, formatted in XML or something could require even more cpu power on parsing. So what is the best way to store constant data?


Solution

  • Ah... whatever. I use database for that. Used cache. And thinking about denormalizing it even further.