Topic: Activity Feed Implementation

Hi,
im looking into building an activity feed like the Facebook wall.
I wanna show latest activities for a user and friends, grouped by similar items.

While searching around i read a lot about using redis and sorted sets. I would create a feed for each user and
union different sets together (if they are friends)

the one thing im not sure about is how to group items efficiently.

User A added new photo
  User B commented