D
D
delkov2016-10-14 12:06:05
linux
delkov, 2016-10-14 12:06:05

File transfer. How to write to the database from another server?

Good day, dear ones!
There is a linux-server with a Postgres-SQL database.
There is a windows-server that every second receives 4-5 text files of 1 kb via FTP.
It is necessary to transfer data from windows to linux as quickly as possible (without delays).
Something like a check: the file has arrived -> we send it right away.
* If there is no connection to linux, then we are waiting for a connection, and we send it en masse.
In this regard, the question is how to implement such a scheme.
Possible options:
1) When receiving a file, immediately write to the database from windows (create a script that checks for a new file in Windows).
2) Receive the file, then transfer it to linux via an analogue of scp / ftp / rsync (do some kind of synchronization), and write a script on linux that writes new files to the database.
* I'm not familiar with server windows, please tell me.
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DuD, 2016-10-14
@DuD

Да разницы по сути никакой.
Но если сетевая связанность может пропасть. То, как мне кажется лучше чем то вроде rsync(который поддерживает синхронизацию и докачку) лить файлы на linux, а на нем уже лить в базу. Ну это чтобы не писать собственный обработчик и чекер доступности БД.

R
Román Mirilaczvili, 2016-10-14
@2ord

The task is similar to mass mailing from a mail service.
On a Linux server, run an HTTP API micro-service that can receive data from outside and write data to the DBMS (a script, if you like).
On a Windows server, when a script receives data, launch a task via HTTP POST using the cURL program and the --retry. We need a mechanism for accounting for sent / unsent files, which can be solved using a queue server .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question