title: Updating recent updates - Problem in procedure - Any other approach?
body: <p>I have a Section in my website called Recent Updates. in that I will show the latest 5 updates at first when the page is rendered. </p>
  
  <p>When a new update is done at real time, the new update will be appended to the top of the updates list and the last one will be deleted.</p>
  
  <p><strong>My approach:</strong></p>
  
  <p>For this problem, what I'm doing is, First i renders the page with last 5 recent updates. I am fetching updates from database. When a update is made in real-time, it will be stored in database with flag = 0. </p>
  
  <p>To find out whether any update is made, I have a JavaScript which calls the ajax page every 4 seconds. The ajax page checks in the db whether any records with flag=0 is present. If any of its there, then it will return back the update with flag=0 and set that flag to 1.</p>
  
  <p><strong>Problem:</strong></p>
  
  <p>It is working fine on a single system. But I haven't tested on multiple system at same time. I fear the each update can be viewed only by single user` and its flag is set to 1. So the other users may not get it.</p>
  
  <p>Is there any alternate approach in solving this issue? May be changing the query or something may yield results.</p>