https://github.com/bastian/bstats-firestore-backup
https://github.com/bastian/bstats-firestore-backup
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bastian/bstats-firestore-backup
- Owner: Bastian
- Created: 2020-12-14T17:08:18.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-04T15:23:04.000Z (over 3 years ago)
- Last Synced: 2025-01-01T20:46:38.840Z (6 months ago)
- Language: JavaScript
- Size: 38.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bStats Firestore Backup
A simple Firebase Cloud Function that exports the bStats Firestore once per week into a Google Cloud Bucket.
## Once per week? Are you crazy? 😱
> Once per week sounds far to rare.!
> Imagine if the backup runs on Monday and the Firestore database gets lost on Sunday.
> We would lose a full week of historic line chart data!This is a legitimate concern.
Fortunately, one backup per week is more than enough because we also do hourly backups of the Redis database.
In the (very unlikely) case that the Firestore database gets lost (e.g., because of a programming error that purged
all data), we can easily use the Redis backups to restore the data that was lost since the last Firestore backup.### But still: Why not do a backup more often?
Because Firestore exports are expensive.
Exporting data from Cloud Firestore will incur one read operation per document exported.## License
This work is under exclusive copyright. You are not allowed to copy, distribute, or modify this work.