AWS S3 Versioning and Billing for Multiple Uploads

S3 Versioning and Billing Explanation

Prev Question Next Question

Question

With S3 Versioning enabled on the bucket, how will billing be applied for the following scenario using the same key for upload? Total days bucket in use: 25 days. 1st File uploaded on 1st Day of the use - 1 GB.2nd File uploaded within the same bucket on the 15th Day of the use - 5 GB.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer: B.

When versioning is enabled on the S3 bucket, and a new version is added to an existing object, remember that the older version still remains and AWS charges the same price for old versions and new versions.

In the given use case, 1 GB uploaded on day 1 remains in S3 for 25 days.

5 GB uploaded on day 15 will be in S3 for only 11 days.

Q: How am I charged for using Versioning?

Normal Amazon S3 rates apply for every version of an object stored or requested. For example, let’s look at the
following scenario to illustrate storage costs when utilizing Versioning (let’s assume the current month is 31 days long):

1) Day 1 of the month: You perform a PUT of 4 GB (4,294,967,296 bytes) on your bucket.
2) Day 16 of the month: You perform a PUT of 5 GB (5,368,709, 120 bytes) within the same bucket using the same key
as the original PUT on Day 1.

When analyzing the storage costs of the above operations, please note that the 4 GB object from Day 1 is not deleted
from the bucket when the 5 GB object is written on Day 15. Instead, the 4 GB object is preserved as an older version and
the 5 GB object becomes the most recently written version of the object within your bucket. At the end of the month:

Total Byte-Hour usage
[4,294,967,296 bytes x 31 days x (24 hours / day)] + [5,368,709,120 bytes x 16 days x (24 hours / day)] =
5,257,039,970,304 Byte-Hours.

Conversion to Total GB-Months
5,257,039,970,304 Byte-Hours x (1 GB / 1,073,741,824 bytes) x (1 month / 744 hours) = 6.581 GB-Month

When versioning is enabled on an S3 bucket, each version of an object is stored as a separate object, and each object version has a unique version ID. In this scenario, we have two versions of the object with the same key, and both versions have been uploaded within the same bucket.

Now, let's consider each option:

A. Charges 6 GB for 25 days. This option assumes that S3 charges for the total storage consumed by all versions of the object for the entire duration of the bucket usage. However, this is not correct. S3 charges based on the amount of storage consumed by each version of the object and the duration that each version is stored.

B. Charges 1 GB for 25 days and 5 GB for 11 days. This option is correct. S3 charges for each version of the object based on the amount of storage consumed and the duration that each version is stored. In this case, the first version of the object is 1 GB and is stored for the entire duration of the bucket usage (25 days). The second version of the object is 5 GB and is stored for 11 days. Therefore, the total charge will be for 1 GB for 25 days and 5 GB for 11 days.

C. Charges 1 GB for 14 days and 5 GB for 11 days. This option assumes that the first version of the object is deleted or overwritten by the second version of the object. However, with versioning enabled, both versions are stored, and S3 charges for the storage and duration of each version.

D. Charges 5 GB for 25 days. This option assumes that only the latest version of the object is stored, and S3 charges based on the storage and duration of the latest version. However, with versioning enabled, all versions of the object are stored, and S3 charges for the storage and duration of each version.

Therefore, the correct answer is B. S3 will charge for 1 GB for 25 days and 5 GB for 11 days.