I
I
Igor Balyas2014-09-15 11:56:53
PHP
Igor Balyas, 2014-09-15 11:56:53

How to save data when the server crashes?

How can you save the data that was sent to the server via POST while it was lying?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Entelis, 2014-09-15
@ihorbalias

No way. If the server was lying, then those who sent the data simply could not reach it.
If you need to build a fault-tolerant system, you need to switch to a multi-server configuration using, for example, failover ip. (you can use Amazon route53 +
health check instead, but there will be a partial downtime of ~10 minutes in case of physical server failure) They checked if the backend nodes were alive and redirected requests there. In case of failure of one of the front, it was replaced by failover. In case of failure of one of the backs, it was automatically excluded from the distribution on the fronts

P
Pavel Volintsev, 2014-09-15
@copist

1. Send data with ajax and keep all requests on the stack. If the request did not go through now, try again in a minute. google mailer is trying to send or read something when the network is briefly disconnected.
2. Save a copy of the data you send to the browser's LocalStorage. If it was not possible to send now - send the next time when the browser user visits the same site. I forgot what this technology is called. Google Mail Offline and Google Docs Offline work like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question