title: how to implement facebook like notification?
body: <p>I am trying to implement a Facebook-like live notifications system to notify users whenever someone adds them as friend, like their post or posts replies to their comments. </p>
  
  <p>All the database and PHP part is done, but I can't figure out how to implement it like Facebook has. </p>
  
  <p>Whenever someone likes/comments on your post in Facebook the light blue box appears at the bottom left corner of the screen. This happens as soon as someone hits like button or posts comment in Facebook. I would like to know what I should do to implement this.</p>
  
  <p>Using YUI or any JavaScript framework I can query a database table after <code>n</code> seconds to check for notifications. This method is too heavy. </p>
  
  <p>I was wondering if there is any server side mod or scripting can be done so that whenever there is new notification entry in my database table the server will tell that particular client. That way unnecessary request calls from client to server will be avoided completely and system can work efficiently for website with more than 50,000 users online at a time. </p>
  
  <p>How can I achieve this?</p>