title: how to architect achievements and badging with nosql
body: <p>I currently have an social game app using mongodb for it's database.  My question is what are some suggestions if I want to create a points and badging system.  The business logic for achievements/badges could become quite complicated and are very ad-hoc so doing real-time awarding of badges would not seem efficient.  I am imagining adding tracked actions to a queue somewhere, i.e. Amazon SQS, or just using a user's activity feed as a queue, and have another offline worker process going through and just processing the effects of every action/activity to see if the threshold for any particular badge is crossed.</p>
  
  <p>My worry with this method is that it seems like the badge queries can become quite intensive and I'd also have to track a very large number of actions.  I can envision achievements ranging from things like a badge for someone that's scored 2nd place every week for the past 4 weeks, or a badge for someone that has a friend in every single one of 50 states... etc...</p>
  
  <p>Are there more elegant or tried-and-true methods for this type of stuff?  Would it make sense to use another database for achievements/activity feed/leaderboards besides mongo, creating a mongo/other db hybrid environment?</p>
  
  <p>Are choices like Redis, Neo4J, or just plain old SQL Server a good choice for a hybrid solution?  I like Mongo so that will stay as our primary db, but curious to see if adding another db to the mix would help.</p>