# S3

## Overview

* Amazon S3 has a **simple web services interface** that you can **use to store and retrieve any amount of data**, **at any time**, from anywhere on the web.<br>
* It uses the same **highly scalable, reliable, fast, inexpensive data storage** infrastructure that **Amazon uses to run its own global network of web sites**.

## Buckets

* A bucket is a **container for objects stored in Amazon S3**.<br>
* **Every object is contained in a bucket**.<br>
* They **must have a globally unique name** and the **name must follow the naming convection**.<br>
* You can **configure buckets so that they are created in a specific AWS Region**.<br>
* You can also **configure a bucket so that every time an object is added to it, Amazon S3 generates a unique version ID and assigns it to the object**.

## Objects

* Objects are the **fundamental entities stored in Amazon S3**.<br>
* Objects **consist of object data and metadata**.<br>
* Objects can **range in size from a minimum of 0 bytes to a maximum of 5 terabytes**.<br>
* The **data portion is opaque to Amazon S3**.<br>
* The **metadata is a set of name-value pairs that describe the object**.
  * These **include some default metadata, such as the date last modified, and standard HTTP metadata**.

## Keys

* A key is the **unique identifier for an object within a bucket**.<br>
* **Every object in a bucket has exactly one key**.<br>
* The **combination of a bucket, key, and version ID uniquely identify each object**.

## Object Versioning

* &#x20;Use Amazon S3 Versioning to **keep multiple versions of an object in one bucket**.<br>

* **It is defined at the bucket level; not at the object level**.<br>

* For example, **you could store `my-image.jpg` (version 111111) and `my-image.jpg` (version 222222) in a single bucket**.<br>

* S3 Versioning **protects you from the consequences of unintended overwrites and deletions**.<br>

* You can also **use it to archive objects so that you have access to previous versions**.<br>

* You **must explicitly enable S3 Versioning on your bucket**.

  * **By default, S3 Versioning is disabled**.

* If S3 Versioning is enabled, Amazon **S3 assigns a version ID value for the object**.

## Uploading objects using multipart upload API <a href="#uploadobjusingmpu" id="uploadobjusingmpu"></a>

* Multipart upload **allows you to upload a single object as a set of parts**.<br>
* **Each part is a contiguous portion of the object's data**.
  * You **can upload these object parts independently and in any order**.<br>
* **If transmission of any part fails**, you **can retransmit that part without affecting other parts**.
