JQuery | Ajax | Continuously check for changes in database
<p>I'm creating a social media site, should I use a loop in javascript that continually loops, updating information on the page? Such as a status of friends (eg friends or pending). I feel like a loop would be rather overkill though. Should I setup timers in javascript that check every 5 seconds for changes in the database? Then updates the DOM with jquery. Thank you alot. Hopefully you don't think this question is too generic, I don't see any need to show code. It's theoretical talk. Thanks again. </p>

<p>Should I use node.js? Or websockets? Keep in mind, I plan for this site to have unlimited growing potential. What does facebook use?</p>