title: Warn user when new data is inserted on database
body: <p>I don't know how to search about this so I'm kinda lost (the two topics I saw here were closed).</p>
  
  <p>I have a news website and I want to warn the user when a new data is inserted on the database. I want to do that like here on StackOverflow where we are warned without reloading the page or like in facebook where you are warned about new messages/notifications without reloading.</p>
  
  <p>Which is the best way to do that? Is it some kind of listener with a timeout that is constantly checking the database? It doesn't sounds efficient...</p>
  
  <p>Thanks in advance.</p>