-
-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create database backup on server startup #3069
Open
dudantas
wants to merge
13
commits into
main
Choose a base branch
from
dudantas/create-database-backup-on-server-startup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+134
−4
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dudantas
changed the title
feat: create database backup
feat: create database backup on server startup
Nov 7, 2024
dudantas
force-pushed
the
dudantas/create-database-backup-on-server-startup
branch
from
November 7, 2024 06:26
f23e8a5
to
95a9d3e
Compare
dudantas
force-pushed
the
dudantas/create-database-backup-on-server-startup
branch
from
November 12, 2024 19:12
5c988af
to
b453b80
Compare
Quality Gate passedIssues Measures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This update introduces a refined automatic database backup feature during the server startup process and periodic save intervals. The main improvements include:
Conditional Compression: The database backup can now be compressed using gzip. When the
compress
parameter is set totrue
, the backup file is compressed, saving disk space. Compression is applied for interval-based saves, which happen every 2 hours, to reduce storage usage over time.Backup Management: The system now organizes backup files into folders named by date. It also automatically deletes old backups:
Automatic Cleanup: Compressed backups are only deleted when a non-compressed backup is being created, and they are older than 24 hours. This mechanism prevents accumulation of outdated compressed backups while ensuring that recent backups remain accessible.
The motivation behind these changes is to create a more efficient and reliable way of managing database backups, ensuring data safety while optimizing storage space usage. The feature can be highly useful for production servers, as it creates backups during startup and periodically, minimizing risks of data loss while efficiently managing disk usage.
Behaviour
Actual
On server startup or during periodic saves, no database backup was created automatically, potentially putting the data at risk of loss. There was no effective mechanism for managing old backup files.
Expected
On server startup, a backup of the entire database is automatically created, including all tables and data types, ensuring data is always safeguarded. Periodic saves occur every 2 hours, and compressed backups are generated. Older backups are managed automatically:
Type of change
How Has This Been Tested
The database backup feature has been tested by:
Checklist