'What is the storage cost of an empty key on S3
Suppose I upload a zero length object to S3 and then walk away. Will I be charged (monthly) for storing it, besides the initial put? Or is the metadata for that object "free".
Solution 1:[1]
You will likely be changed for one PUT/POST request which is about $0.000005
Solution 2:[2]
The Amazon documentation is not clear on this, but there are a few things that lead me to assume that zero-length objects accrue storage costs.
- The S3 Billing FAQs mention that metadata is included in storage costs.
The volume of storage billed in a month is based on the average storage used throughout the month. This includes all object data and metadata stored in buckets that you created under your AWS account.
https://aws.amazon.com/s3/faqs/#Billing
- Metadata includes mandatory system-defined fields, such as ETag and the LastModified timestamp.
There are two kinds of metadata in Amazon S3: system-defined metadata and user-defined metadata.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html
- Even delete markers, which are comparable to zero-length objects, are charged for the storage of their key name.
Delete markers accrue a nominal charge for storage in Amazon S3. The storage size of a delete marker is equal to the size of the key name of the delete marker. A key name is a sequence of Unicode characters. The UTF-8 encoding adds 1–4 bytes of storage to your bucket for each character in the name.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeleteMarker.html
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 | jellycsc |
| Solution 2 | Gary Fernie |
