Google App Engine: Memcache or Static variable?
|July 7, 2009||Posted by forumadmin under TechQns||
Well, I think I have a very basic doubt here:
I’m developing an app on GAE (Java) and performing a query to the datastore that returns a lot
of entities, so I need to cache it. I was using memcache and it was working great, but if I keep the list of entities in a static variable, the whole request goes as twice as fast than using memcache. I think that’s because I’m not deserializing the entities all the time.
What would be the drawback of using a static variable instead on memcache? I don’t know if there could be several instances of my application in the cloud, and thus several instances of my static variable?
The list of entities I’m trying to cache are the best (greater score) posts of the last week. I take that list and choose 5 random posts and show them in a couple of pages.
Thanks for the help!
|Asked By – Damian||Read Answers|