cloud-gov / cg-migrate-db

Export database from cloud.gov app
Other
4 stars 6 forks source link

Make backup/restore happen in a separate thread #6

Closed jcscottiii closed 5 years ago

jcscottiii commented 8 years ago

Currently as a user running cf export-data or cf import-data, the deployed app first streams the backup to s3 / restore the backup from s3 THEN starts the server on the cloud foundry app $PORT.

For very small databases, this would be very quick and the restore/backup app would start fairly quickly. However, for big databases, I anticipate that the user would see the following for a very long time.

0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting

If the database is huge, the app may fail to start before the app push timeout expires.

This issue is basically saying, put the backup/restore logic in a separate thread.

However, doing so would mean that we would need a way to indicate if the backup succeeded/failed asynchronously.

Possibilities: