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 5952797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:43:58+00:00 2026-05-22T17:43:58+00:00

I am using a node.js server to create a ‘close to real-time’ socket between

  • 0

I am using a node.js server to create a ‘close to real-time’ socket between my web app and a database. Currently I am using MySQL which I am polling every second in node to check if there are any changes to the table (based on a timestamp.)

I was wondering if there any specific techniques to doing something like this with MySQL? At the moment, I am just running a SQL query and using setTimeout before the next poll.

I know it’s more common to use a NoSQL database in instances like this but I’m not really comfortable with the technology and I’d much rather use SQL.

Does anyone have any experience or tips for monitoring a SQL database with node?

  • 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-05-22T17:43:59+00:00Added an answer on May 22, 2026 at 5:43 pm

    I wouldn’t personally use a polling mechanism for this. I think this is a pretty good use case for a pub/sub mq as a component on top of the database that allows consumers to subscribe to specific channels for change events on entities that they care about.

    Ex:

    1. Someone requests that a model be changed
    2. Model broadcasts change event
    3. Queue up change to be persisted in the database
    4. Fire off a change set on a specific channel in a message queue for distribution to all interested parties

    You can use a very simple in process pub/sub mechanism for this type of thing using nodes EventEmitter, and as you need to scale, have durability requirements, or need a cross language MQ you can go to a technology like rabbitmq, zeromq, etc. I’ve started to implement something very lightweight to do just this in one of my applications: https://github.com/jmoyers/mettle/blob/master/src/pubsub.coffee

    It boils down to something like:

    pubsub.sub('users.*', function(updates){
        // Interested party handles updates for user objects
    });
    

    That way you aren’t putting stupid polling pressure on your database. In fact, change distribution is completely independent of writing to your database

    Josh

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

Sidebar

Related Questions

I'm using XPath to locate a node (or something close to it) in a
I am currently writing a multi-threaded C++ server using Poco and am now at
I've been using gimite / web-socket-js to implement a WebSocket past simply Chrome and
I want to create a chat room using HTML5 web sockets, but am pretty
I'm using nodejs to create a simple proxy server that logs http and https
I am trying to create a secure node.js server to use with my site
I'm doing chat system with nodejs . To create a node server I can
Frameworks like Node.js, Tornado, and Twisted let developers create server-push applications that supports large
I'm really interested in systems written in node.js. Specifically using it to create an
I am using node.js to build a tcp server, and I want to extract

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.