Commit Graph

32 Commits

Author SHA1 Message Date
Aman fa422f0980
Optimize backup performance for large PostgreSQL databases
Summary

Improves overall backup performance and reliability for larger PostgreSQL databases
while keeping the solution fully compatible with Railway environments.
Changes

    Uses PostgreSQL custom-format backups (pg_dump -Fc) for efficient storage
    Enables multipart, threaded uploads to Cloudflare R2 for faster and more reliable transfers
    Keeps backups restore-friendly, supporting parallel restores via pg_restore --jobs
    Updates documentation to accurately reflect performance behavior

Notes on Parallelism

    Parallel dumping (pg_dump --jobs) is intentionally not used, as it requires directory format
    and is not suitable for Railway containers
    Parallelism is supported at restore time using pg_restore --jobs with .dump files

Testing

    Tested on Railway using the deps-update branch
    Verified backup creation, encryption, upload, and retention cleanup
2025-12-23 11:23:40 +08:00
BigDaddyAman 799a0bf6ad docs: correct performance description 2025-12-23 11:17:58 +08:00
BigDaddyAman 367d366dec Add parallel pg_dump support and document PG_DUMP_JOBS 2025-12-23 11:08:14 +08:00
Aman 4559a44270
Merge pull request #12 Improve R2 upload reliability using multipart transfer
Tested on Railway before merging to main.
2025-12-23 10:19:52 +08:00
BigDaddyAman 07e45aa13e Optimize R2 upload using multipart transfer 2025-12-23 10:12:01 +08:00
Aman 7db29137f7
Merge pull request #11 from BigDaddyAman/deps-update
Update boto3 to 1.42.15 and py7zr to 1.1.0
2025-12-23 10:00:35 +08:00
BigDaddyAman e4130c4de2 Update boto3 to 1.42.15 and py7zr to 1.1.0 2025-12-23 09:57:26 +08:00
BigDaddyAman b2c1515291 chore(deps): update boto3 to 1.42.3 2025-12-05 07:07:54 +08:00
Aman 077929fb4d
Merge pull request #10 from BigDaddyAman/deps-update
This update adds detailed logging for the final compressed backup file size before it is uploaded to R2.

### Why this is useful
- Provides visibility into the size of each backup
- Helps monitor database growth over time
- Confirms that compression or encryption worked correctly
- Useful for debugging storage or retention issues

### Notes
- Tested successfully on Railway
- Backup flow works as expected: pg_dump → compress/encrypt → size log → upload → cleanup
- No breaking changes introduced
2025-11-25 05:23:05 +08:00
BigDaddyAman ae6ed0f9c2 Add backup file size logging 2025-11-25 05:13:30 +08:00
Aman c7efb36792
Merge pull request #9 from BigDaddyAman/deps-update
This pull request updates two dependencies to their latest stable versions:

- boto3: 1.40.37 → 1.41.3
- python-dotenv: 1.1.1 → 1.2.1

These updates include upstream bug fixes, minor improvements, and compatibility updates for AWS SDK functionality and environment variable handling.

All updated packages have been tested in the current project environment:
- Application starts without errors
- AWS-related features work as expected
- Environment variable loading behaves normally

No breaking changes observed. Safe to merge.
2025-11-25 05:05:32 +08:00
BigDaddyAman e197482251 Update boto3 to 1.41.3 and python-dotenv to 1.2.1 2025-11-25 05:03:10 +08:00
Aman cf955a3db2
Merge pull request #8 from BigDaddyAman/deps-update
### Summary
- Updated boto3 from **1.40.34 → 1.40.36**

### Why
- Keep AWS SDK up to date
- Ensures compatibility and includes the latest fixes

### Notes
- Tested on Railway with `deps-update` branch before merging
- No issues found
2025-09-24 21:58:22 +08:00
BigDaddyAman 33da212b16 chores: bump boto3 from 1.40.36 ti 1.40.37 2025-09-24 21:56:01 +08:00
Aman f79563f84a
Merge pull request #7 from BigDaddyAman/deps-update
### Summary
- Updated boto3 from **1.40.34 → 1.40.36**

### Why
- Keep AWS SDK up to date
- Ensures compatibility and includes the latest fixes

### Notes
- Tested on Railway with `deps-update` branch before merging
- No issues found
2025-09-23 17:13:33 +08:00
BigDaddyAman 3d8dbc895e chore: bump boto3 from 1.40.34 to 1.40.36 2025-09-23 17:11:50 +08:00
Aman d469cd3c19
Merge pull request #6 from BigDaddyAman/deps-update
- Updated boto3 to 1.40.35  
- Verified deployment on Railway using `deps-update` branch  
- No issues found during testing
2025-09-20 20:29:25 +08:00
BigDaddyAman 4ec90e3023 chore: update dependencies to latest versions 2025-09-20 20:28:00 +08:00
Aman eb2d470aa3
Merge pull request #5 from BigDaddyAman/deps-update
Dependencies updated and verified on Railway:

- boto3 bumped to 1.40.34
- Backup scheduler runs successfully
- Upload, encryption, and cleanup tested
- No issues in logs

Safe to merge into `main`.
2025-09-19 19:11:45 +08:00
BigDaddyAman e9e4f1b1fb chore: update dependencies to latest versions 2025-09-19 19:10:15 +08:00
Aman 00b29ea012
Merge pull request #4 from BigDaddyAman/deps-update
Updated dependencies (boto3 → 1.40.33)

Upgraded pip, setuptools, wheel in Docker build

Refactored Dockerfile to multi-stage for smaller runtime image
2025-09-18 14:32:29 +08:00
BigDaddyAman 6e191441da refactor: use multi-stage Dockerfile for smaller runtime image 2025-09-18 14:27:51 +08:00
BigDaddyAman 6ee948a3a0 chore: upgrade pip in Dockerfile 2025-09-18 14:25:21 +08:00
Aman de0e654b8a
Merge pull request #3 from BigDaddyAman/deps-update
- Updated boto3 to 1.40.33  
- Verified deployment on Railway using `deps-update` branch  
- No issues found during testing
2025-09-18 14:15:15 +08:00
BigDaddyAman b4c8fd572a chore: bump boto3 to 1.40.33 and refresh deps 2025-09-18 14:13:24 +08:00
Aman 15a801373e
Merge pull request #2 from BigDaddyAman/deps-update
Updated boto3 from 1.40.31 > 1.40.32. Tested in PR env.
2025-09-18 03:58:35 +08:00
BigDaddyAman a9865bd038 chore: bump boto3 to 1.40.32 2025-09-18 03:50:34 +08:00
Aman 27f226e13c
Merge pull request #1 from BigDaddyAman/deps-update
chore: bump boto3 to 1.40.31
2025-09-16 21:28:23 +08:00
BigDaddyAman c93c1ac918 chore: bump boto3 to 1.40.31 2025-09-16 21:24:34 +08:00
BigDaddyAman 09c328bc56
Update README.md 2025-09-13 22:12:51 +08:00
BigDaddyAman b5e0f2bd8b
Update README.md 2025-09-13 22:07:12 +08:00
BigDaddyAman 6d45e93666 Initial release: PostgreSQL backup bot with R2 support 2025-09-13 21:38:54 +08:00