Reputation: 197
I am trying to implement a db-to-server push model using node's watchFile functionality. Right now I am exporting an nfs4 share from the db. The server mounts that share. When the db processes new data, it touches files in its export location. The server sees the time change of the files and performs its push to clients.
Problem is that the server isn't seeing the files being updated until it performs a subsequent poll request. This effectively makes it a pull model, not a push. If I unmount the share serverside and touch files in the mount folder, watchFile performs just fine and sees changes within the default 5007ms window.
My alternate ideas include using scp to push files from the db to the server, - seems cludgy but I've tested it and watchFile works with it. I haven't gone the cifs route yet.
Should I give up on relying on nfs4 to behave with node's watchFile()? If not, what should I tweak/test? What alternative methods have worked for you?
Upvotes: 0
Views: 302
Reputation: 1014
I've seen the same over samba where watches are not triggered on the server. Turns out the underlying notify depends on the source of the change, not fundamental to the filesystem as you might expect.
scp and sftp should work fine, they do on all filesystems we use. Personally I would go with that as a more reliable method, even if your db choice changes in future.
Upvotes: 1