'Can I use GCP Snapshot for data or database backup? can I trust the snapshot to restore my DB data?

I am using the Google cloud platform and compute engine for my project, Installed MongoDB into the instance server, what is the best way to take my database back-up and restore

my options :

  1. create a custom script to dump -> zip -> upload to cloud storage.
  2. Use GCP snapshot to back-up data and restore while a new instance creating.

Let me know the best way of handling this.

Due to the non-reliable snapshot size got confused a bit.

While schedule snapshot

Enable application consistent snapshot



Solution 1:[1]

Yes you can use snapshot. Also consider below suggestion

Use additional data disk attached to Compute Instance for Database. In case any failure detach the disk and attach to new vm instance. Snapshot will help you in regional failure or when you need to restore backup in another region.Also snapshot size seems confusing to you because snapshots are incremental in nature. ex. snapshot-1 taken at 2:00 AM contains 10GB data. now you added 1 GB data to the disk at 2:30 AM and taken snapshot again at 3:00 AM. snapshot-2 at 3:00 AM will only contains 1 GB of data ( not 11 GB). but real magic is when you restore snapshot-2 , it will restore your complete 11GB of data as it contains reference to snapshot-1 with 10GB data.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vishal Bulbule