Question

I have an appengine application using gcs storing a lot of images and serving them thru blobstore. So what's the suggested way to backup gcs? One problem is that for each image in gcs, I'm storing the blobkey in db, which means if I copy the image, the blobkey is different. In worst case, I've got to write the backup and restore program, but I'm wondering if there're any existing solutions.

No correct solution

OTHER TIPS

I am not aware of an existing solution, but I would suggest the following solution.

For a true backup, you probably want to be outside of GCS. You can create a bucket in Amazon's S3 service, which is very similar to GCS. First, you save an image to a bucket in GCS. Then, you save the same file to a bucket in S3 using the same key/object name that you used for GCS.

In your code, you can add simple logic to serve a file from GCS first, but if it fails, to serve it from S3. The only difference is a path to the file.

If you prefer to stay within GCS, you can have two buckets - production and backup, and set up a cron job to periodically sync them. Again, you can use the same object name as object names have to be unique within a bucket. If a file has a unique object name in production bucket, it is guaranteed to be unique in backup bucket as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top