Just to clarify one point, 'IN' actully uses multiple queries under the hood, so a single 'IN' query does not really save you anything over doing the many queries yourself. Ie you still used a quota of 30 datastore calls.
2) i doubt is really going to scale as memcache might get flushed or entries removed at anypoint, so cant use it for data. Would still need to use the datastore to store such data. and would be doing it for all even if not needed which wastes resources. Without storeing the friend list yourself, think you are limited to 1) although you could use basically 2) to populate a StringList of friends in the datastore - just making sure to refresh it every 24 hours? 2009/6/9 Hugh <[email protected]>: > > I'm looking for some high level ideas on how to design a datastore for > a Facebook application. > > In this app a user can collect widgets. > I'd like to be able to show a user lists of the widgets owned by their > friends - something like: > > q = db.GqlQuery("SELECT * FROM Widget WHERE owner IN ( <friendlist> ) > and <other filter criteria> ") > > The problem with this approach is that friendlist can only have 30 > entries. > > Since the Facebook TOS don't allow you to store the friend list (for > more than 24 hours anyway), it seems like the options here are pretty > limited. > > Some of the ideas I've been considering are: > 1) divide into 30 friend chunks & make (potentially) lots of datastore > calls. > 2) Combine #1 with some background processing (cron or queues when > available) that do the datastore calls & > populate memcahed with the results. > 3) Use a clever design that allows you to formulate the query in such > a way that you don't hit 30 entry limit on "in" clauses > > Any thoughts? > > > -- 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 [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 -~----------~----~----~----~------~----~------~--~---
