Real Time Commenting System using node.js and socket.io in PHP/Codeigniter

I want to clear one my doubt.Currently I am working on one php-codeigniter project and there I need to display feeds/comments for authenticated users. So here is my architecture:

  1. For a first time when home page loads all feeds/comments related to particular user are fetched from database using PHP/codeigniter application server.
  2. After that Front-End communicates with PHP/Codeigniter application server to get more messages on autoload using AJAX i.e when user scroll down the page then more messages are fetched from server.
  3. Finally to access newly added messages in real-time is done with node.js server using socket.io.

So I just want to clarify is it a good architecture to display feeds/comments on your home page or any changes could be done to make it more better?

Depending on the amount of traffic your site may get, you may want to use a NoSQL database like MongoDB which you can access both from PHP and Node.js.

For simple text data (like comments), you may not necessarily need a relational database like MySQL.

You may have to write your own library wrapper around PHP's MongoDB driver/functionality, but that is doable.

As long as you have a single database for persisting the feed/comment data, you will not have any issues with inconsistencies.

Sounds like a fun project!