Amazon S3- Basic Features
Amazon S3- Basic Features
Amazon S3 is cloud based object storage, which is not associated to any server and can be accessed over internet. In Amazon S3 data is managed as objects by using API which is built on standard HTTP.
Each Amazon object contains data and metadata. Each object is identified by unique user specific key (file name) and resides in containers called buckets. Buckets are simply empty folders and each buckets cannot have sub bucket inside it. Each bucket can have unlimited number of objects. So we can say that Amazon S3 object is a file and key as its file name.
A buckets is simply considered as a folder and object is a file which is stored in it.Buckets names must is globally unique across Amazon accounts. Its name contains up to 63 lower case letters , numbers , hyphens, etc. by default you can have 100 objects per account and you can unlimited number of buckets.
Buckets can be created closer to customer area and in AWS region defined by AWS which minimize latency.
Objects are considered to be as file that are stored in AWS buckets. An object can store any kind of data range from 0 bytes to 5 TB. Each objects has two fields, data and metadata. Data is simply a user data in any format and metadata is associated with S3 objects which is a set of name/value pair. There are two types of metadata.
- System Metadata: It is created by Amazon itself and included filed like date last modified, object size, MD5 digest etc.
- User metadata: It is optional and can only be specified at time of creation of objects.
Each object which is stored is Amazon S3 is identified by unique identifier called keys. It can be considered like file name, and is up to 1024 bytes of Unicode UTF-8 characters. Keys must be unique in single buckets but can different buckets can have keys with same name. The combination of bucket, Keys and Optional version ID uniquely identifies Amazon S3 object.
Each Amazon object is addressed by unique URL which is formed using web services endpoints, bucket name and object key because these objects can be accessed over internet
Here Mybucket-1 is bucket name, dclessons.doc is key or file name (object)
Amazon S3 Operation:
Following are the Amazon S3 API common operation.
- Create / Delete a bucket
- Write an object
- Read an object
- Delete an object
- List keys in a bucket.
Rest is Representational state transfer API. Via Rest we can send HTTP. HTTPS request to create, delete, read, and write objects. Rest maps standard HTTP methods to AWS API, like create is HTTP PUT, read is HTTP GET, delete is HTTP DELETE, and update is HTTP POST.
Durability, Availability and Data Consistency:
Amazon S3 is designed in such a way that it provides both very high durability, and high availability with approx. 99.999% on any given year.
Amazon S3 object are also consistent, as data is automatically replicated across multiple servers and location with in region. Changes made to your data will take some time to propagate to all locations.
When a bucket and object is created only you will access over it, in order to provide access to another user, Amazon provides both coarse-gained access control (ACL) and Fine-grained access control (Amazon S3 bucket policies), AWS identity and access management policies and query-string authentication.
Amazon ACL allow you to grant coarse-gained access like READ, WRITE, or FULL CONTROL.
Static Website Hosting:
Amazon S3 storage is static website hosting because each object has URL. So in order to configure Amazon S3 bucket for static website hosting we have follow following steps:
- Create a bucket with same name as desired website hostname
- Upload the static file to a bucket
- Make all file public
- Enable static website hosting for bucket.
- Website will be available like : <bucket-name>.s3-website-<aws-region>.amazonaws.com.
- Create DNS name in your domain using CNAME.
- Now website is available to access.