title: How to implement a personalized event stream?
body: <p>I'm going to work on an inspiration site for a NGO, and I'm looking to implement some sort of Facebook-esque event stream, with events like “Michael recommended <em>apple pie</em>”, “John commented on <em>chocolate cake</em>”, “<em>Caramel fudge</em> was posted 8 hours ago by Alice”, etc.</p>
  
  <p>The thing is that these events are interest-based, so someone only be interested in caramel and cherries and should not see apple pies or chocolate cakes then. There are a lot of permutations for this, and generating a user’s personalized event stream on the fly would mean some rather expensive database-queries.</p>
  
  <p>So my thinking was to pre-generate a relation between the receiving user and the posted event (probably a simple SQL JOIN-table) by doing some sort of background processing whenever an action event is happening.</p>
  
  <p>The work required to weigh the preferences of hundreds of users against an event is bound to be substantial, so it cannot be done as a part of POST request that triggers the work, so I’ll have to do a lot of the work in a different process. I’m currently looking at <a href="http://gearman.org/" rel="nofollow noreferrer">Gearman</a> for this task, but I’m very open to suggestions.</p>
  
  <p>I’m not looking for someone to do my work for me, but if anyone has any prior experience with building this sort of thing, I'd love to hear your thoughts.</p>