firefeed.io as a twitter clone suggests:
Every user has their own feed, which is a combined list of all sparks posted by them, and by all the users that they are following. No other sparks must appear in this feed.
Which basically means that if user A posts a tweet (= spark), it will be written in all the feeds of user A's followers. With this logic every user needs to observe only a single node.
But how could one handle the number of likes or retweets in this approach? Let's assume user B likes user A's tweet. I can only think of two ways:
- User B updates the likes count in all the feeds of the users that are followed by A with transactions.
- There is an additional node
tweetLikes/$tweetId
where the number of likes is changed with transactions. But this means that an observer is needed for every tweet retrieved from one's personal feed. This would destroy the abovementioned benefit of observing one single node.
Which one is prefferable? Are there better ways to accomplish this goal?