Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to model Push Notifications on server
    primarykey
    data
    text
    <p><strong>Brief Description</strong>:</p> <p>Well, since many days I've been looking for an answer to this question but there seems to be answers for 'How to create a Push Notification Server' and like questions. I am using node.js and it's quite easy to 'create' a push notification server using sock.js (I've heard socket.io isn't good as compared to sock.js). No problem till here. But what I want is how to <em>model</em> such a server.</p> <p><strong>Details</strong>:</p> <p>OK, so, let's say I've an application where there's a chat service (just an example this is, actual thing is big as you might have guessed). A person sends a message in a room and all the people in the room get notified. But what I want is a 'stateful' chat - that is, I want to store the messages in a data store. Here's where the trouble comes. Storing the message in the database and later telling everyone that "Hey, there's a message for you". This seems easy when we need the <em>real-time activity</em> for just one part of the app. What to do when the whole app is based on real-time communication? Besides this, I also want to have a RESTful api.</p> <p><strong>My solution (with which I am not really happy)</strong></p> <p>What I thought of doing was this: (on the server side of course)</p> <pre><code> Data Store || Data Layer (which talks to data store) || ------------------ | | Real-Time Server Restful server </code></pre> <p>And here, the Real-time server listens to interesting events that the data-layer publishes. Whenever something interesting happens, the server notifies the client. <strong>But which client? - This is the problem with my method</strong></p> <p>Hope you can be of help. :)</p> <p><strong>UPDATE</strong>:</p> <p>I think I forgot to emphasize an important part of my question. How to implement a pub-sub system? (NOTE: I don't want the actual code, I'll manage that myself; just how to go about doing it is where I need some help). The problem is that I get quite boggled when writing the code - what to do how (my confusion is quite apparent from this question itself). Could please provide some references to read or some advice as to how to begin with this thing?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload