I think it called "fan out".
Overall its probably the most scalable - as you note a) is pretty hard-core.
However saying that using DataStore 'stringlists' could make it work
it pretty well. When someone makes a post, you add a string list
listing all their followers. Each post will have to store the whole
followers list.
Then to display someone's "inbox" you just run a query looking for all
posts with the user listed in the followers list.
- writing the post - will be expensive - due to all the index writes.
(2 per follower?) But ultimately that might be cheaper than writing a
whole entity to everyones inbox.
- and when someone gains or looses a follower you have to iterate
though their posts adding/removing the new user. (but compare that to
have to iterate though all their posts, and copy/remove all the posts
into the second users inbox)
... there probably is no perfect answer :)
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/1WEnOApSj4sJ.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
GAE memcache is limited.
I’m about to crash so here is how I’d do it really fast.
User A posts update.
All Subscribed users get marker to check for updates
If UserB has Marker to check for updates he does.
If no marker last “report” is repeated.
Marker is a single byte you can keep lots of them in memcache.
GAE is going to be expensive because you basically have to plan on 1 read and write per update from the user and 1 read for each updated online friend, and 1 write for the final version
If average user is online 1 hour a day, and during their hour they see 20 updates. That is 40 reads and 20 writes
And you can’t very well miss stuff, though Fb and twitter do… but they have as much memcache as they want. We don’t.
Brandon Wirtz | ||||
| ||||
--