of course it is possible...
I never dit it but...
if you want to update things in an sql database, you need to open the connections (both) but remember them in a variable...
Later when you make a query, you have to say with what connection you will work.
If you think this a little bit more, you can make your own functions, that will insert in both databases.
For files, you just have to open the files, write to them, and close them.
For this too, you will have to write a function if you only want 1 line of writing to the file
you will get a function that first opens the first file on your local computer, write to it, closes it and then opens the file on the server, writes to it and closes it...