I am trying to write a change listener based on NodeJS or PHP. We have a huge database in MSSQL server. I want the change listener to be listening for a change in database for example a specific column changes in database and the change listener gets the information of that particular row that has been modified and than perform operations on it. I am not trying to make a real-time application for the users. I am just trying to log the changes of one local database in an remote database and I am require todo it in NodeJS or PHP. You can see the image i am posting below.
http://i.stack.imgur.com/c3jD6.png
The part That I totally Understand
I know that what I can do is make a request to database every x amount of time. I can use sockets or long polling etc. (NOTE: Please correct me if I am wrong)
The part that I dont understand
How I will be able to get only that particular row that has been modified through sql query? (NOTE: I can just get the data from that database, I am not able to modify anything in database). Database is so huge I will not be fetching all the rows again and again. I have not idea on this.
Note I am not doing any replication. What I am actually doing is monitoring a column in SQL server for changes and according to that change I perform certain operations in Remote database.