Take the 2-minute tour ×

I have a web app where users can follow one another. When one user publishes some action, I'd like that action to appear in the feeds of followers. A simple approach might be keeping a feed.xml file for each user, which is updated like:

UserA is followed by UserB, UserC.

UserA publishes some content.

Update UserB, UserC xml feeds, like:

// feed-UserB.xml
UserA flew a kite.
UserX blah blah blah.

// feed-UserC.xml
UserA flew a kite.
UserY blah blah blah.

this is like pubsub (I think). I don't need it to be realtime though. I'm not sure how the case of many followers is handled. If a user has 1 million followers, doesn't the hub have to sit there and notify all 1 million subscribers? If the hub is run on a single server, this could tie up the cpu for a long time, right?


share|improve this question
Do you have a million users? –  Marcelo Cantos Jul 26 '10 at 22:37
I have 1 million users give or take 1 million users. Really I'm just curious as to how this case is handled, do the notifications have to be shuttled off to separate machines and such to handle that kind of load? Thanks –  user246114 Jul 26 '10 at 22:41
add comment

1 Answer

up vote 0 down vote accepted

What you need to know is whether you have a situation with many subscribers to a few publishers or a more evenly distributed solution with few subscribers to many publishers.

If this is the former, it may not be smart to write all XML files when A updates, but just generate "upon" demand, assuming that the demand in question will be low enough so that you don't have to generate all the X,Y,Z files for each of A's updates. This would be called : updates on reads.

If this is the latter, then, you're approach is better : updates on writes : you build X, Y and Z's every time A updates.

share|improve this answer
Makes sense, thank you. –  user246114 Aug 10 '10 at 14:16
add comment

Your Answer


