Ian
Ian

Reputation: 13852

Google nearline pricing on overwrites

I have Google Nearline storage set up and working fine via gcloud/gsutil.

So far I have been using rsync to back some databases up eg...

rsync -d -R  /sourcedir/db_dir gs://backup_bucket/

Currently the files are datastamped in the filename, so we get a different filename every day.

I've just spotted the mention of early deletion charges (currently on trial).

I'm assuming whenever I delete a file with -d, I will get charged for that file up to 30 days ? If so, there's no point deleting it before then (but will get charged).

But if I keep the filename the same, but overwrite the file with the latest days backup, the text says...

"if you create an object in a bucket configured for Nearline, and 10 days later you overwrite it, the object is considered an early deletion and you will be charged for the remaining 20 days of storage."

So I'm a bit unclear, if I have a file and overwrite it with a new version, am I then charged again for each file/day, every time its updated as well as the new file ?

eg, for one file, backed up daily via rsync (assuming same filename this time)...over 30 days

day1 myfile is created

day2 myfile is updated

day3 myfile is updated

... and so on

Am I now being charged (filespaceday1 * 30days) + (filespaceday2 * 29days) + (filespaceday3 * 28) and so on... just for the one file (rather than filespace * 30 days)?

Or does it just mean, if I create a 10gig file, and overwrite it with a 2meg file, I will be charged for 10gig for the 30 days (and ignore the 2meg file costs) ?

If so, are there any best practices for rsync and keeping charges down ?

Upvotes: 3

Views: 188

Answers (1)

Brandon Yarbrough
Brandon Yarbrough

Reputation: 38389

Overwriting an object in GCS is equivalent to deleting the old object and inserting a new object in its place. You are correct that overwriting an object does incur the early delete charge, and so if you were to overwrite the same file every day, you would be charged for 30 days of storage every day.

Nearline storage is primarily meant for objects that will be retained for a long time and infrequently read or modified, and it's priced accordingly. If you want to modify an object on a daily basis, standard or durable reduced availability would likely be a cheaper option.

Upvotes: 4

Related Questions