# Simple Question, Complex Answer?

**URL:** <https://www.ruby-forum.com/t/simple-question-complex-answer/158551>\
**Category:** Rails\
**Created:** [January 24, 2009, 7:10pm UTC](https://www.ruby-forum.com/t/simple-question-complex-answer/158551 "2009-01-24T19:10:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayhalleaux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f05b48/32.png) [@jayhalleaux](https://www.ruby-forum.com/u/jayhalleaux)\
**Post date:** [January 24, 2009, 7:10pm UTC](https://www.ruby-forum.com/t/simple-question-complex-answer/158551/1 "2009-01-24T19:10:55Z")

</div>

I am trying to make a multi-user DB application. My question is how  
do I keep the multiple users’ browser view in sync when a user updates  
the database? I want to avoid polling the server client-side to see  
if it has been updated. Is there any way the server can push a  
notification to all the other clients that the database has been  
updated and that it needs to refresh the data (I refresh will be done  
via AJAX so I can avoid a hard refresh).

My problem:  
User A logs in and viewing table A.  
User B logs in and viewing table A.  
User C logs in and viewing table B.

User A updates table A.  
User B viewing old table A.  
User C still viewing table B.

Solution I want:  
User A updates table A.  
User B viewing updated table A. (push notification received and table  
is updated)  
User C still viewing table B. (push notification ignored)

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![jayhalleaux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f05b48/32.png) [@jayhalleaux](https://www.ruby-forum.com/u/jayhalleaux)\
**Post date:** [January 25, 2009, 5:54am UTC](https://www.ruby-forum.com/t/simple-question-complex-answer/158551/2 "2009-01-25T05:54:39Z")

</div>

Have you looked at Comet?

> **[Comet (programming)](https://en.wikipedia.org/wiki/Comet_(programming))**
>
> Comet is a web application model in which a long-held HTTPS request allows a web server to push data to a browser, without the browser explicitly requesting it. Comet is an umbrella term, encompassing multiple techniques for achieving this interaction. All these methods rely on features included by default in browsers, such as JavaScript, rather than on non-default plugins. The Comet approach differs from the original model of the web, in which a browser requests a complete web page at a ti The u...

Do a quick search for Comet and Ruby - a few of the results point to  
Juggernaut, a Rails plugin that implements Comet:

1. [Purchase Intent Data for Enterprise Tech Sales and Marketing | TechTarget](http://ajaxian.com/archives/juggernaut-comet-for-rails)
2. 

> **[Comet Ruby On Rails](http://dineshakadinks.blogspot.com/2008/03/comet-ruby-on-rails.html)**
>
> Dinesh Vasudevan talks on a lot of things

Good luck. Summarize back what you find if you get a chance.

– Bosco
