ok, thanks a lot. On Wed, Sep 16, 2009 at 7:19 PM, Barry Hunter <barrybhun...@googlemail.com>wrote:
> > Quite simply wont work. It might appear to work for a while, but it > will soon break. > > AppEngine is distributed, and runs on many machines. > > You can cache global variables between requests. But its just a bonus > cache, cant store data there. > > Each request might hit a different instance, instances will be flushed > without warning, and there is strong evidence that cron jobs hit > different instances to ones serving web visitors anyway. > > Memcache will give more persistance, (ie less likly the data disappear > on you) - but even that can be flushed or become unavailable. Again > its just a cache - not for data. > > If you want to store the data have to use the datastore. > > Fundermentally, writing in 'batches' like you propose is not going to > save much, because the same datastore API calls are still going to > have to be made, just there can be some optimization as the task is > similar. It might save some tho because the index writes can be > batched. > > > > > > > > On 16/09/2009, Prashant <antsh...@gmail.com> wrote: > > hi, > > > > my app needs to store some data to datastore for each & every request, > say 1 > > object per request which causes high cpu usage per request. to minimize > the > > cpu usage per request, instead of adding the object directly to datastore > i > > add the object to a LinkedList (every request) and use a cron which moves > > objects form the LinkedList to datastrore periodically, say every min. > > > > I feel it is not a good practice. I don't want to use memcache (instead > of > > server ram) to store my LinkedList because delay in fetching and storing > the > > list form/to memcache may cause loss of data from upcomming requests (or > > previous request). I don't want to use task queue either for some > reasons. > > > > Experts please comment on this kind of implementation. Losses & Benefits, > > any alternative good practice. > > > > Thanks. > > > > > > > > > > -- > Barry > > - www.nearby.org.uk - www.geograph.org.uk - > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---