title: Website badge system
body: <p>I am currently working on a widget-based website, built entirely on user socialization. Since a reputation system pays off for attracting users, I decided to implement one of these.</p>
  
  <p>Now, I would like to hear some solutions on how should this be implemented the right way (take, for example, Foursquare's badge system).</p>
  
  <p>Basically, I need to be able to do the following:</p>
  
  <ul>
  <li>have a badges table, where I can add, edit and delete badges;</li>
  <li>be able to enable and disable a badge;</li>
  <li>be able to introduce a new badge, but <strong>without</strong> writing new code - simply give some parameters to the add badge form regarding what should be followed in order for a user to receive a badge;</li>
  <li>be able to give badges in real time - meaning that whenever a user accomplishes whatever it needs to receive a badge, the system should know immediately to give the badge to that user;</li>
  <li>also, the system should not be overloaded with "badge listeners" - I believe interrogating each user request with every badge requirements is time consuming;</li>
  </ul>
  
  <p>These being said, I would like to hear your opinions on how to implement the right way a badge system (logic, database schema, methods etc.)</p>