A stack is spawned from a database backup and once it passes tests, replaces the previous one.
Not sure how smart this all is but my goal is to learn through application.
A stack is spawned from a database backup and once it passes tests, replaces the previous one.
Not sure how smart this all is but my goal is to learn through application.
In order to not lose data, you can't have any writes between the time when the backup was taken and the present, or you need code which reconciles additional state and adds it onto the backup before switching over.
Normally, backup restoration is done during a maintenance window where the site is disabled so no writes can happen, and then usually a window of writes are lost anyway (i.e. 'last X hours, since the backup was taken')
For your use-case, do you just have very few writes? Do you lose writes? Do you have some other clever strategy to deal with it?
A typical bank / credit union may only serve one town. As such, it would be socially acceptable to designate 3am to 4am as a regular maintenance window where services are shutdown.
I like this approach, although risky if you mean you routinely replace the production db.
My preferred setup is to automate restores into a pre-prod environment, apply data masking and run tests there. It's not a replacement for full DR exercises, but at least it automates the backup verification process as part of your build system.
The stack replaces the previous one or the backup replaces the previous one? While having a single backup is a good start, you might want to consider keeping several backups so you can restore from, say, a data entry error that you discover two months after it happens.
Database images are immutable and a history of them are kept.