Hi ecognium,

On Wed, Jun 17, 2009 at 9:17 AM, ecognium <ecogn...@gmail.com> wrote:

>
> Hi All,
>     My application requires certain types of query features that are
> not currently possible through Datastore API and so I am thinking of
> moving the query side of things to Anazon's SimpleDB (mainly use it to
> return keys). For example, I would like to return entities that are
> within a certain zip code range while supporting pagination. Since key
> based paging takes the only inequality operator allowed, it is not
> possible to do the traditional zip based retrieval.  Even without
> paging there is no way to have two inequality operator.  Hence the
> switch to SimpleDB -- let me know if there are any nice workarounds
> for zip-based data retrieval.


You may want to check this out:
http://appengine-cookbook.appspot.com/recipe/efficient-paging-for-any-query-and-any-model/


>
> I have two questions for App Engine members:
>
> 1. Have you noticed any major latency issues in accessing SimpleDB
> from App Engine (thinking of using Boto module)? If so, any tips on
> how to reduce it?


I haven't personally used SimpleDB, but the same caveats apply as with any
other service accessed over HTTP - latency is dependent on the service and
its proximity.


>
> 2. When I tested SimpleDB from my dev machine, I noticed SimpleDB
> takes up to 5 seconds to return results -- most of the time is
> actually spent in authorizing the request. So I would like to initiate
> the connection once in the app and reuse the object for all subsequent
> queries. Where should I do this initialization? I am not familiar with
> how App Engine caches the application. Should I create a
> amazon_login.py, include the logic for auth (two lines of code) and
> import the file in my code? or do I need to put it in a class and
> instantiate the class in the same file?


When you say "initiate the connection once", are you referring to an actual
TCP connection, or to a 'session'? I presume the latter, since SimpleDB is
HTTP based.

urlfetch doesn't let you control the lifetime of the underlying TCP
connection for HTTP requests. If you're obtaining an authentication token,
though, you can certainly do that on the first request to a given runtime,
and then cache the result in a global or class-level variable, or cache it
in memcache and reuse it across multiple instances.

-Nick Johnson

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to