title: websockets and database updates (push on change)
body: <p>I started to learn websockets today, since I want to have an architecture, with which I can get real-time updates.</p>
  
  <p>I created my first websockets node.js and socket.io app, so I can communicate via javascript between a client and server. That works fine.</p>
  
  <p>But I need something, that can communicate with a <strong>MySQL</strong>, so that for every change on a certain table, it has to tell the clients, that there is a change. </p>
  
  <p>So I was thinking that the node.js server communicates with a PHP script that observes the database. But then I would also need long-pulling to request changes, so I could do it with ajax anyway, so it would be useless.</p>
  
  <p>So my question: How can I achieve to get real-time data changes from a table of the database or from a certain query, which will send the update to all clients, that are connected in real-time, without long polling?</p>
  
  <p>Thanks !</p>