Subject Re: [firebird-support] Updating remote DB
Author Milan Babuskov
Sudheer Palaparambil wrote:
> What I have in mind is to keep a thread for each table to write its
> records into small packets and push it to a FTP space. And pull the same
> from the server side and populate its tables.

I'm not sure what you mean by threads? You have two possible approaches

1. use some kind of on-line replication. As soon as the record is
inserted, updated or deleted replicate the change to main database. For
this you don't need to mess with FTP, simply execute the query on remote
server. For security, it would be good if computers are in VPN, or
alternatively, you can setup a secure tunnel using SSH, stunnel or zebedee.

2. transfer batches of data. For this, FTP is not a bad idea since FB
has heavy communication protocol. I have implemented something like
this. I extract the data that needs to be transfered with FBExport and
dump it to file. Then I zip the file and FTP to destination. In initial
version I had a job setup at server that periodically unpacks the
packets and inserts the data. This wasn't very good solution, as I
wanted users (instead of me) to monitor the system and restart the data
transfer. So I created a small web service that I call when FTP file is
sent, and it unpacks it and uploads the data. While doing all that, it
reports back to the caller, so user sees what the main server is doing
with his packets.

Please note that I'm dealing with computers which are offline all the
time (except during data transfer).

> Is there any other alternative?

If you expect hosts to be on-line most of the time, than replication(1)
seems a better idea. Make a search on existing replication software for
Firebird, some may already do everything you need.

Milan Babuskov