开发者

Best Practice for temporary query result storage in Google App Engine

开发者 https://www.devze.com 2023-03-15 15:12 出处:网络
I have a query that takes a bit of time (it involves some computations and accessing a third-party).Currently, the user makes an HTTP request to initiate the query (it returns immediately).GAE puts th

I have a query that takes a bit of time (it involves some computations and accessing a third-party). Currently, the user makes an HTTP request to initiate the query (it returns immediately). GAE puts the task in a开发者_如何学C queue and executes it. After execution, the task stores the results in a static object. The user makes another HTTP request later to retrieve the results.

Is there a best practice way to implement something like this? Would the results be better stored in the DataStore?


the task stores the results in a static object

How are you making sure that the subsequent request from same user hits the same instance so that it can access the static object?

A better way to do it would certainly be either storing it in memcache (prone to hit or miss) and/or datastore. Keep in mind, with the new pricing model, datastore operations are going to cost more.

0

精彩评论

暂无评论...
验证码 换一张
取 消