The datastore is slow, sometimes it is extremely slow. Doing an extra datastore query for each request will add quite a bit of overhead to your app. That means you will probably want to use some type of sessions. For some applications knowing the mobile devices capabilities is probably important enough to justify the overhead. I think Yossie is probably on the right track.
If it is at all possible I would suggest using the user-agent as the entity key. Then you can use a fetch instead of a query -- WURFLModel.get(user-agent). Perhaps if this is something really important to your app you would want to memcache the most common user-agents. For our apps we identified the most common devices accessing the app; for us, those are iPhones and BlackBerries. We simply check the user-agent for 'blackberry', 'iphone', and 'android' to decide what to give the client. iPhones and Android phones get the same version of the app, blackberries get a very simple stripped down version. Anything else with mobile in the user-agent basically gets the blackberry version. Seems to be working for us, and it is fast. No expensive queries or look-ups. I have not used the urlfetch service enough in my own apps to know for sure, but there are constant posts here about it being slow. If you're going that route you'll need to handle the case when the fetch craps out. Robert On Sun, Aug 29, 2010 at 11:38, prgmratlarge <[email protected]> wrote: > Well it really depends on how you query the datastore. If you do > something > like SELECT ... WHERE ua={user agent}, it would be much faster. But if > the > algorithms require iterating over the entire datastore, then it would > obviously be slower. When I say datastore, I mean to use the former > scenario, where the data is somehow set up so that a simple query will > yield > the results. So my question is, what's the best way to query a user > agent, > and get the right result? > > On Aug 29, 7:03 am, Filippo De Luca <[email protected]> wrote: >> Yes I think it can be a possible strategy. But what about cpu time? Is >> datastore less cpu intensive then default WURFLModel? Surely it has >> less memory footprint but it is less responsive also. My friend >> suggested me to have a standing alone matching application. The other >> application ask it to matching the request by REST protocol. I have a >> REST based WURFL web service, but it is not yet released as open- >> source. Do you think it is a possible solution? >> >> To lower the WURFL cpu time can be useful a servlet filter with some >> heuristics to determine if the request came from a mobile device or >> not. without involving WURFL. >> >> On Aug 27, 7:53 pm, prgmratlarge <[email protected]> wrote: >> >> >> >> > Well I was thinking of using the datastore. Would this be possible, >> > and what would be the method to the query? >> >> > On Aug 27, 3:44 am, Filippo De Luca <[email protected]> wrote: >> >> > > Yes it is true. Whether it is worth depends on the application aim. A >> > > good compromise can be a lightweight wurfl api without the LD >> > > algoritm. And a trie in substitution to RIS. >> >> > > On Aug 27, 12:11 am, prgmratlarge <[email protected]> wrote: >> >> > > > Yes, but the CPU required to do a lookup is simply not worth it. >> > > > Remember, every time a (new) user hits the site you do a lookup. It >> > > > can add up very quickly. >> >> > > > On Aug 26, 9:07 am, Filippo De Luca <[email protected]> wrote: >> >> > > > > Hi, >> > > > > I'm aWURFLapi maintainer. The issue should be due to the GAE size >> > > > > limit. A simple workaround may be split thewurflxml file in several >> > > > > little file, one root and many patches. I will do this utility >> > > > > available for the GAE community. >> >> > > > > On Aug 23, 10:46 pm, moissinac <[email protected]> wrote: >> >> > > > > > I've made some tests withWURFL(from sourceforge) >> > > > > > It works very well on my development platform >> > > > > > But it fails on GAE due to the size limit:WURFLuses a huge XML file >> > > > > > and GAE fails to open the compressed version of the file >> > > > > > For now, I have no time to resolve this issue until end of >> > > > > > september >> >> > > > > > On 23 août, 21:10, "Ikai L (Google)" <[email protected]> wrote: >> >> > > > > > > Can you use the user-agent? >> >> > > > > > > On Sat, Aug 21, 2010 at 11:12 PM, prgmratlarge >> > > > > > > <[email protected]>wrote: >> >> > > > > > > > Need a quick and easy way to detect mobile phones from my app, >> > > > > > > > that >> > > > > > > > won't add too much performance overhead. Any suggestions? >> >> > > > > > > > -- >> > > > > > > > You received this message because you are subscribed to the >> > > > > > > > Google Groups >> > > > > > > > "Google App Engine" group. >> > > > > > > > To post to this group, send email to >> > > > > > > > [email protected]. >> > > > > > > > To unsubscribe from this group, send email to >> > > > > > > > [email protected]<google-appengine%2Bunsubscrib >> > > > > > > > [email protected]> >> > > > > > > > . >> > > > > > > > For more options, visit this group at >> > > > > > > >http://groups.google.com/group/google-appengine?hl=en. >> >> > > > > > > -- >> > > > > > > Ikai Lan >> > > > > > > Developer Programs Engineer, Google App Engine >> > > > > > > Blog:http://googleappengine.blogspot.com >> > > > > > > Twitter:http://twitter.com/app_engine >> > > > > > > Reddit:http://www.reddit.com/r/appengine > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
