Suppose I have a database locally and I want to send data to a remote database. How would I know that there is a connection between the remote and local databases and know when there is no connection between them? In case of no connection, the data would be written to the logs and when the connection comes back up we would sort the data according to their timestamp locally and then send it to the remote server.
I was thinking of keep pinging the remote database, if we get a response to the ping then it would mean that the remote database is accepting requests otherwise there is no connection. But this would spam the server with lots of requests. Is there any better way?
Aucun commentaire:
Enregistrer un commentaire