avatarGanesh Chandrasekaran

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2358

Abstract

">is</span> reserved <span class="hljs-keyword">for</span> <span class="hljs-keyword">access</span> <span class="hljs-type">point</span> <span class="hljs-keyword">alias</span> names. <span class="hljs-keyword">For</span> more information, see <span class="hljs-keyword">Using</span> a bucket-style <span class="hljs-keyword">alias</span> <span class="hljs-keyword">for</span> your <span class="hljs-keyword">access</span> <span class="hljs-type">point</span>.</pre></div><div id="0b6d"><pre><span class="hljs-number">7.</span> Bucket names must be <span class="hljs-keyword">unique</span> <span class="hljs-keyword">within</span> a <span class="hljs-keyword">partition</span>. A <span class="hljs-keyword">partition</span> <span class="hljs-keyword">is</span> a grouping <span class="hljs-keyword">of</span> Regions. AWS currently has three partitions: aws (Standard Regions), aws-cn (China Regions), <span class="hljs-keyword">and</span> aws-us-gov (AWS GovCloud [US] Regions).</pre></div><div id="4efd"><pre><span class="hljs-number">8</span>. Buckets used <span class="hljs-keyword">with</span> Amazon S3 Transfer Acceleration can<span class="hljs-symbol">'t</span> have dots (.) <span class="hljs-keyword">in</span> their names.</pre></div><p id="cc73"><b>Example</b></p><p id="ebfc"><b>valid bucket names</b></p><div id="3ace"><pre>docexamplebucket1</pre></div><div id="d1fa"><pre><span class="hljs-built_in">log</span>-delivery-march-<span class="hljs-number">2020</span></pre></div><div id="391a"><pre><span class="hljs-keyword">my</span>-hosted-content</pre></div><p id="a524"><b>valid but not recommended for uses other than static website hosting</b></p><div id="0dc6"><pre>docexamplewebsite.<span class="hljs-keyword">com</span></pre></div><div id="ad57"><pre>www<span class="hljs-selector-class">.docexamplewebsite</span>.com</pre></div><div id="375a"><pre>my<span class="hljs-selector-class">.example</span><span class="hljs-selector-class">.s3</span>.bucket</pre></div><p id="117e"><b>Not Valid bucket names</b></p><div id="64f6"><pre>doc_example_bucket (<span class="hljs-keyword">contains</span> underscores)</pre></div><div id="8838"><pre>DocExampleBucket (<span class="hljs-keyword">contains</span> uppercase letters)</pre></div><div id="0339"><pre>doc-example-bucket- (<span class="hljs-keyword">ends</span> <span class="hljs-keyword">wit

Options

h</span> <span class="hljs-keyword">a</span> hyphen)</pre></div><p id="8d12"><b>Folder / Object best practices</b></p><ol><li>Don’t use the sequential prefix.</li></ol><blockquote id="c979"><p><i>Using a sequential prefix, such as timestamp or an alphabetical sequence, increases the likelihood that Amazon S3 will target a specific partition for a large number of your keys, overwhelming the I/O capacity of the partition</i></p></blockquote><p id="d994"><b>example:</b></p><p id="3601"><b>Avoid this pattern</b></p><div id="5f77"><pre>file<span class="hljs-symbol">name1</span>.parquet file<span class="hljs-symbol">name2</span>.parquet file<span class="hljs-symbol">name3</span>.parquet</pre></div><div id="e176"><pre><span class="hljs-attribute">or</span></pre></div><div id="29f8"><pre>filename_<span class="hljs-number">20210101</span>.csv filename_<span class="hljs-number">20210102</span>.csv</pre></div><p id="709e">Add random prefix, the easy way would be to generate <b>HASH Keys</b> and prefix them.</p><div id="8b15"><pre>someprefix_file<span class="hljs-symbol">name1</span>.parquet a<span class="hljs-symbol">notherprexi_filename2</span>.parquet</pre></div><div id="5a65"><pre><span class="hljs-attribute">or</span></pre></div><div id="4a95"><pre><span class="hljs-number">01012021</span>_filename.<span class="hljs-built_in">csv</span> <span class="hljs-number">02012021</span>_filename.<span class="hljs-built_in">csv</span></pre></div><p id="930f">2. Be consistent with the case. Choose all lowercase vs camelCase vs with underscores is a purely personal choice.</p><p id="dcdb">If it's a single term use lower case, if it's a multiword cameCase does make it easy to read.</p><p id="c327"><b>Example:</b></p><div id="a22d"><pre>rawdata <span class="hljs-comment">-- single term</span></pre></div><div id="fb79"><pre>areaweeklyrawdata <span class="hljs-comment">-- makes it bit hard to read</span></pre></div><div id="cf6e"><pre>areaWeeklyRawdata -- Multi work, <span class="hljs-keyword">using</span> camelCase makes it easier <span class="hljs-keyword">to</span> <span class="hljs-keyword">read</span>.</pre></div><p id="5638">Whichever standard is followed, it should be consistent across all objects.</p><p id="a42f"><a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Source</a></p></article></body>

Amazon AWS S3 bucket & object best practices

The following best practices/rules apply for naming buckets in Amazon S3.

Photo by Joshua Hoehne on Unsplash

S3: Simple Storage Service (Cloud Storage)

1. Bucket names must be between 3 and 63 characters long.
2. Bucket names can consist only of lowercase letters, numbers, dots (.), and hyphens (-).
3. Bucket names must begin and end with a letter or number.
4. Bucket names must not be formatted as an IP address (for example, 192.168.5.4).
5. Bucket names must not start with the prefix xn--.
6. Bucket names must not end with the suffix -s3alias. This suffix is reserved for access point alias names. For more information, see Using a bucket-style alias for your access point.
7. Bucket names must be unique within a partition. A partition is a grouping of Regions. AWS currently has three partitions: aws (Standard Regions), aws-cn (China Regions), and aws-us-gov (AWS GovCloud [US] Regions).
8. Buckets used with Amazon S3 Transfer Acceleration can't have dots (.) in their names.

Example

valid bucket names

docexamplebucket1
log-delivery-march-2020
my-hosted-content

valid but not recommended for uses other than static website hosting

docexamplewebsite.com
www.docexamplewebsite.com
my.example.s3.bucket

Not Valid bucket names

doc_example_bucket (contains underscores)
DocExampleBucket (contains uppercase letters)
doc-example-bucket- (ends with a hyphen)

Folder / Object best practices

  1. Don’t use the sequential prefix.

Using a sequential prefix, such as timestamp or an alphabetical sequence, increases the likelihood that Amazon S3 will target a specific partition for a large number of your keys, overwhelming the I/O capacity of the partition

example:

Avoid this pattern

filename1.parquet
filename2.parquet
filename3.parquet
or
filename_20210101.csv
filename_20210102.csv

Add random prefix, the easy way would be to generate HASH Keys and prefix them.

someprefix_filename1.parquet
anotherprexi_filename2.parquet
or
01012021_filename.csv
02012021_filename.csv

2. Be consistent with the case. Choose all lowercase vs camelCase vs with underscores is a purely personal choice.

If it's a single term use lower case, if it's a multiword cameCase does make it easy to read.

Example:

rawdata  -- single term
areaweeklyrawdata  -- makes it bit hard to read
areaWeeklyRawdata -- Multi work, using camelCase makes it easier to read.

Whichever standard is followed, it should be consistent across all objects.

Source

AWS
S3
Bucket
Folders
Objects
Recommended from ReadMedium