Hi, I'm having trouble deciding the best way to use the datastore for a new app, so I am hoping I can get some advice. I'm trying to decide the best way to keep my app fast and scalable.
You can think of it as an RSS reader. I'm trying to find a good way of keeping track of what articles each user has read so they can choose to see just the unread ones. Here are the options I've thought of: Option A - One object for each article with a list property that holds the userIDs of all the users who have read it. To get the list of unread articles for a user, I'd query with a filter that the list property != theUserID. I'm starting to doubt this would work, as it sounds like the query would match if ANY list entry was != theUserID (rather than ALL list entries != theUserID.) Also, adding userIDs to the list for that one object whenever a user reads the article might lead to contention. Option B - similar to Option A, but sharding the object for each article. That is, instead of 1 object per article, have multiple (e.g., 10) and map each user to always use the same shard. That might help the contention issue for marking which articles are read, but if Option A's query fundamentally won't work, the same problem exists here. Option C - Create a separate article object for each user. So if I (am lucky to) have 10,000 users, there would be 10,000 objects for each article, with each object specific to one user and holding just their read status. I think this would work, but it seems very wasteful. It might also be a challenge to create all those objects (when articles are added or next time each user logs in), perhaps being a problem or the 30 second task limit. I realize I could save some space by using objects that had only partial article info for each user (e.g., The article's key and any other properties for filtering), but then I think showing the list of unread articles would be a two step process (get the list of article keys, and then get the article content for display) Option D - One object per article, but separate objects to mark which have been read by individual users. Since the Datastore is different than a relational database, I think getting a list of unread articles would be a two step process: First get the list of articles, then get a list of all the read articles and remove them. So those are the best ideas I've come up with, but none seem very idea. Any suggestions would be greatly appreciated. Thanks! Tim -- 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-appeng...@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.