There is a remote csv file that gets updated every second or so.
I need to download it(on a Windows machine) ONCE and always sync local file with the remote one.
Obviously, downloading the whole file every time is not an option. I need to download only the changes.(something like rsync, rdiff-backup)
I searched quite a bit but could not find how I can do this.
I am sort of new to nodejs and am using this app as an opportunity to expand my nodejs skills. Also, I am planning to use nodejs and to package it using node-webkit(https://github.com/rogerwang/node-webkit)
8
As the comments say, this is impossible without the remote server providing some sort of native diff.
I see two options
- Download the whole file and do a diff yourself – Potentially expensive, but works out of the box without requiring the remote server to add diff features.
- Add support for an update stream on the remote server – This would allow you to download the file once and then somehow subscribe to updates. The best way to do this entirely depends on the protocol which you have not specified. It could be as easy as running rsync or as complicated as a separate CSV file that has entries specifying the row, column, and the new value since the last fully generated main CSV file.
1