DEV Community

Cover image for AWS Simple Storage Services(s3). S3 buckets, mapping of S3 objects as network drive.
Ashutosh Mallick
Ashutosh Mallick

Posted on

AWS Simple Storage Services(s3). S3 buckets, mapping of S3 objects as network drive.

Amazon S3

  • Simple Storage Service is a scalable, high-speed, low-cost web-based service designed for online backup and archiving of data and application programs.

  • We can use S3 to store and retrieve any amount of data at any time, from anywhere on the web. It allows to upload, store, and download any type of files up to 5 GB in size.

  • This service allows the subscribers to access the same systems that Amazon uses to run its own web sites. The subscriber has control over the accessibility of data, i.e. privately/publicly
    accessible.

  • Since S3 is an object storage, it's not divided into multiparts or exists as a single storage.

  • When you modify a file in block storage, only the pieces that are changed are updated. When a file in object storage is modified, the entire object is updated.

  • In object storage, each object consists of data, metadata, and a key.

  • The data might be an image, video, text document, or any other type of file. Metadata contains information about what the data is, how it is used, the object size, and so on. An object’s key is its unique identifier.
    Metadata, key

Provisioning before S3

  • It's important to keep backup of your data. But before s3 for backup of data, we used to attach the servers to on premises SAN storage.

  • For SAN storage, due to its hardware lifetime, we need to regularly change the on premises services or hardware disk drives, which was a costlier process. Thus AWS introduced S3 services.

  • S3 buckets stores backup of your servers and it's very cheap. Such as for storing 1GB data costs you $0.01/month. But cost varies accordingly.

  • According to Aws SLA, for S3 bucket the data is 99.999999% available and durable. AWS makes three copies of data present in S3 bucket. One copy remains with the user while the other two copies are stored in other data centers. Hence you'll have high SLA.

S3 Buckets

  • A bucket is a container for objects stored in Amazon S3. You can store any number of objects in a bucket and can have up to 100 buckets in your account.

  • When you create a bucket, you enter a bucket name and choose the AWS Region where the bucket will reside. After you create a bucket, you cannot change the name of the bucket or its Region.

  • Bucket names must follow the bucket naming rules i.e, Bucket name should be unique and having small case letters only. You can also configure a bucket to use S3 Versioning or other storage management features.

  • Each object has three main components; the object’s content, the object’s unique identifier, and the object’s metadata (including its name, size, URL).

Image description

  • An Object cannot be independent, it must exist within a bucket. There can be hundreds of buckets in each Amazon account and within each bucket, there can be hundreds of objects. Image description

Bucket creation process:

  • Create a bucket, give a unique bucket name. If ACL is disabled, enable it. Untick "Block all public access".

  • Leave other things as default and create.
    Image description

Image description
Image description
Image description

  • Upload an Object in the bucket. Select a file from your local directory and upload it. Image description

Image description
Image description

Mapping of S3 bucket object using TNT drive

  • In the bucket, click on object actions dropdown and select make public using ACL. So that the object will be publicly accessible.

Image description

  • Now download TNT drive in order to mount S3 bucket in our local server. Now add account in TNT drive.

  • Go to IAM and create a user with S3 full access.

Image description

  • IAM user creation from AWS console.

Image description
Image description
Image description

  • Now in TNT click add a account. Create account with access key and secret key ID for your IAM user created.

Image description

  • Now select "add a new mapped drive" in TNT drive. Browse for the S3 bucket you created and select your bucket. Click on add a new drive. Image description

Image description

  • Go to my PC, find the mapped drive and see if the object is listed inside the bucket directory.( We can see that the object will be present inside the mapped drive).
    Image description

  • Now add a text file in the local folder for your bucket and save it. Now you can the same changes updated in AWS S3 console. That means in S3 bucket, you'll be having two objects.
    Hence, we can also mount S3 objects as network drives also.

Image description
Image description

In the upcoming blogs we'll see how to host a static website using S3, S3 versioning and different storage classes of S3.
Stay tuned. :)

Thank You!!!

Top comments (0)