Professional Cloud Architect free question 4 / 10 · Domain 2: Managing and provisioning a cloud solution infrastructure
In a Cloud Storage bucket that holds product design data, files are sometimes overwritten by mistake. You want to read the version from before the overwrite, compare the contents, and restore that version if needed. At the same time, you want to avoid versions growing without limit and inflating storage cost. Which configuration is appropriate?
- Enable Object Versioning, and keep noncurrent versions without regard to their number, because they are billed at a lower rate than the live version
- Set a retention policy so that the version before an overwrite is kept for the retention period, and cost stays low because it can be deleted after that
- Enable soft delete, and read and restore the pre-overwrite version, because versions past the period are removed and cost does not grow
- Enable Object Versioning, and use lifecycle management to delete older versions once a set number of newer versions exist
Show the answer and explanation
Answer: D
Why this is correct
In a bucket with Object Versioning enabled, Cloud Storage keeps a noncurrent version each time the live version is replaced or deleted. Noncurrent versions are identified by generation number and can be read, so you can compare the content from before an overwrite and restore a particular version. However, there is no default limit on the number of versions, and noncurrent versions are billed at the same rate as when they were live. So when using versions, the page recommends considering lifecycle management that deletes older versions after a certain period or once newer versions exist, and says to use Object Versioning when you set a lifecycle rule that keeps a fixed number of noncurrent versions.
Why the other options are wrong
"Enable soft delete, and read and restore the pre-overwrite version, because versions past the period are removed and cost does not grow" … The page says noncurrent objects can be read, whereas soft-deleted objects are kept offline and cannot be read. That does not suit reading and comparing pre-overwrite versions, and restoring from soft delete also needs specific IAM permissions that are in the Storage Admin role.
"Enable Object Versioning, and keep noncurrent versions without regard to their number, because they are billed at a lower rate than the live version" … Noncurrent versions are billed at the same rate as when they were live. There is also no default limit on the number of versions, so if you keep them without regard to their number, storage cost rises as versions accumulate.
"Set a retention policy so that the version before an overwrite is kept for the retention period, and cost stays low because it can be deleted after that" … In a bucket with a retention policy, an object cannot be deleted or replaced until it passes the retention period, and an attempt to replace it fails with a 403 error. This is not a way of keeping earlier versions; the overwrite itself is blocked, so updating the design data becomes impossible.
When to use which
If the goal is protection from accidental or malicious deletion, the page recommends soft delete rather than Object Versioning. Soft delete also covers bucket deletion, while Object Versioning does not protect against deleting the bucket. The page also describes enabling both on the same bucket, deleting old noncurrent versions with lifecycle management, and using soft delete as the additional protection.