tford wroteIf we can push data to user_Y when user_X do an action...
Then the possibility are endless
My answer is a tangent to Ben's original post, but you can in fact push data to user_Y when user_X does an action.
I have a notification system in one of my BSVs in which a user can subscribe to be notified when certain updates are completed by other users. For example, a user may be interested in knowing when a certain date attribute is updated, a flag turned on, or a new customer is added. This notification system monitors a variety of different categories of updates, then finds the users that have subscribed to that category & writes an appropriate log record into the queue of the person who wants to be notified.
In addition to on screen notification of changes by other users, our system also triggers some periodic emails to users summarizing the changes. The frequency of the emails can be determined by the recipient.
Not quite as fancy & real-time as Facebook notifications, but the "real-time" factor can be as granular as you'd like with the auto refresh capabilities of AwareIM queries.
What you are describing is actually a push from user_x to the server .. and then user_y pulling data from the server.
Pushing in the context of client/server communication refers to the server-side pushing data to the client-side only when there is something to push. No auto-refreshes required.
The auto-refresh is a reasonable approach for occasionally checking the server/database for updates.
To use the same principle to simulate a real-time(ish) chat, on the surface it appears to be as straightforward as ramping up the frequency of auto-refreshes (maybe every 1-2 seconds) to check for new messages. And you may be able to get away with it for a hand full of users.
Unfortunately, constantly polling the server/database doesn't scale well. 99% of the time, there will be nothing returned, but the "cost" of the call to the server and database read is still there. Also constant database reads could cause blocking issues up to the point of completely locking up the db and taking down the whole system.