Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8187327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:31:29+00:00 2026-06-07T02:31:29+00:00

Brief Description : Well, since many days I’ve been looking for an answer to

  • 0

Brief Description:

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 model such a server.

Details:

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 real-time activity 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.

My solution (with which I am not really happy)

What I thought of doing was this: (on the server side of course)

                 Data Store
                     ||
                 Data Layer (which talks to data store)
                     ||
            ------------------
            |                |
     Real-Time Server   Restful server

And here, the Real-time server listens to interesting events that the data-layer publishes. Whenever something interesting happens, the server notifies the client. But which client? – This is the problem with my method

Hope you can be of help. 🙂

UPDATE:

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:31:31+00:00Added an answer on June 7, 2026 at 2:31 am

    I am not sure if I understood you correctly; but I will summarize how I read it:

    1. We have a real-time chat server that uses socket connections to publish new messages to all connected clients.
    2. We have a database where we want to keep chat logs.
    3. We have also a restful interface to access the realtime server to get current chats in a lazier manner.

    And you want to architect your system this way:

    Current architecture of system

    In the above diagram, the components I circled with purple curve wants to be updated like all other clients. Am I right? I don’t know what you meant with “Data Layer” but I thought it is a daemon that will be writing to database and also interfacing database for other components.

    In this architecture, everything is okay in the direction you meant. I mean DataStore is connected by servers to access data, maybe to query client credentials for authentication, maybe to read user preferences etc.

    For your other expectation from these components, I mean to allow these components to be updated like connected clients, why don’t you allow them to be clients, too?

    Suggested design for backend components' connections to real-time server.

    Your realtime server is a server for clients; but it is also a client for data layer, or database server, if we prefer a more common naming. So we already know that there is nothing that stops a server from being a client. Then, why can’t our database system and restful system also be clients? Connect them to realtime server the same way you connect browsers and other clients. Let them enjoy being one of the people. 🙂

    I hope I did not understand everything completely wrong and this makes sense for the question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First, a brief description of the library that brought this up: I have a
I am looking for a brief description of the use of an assembler in
Problem description is brief but I think I don't need to say much. When
Summary A brief description of why anyone would want to attempt this. In a
Uhm I'm not sure if anyone has encountered this problem a brief description is
Can someone please fill in the blanks for me, including a brief description of
Brief question What command can I use to make my DataSet refresh it's connection
On the front page of my site I want to put a brief description
Firstly, let me give a brief description of the scenario. I'm writing a simple
I have product website. On one page I show thumbnails and a brief description

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.