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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:34:04+00:00 2026-06-13T07:34:04+00:00

I have a good old-style LAMP webapp. A week ago I needed to add

  • 0

I have a good old-style LAMP webapp. A week ago I needed to add a push notification mechanism to it.
Therefore, what I did was to add node.js+socket.io on the server and poll the MySQL database every 10 seconds using node.js to check whether there were new items: if so, I would have sent them to the client(s) with socket.io.
I was pretty happy with the result, even if that is not a proper realtime notification (as there is a lag of up to 10 secs).

Now, I am about to build a new webapp which will need push notifications, too. I am wondering whether to go with the same approach as the first one (that I believe is more stable and mature) or to go totally Node.js, without PHP and Apache. As for the database, I have already decided to go for MongoDB.

Finally, my question is: if I go for Node.js+Socket.io+MongoDB will I get a truly near-real-time webapp? I mean, as soon as a new record is inserted into MongoDB, will there be some sort of event triggered that I can catch via node.js, do some checking on it and, if relevant, send the notification to the client? Or will there be anyway some sort of polling on the db server-side and lag, as with my first LAMP webapp?

A related question: can you build a realtime webapp on MySQL without doing any polling as I did with my first app. Or do you need MongoDB (or Redis)?

I hope this question is not too silly – sorry, I am just starting with Node.js and co.

Thanks.

  • 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-13T07:34:06+00:00Added an answer on June 13, 2026 at 7:34 am

    I understand your problem because I switched to node.js from php/apache/mysql too.

    • Generally node.js is stable, modules and your scripts are the main reasons for errors

    • Real-time has nothing to do with database, it’s all about client and server, you can query as many data as you want in your requests and push it to the other client.

    • Choosing node.js is very wise but it’s harder to implement.

    • When you insert a new record to your db, the event is the request itself, you will make a push event along with the database query something like:

      // Please note this is not real code, just an example of the idea
      app.get('/query', function(request, response){
          // Query your database
          db.query('SELECT * FROM users', function(rows){
      
               // Push notification to dan
               socket.emit('database_query_executed', 'to_dan', rows); 
      
               // End request
               response.end('success'); 
      
          })   
      })
      
    • Of course you can use MySQL! And any database you want, as I said real-time has nothing to do with databases because the database is in the middle of the process and it’s totally optional.

    • If you want to use node.js for push notifications and php/apache for mysql then you will need to create 2 requests for each server something like:

      // this is javascript
      ajax('http://node.yoursite.com/push', node_options)
      ajax('http://php.yoursite.com/mysql_query', php_options)
      

      or if you want just one request, or you want to use a form, you can call your php and inside php you can create an http or net request to node.js from php, something like:

      // this is php
      new HttpRequest('http://node.youtsite.com/push', HttpRequest::METH_GET);
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string: hello good old world and i want to upper case
Say I have the good old person/group/membership relationship class Person(models.Model): name = models.CharField(max_length=128) def
I have a good old fashioned windows service (inheriting from System.ServiceProcess.ServiceBase), to which I
In good old MFC, the DDX routines would have built in validation for form
I have a good friend (my old college roommate, actually), who critiques my personal
I'm trying to prevent a user from disabling style.(I HAVE A GOOD REASON TO
Anyone have good book / article recommendation for procedural generation of background music? (No
Does JQueryMobile have good support for entering credit card information. Users have a really
Does gwt have (good) support for effects, moving around elements, and resizing them? Are
Can I have good example or code about how to use Ajax Datepicker in

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.