How do you get benefited by using AWS S3 for your business application ?

Ranadheer raju D
10 min readApr 22, 2020

--

Have you ever heard about AWS S3(Simple Storage Service) ?. If YES, do you know how S3 will be beneficial for your application ?. If NO, then this is the perfect time for you to learn or know about S3 and to know how S3 will be beneficial for your application.

Before going to know about S3, first let us discuss an example or use case, where you would use S3.

Suppose if there is an application, which is running in other server and it is using some xyz database. So you need to pay for both the server and database even if the application is not running for some particular period of time.

Now the challenge is in future, if your application traffic is going to be increased more. Then is your server capable of handling those traffic ?, okay if there is no problem with the server, then what about the database. The traffic is increasing more means that the user data is also storing more in database, so do you think that this database is capable of storing huge amount of data. Even if it is capable of storing, then what about responding to user i.e. the latency between the server and the application, if the database is filled with huge amount of data then it is highly difficult to respond to user quickly. So this is where the primary issue will occur and the secondary issue is about backup.

If in worst scenario, the database will crash then we don’t have any option to get previous data and one more issue is privacy to our database. We don’t have any guarantee that anonymous user can’t access to our database, so like that there are so many issues that may rise when the data is increasing in future. For all those issues, the only best solution I can say is using S3, we can achieve all those issues at any point of time.

We understood the challenge, now let us discuss deeply about S3 to understand how we can solve this challenge in an efficient way.

What is S3 ?

Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. This means customers of all sizes and industries can use it to store and protect any amount of data for a range of use cases, such as websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics.

Amazon S3 provides easy-to-use management features so you can organize your data and configure finely-tuned access controls to meet your specific business, organizational, and compliance requirements. Amazon S3 is designed for 99.999999999% (11 9’s) of durability, and stores data for millions of applications for companies all around the world.

In simple words, I can say that S3 is a storage service where everything in S3 is treated as objects. With S3 we can store any huge amount of data and we can retrieve any amount of data at any point of time.

NOTE: Please note that S3 buckets are not global. You create an S3 bucket in a particular region only and data stored in a bucket is only stored in that region itself. However, the name given to an S3 bucket should be unique globally. This means there should be no other bucket of the same name across AWS.

When we are discussing about S3, there are some key concepts that we should have to discuss.

AWS S3 key concepts

  1. Buckets
  2. Objects
  3. Keys
  4. Regions

A Bucket is a container for objects stored in Amazon S3. Every object is contained in a bucket. For example, if the object named photos/puppy.jpg is stored in the awsexamplebucket1 bucket in the US West (Oregon) Region, then it is addressable using the URL https://awsexamplebucket1.s3.us-west-2.amazonaws.com/photos/puppy.jpg

Objects are the fundamental entities stored in Amazon S3. Objects consist of object data and metadata. The data portion is opaque to Amazon S3. 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, such as content-type. You can also specify custom metadata at the time the object is stored.

An object is uniquely identified within a bucket by a key (name) and a version ID.

A key is the unique identifier for an object within a bucket. Every object in a bucket has exactly one key. The combination of a bucket, key, and version ID uniquely identify each object. So you can think of Amazon S3 as a basic data map between “bucket + key + version” and the object itself. Every object in Amazon S3 can be uniquely addressed through the combination of the web service endpoint, bucket name, key, and optionally, a version. For example, in the URL https://doc.s3.amazonaws.com/2006-03–01/Amazons3.wed1, Doc is the name of the bucket and 2006–03–01/Amazons3.wed1 is the key.

Regions: You can choose the geographical AWS Region where Amazon S3 will store the buckets that you create. You might choose a Region to optimize latency, minimize costs, or address regulatory requirements. Objects stored in a Region never leave the Region unless you explicitly transfer them to another Region. For example, objects stored in the Europe (Ireland) Region never leave it.

AWS S3 scaling

Amazon S3 automatically scales to high request rates. For example, your application can achieve at least 3,500 PUT/COPY/POST/DELETE or 5,500 GET/HEAD requests per second per prefix in a bucket. … These applications then aggregate throughput across multiple instances to get multiple terabits per second.

AWS S3 architecture

Image source: AWS docs

AWS S3 features

  1. Storage classes
  2. Bucket policies
  3. AWS identity and access management
  4. Access control lists
  5. Versioning
  6. Operations

To know more about S3 features, click here.

What we can do with S3 ?

  • Create a bucket — Create and name your own bucket in which you have to store your objects.
  • Write an object — Store data by creating or overwriting an object. When you write an object, you specify a unique key in the namespace of your bucket. This is also a good time to specify any access control you want on the object.
  • Read an object — Read data back. You can download the data via HTTP or BitTorrent.
  • Delete an object — Delete some of your data.
  • List keys — List the keys contained in one of your buckets. You can filter the key list based on a prefix.

What are S3 access points ?

S3 Access Points are unique hostnames that you can create to enforce distinct permissions and network controls for any request made through the access point. S3 Access Points policies allow enforcing permissions by prefixes and object tags, allowing limits on the object data that can be accessed.

How S3 access points works ?

Image source: AWS docs

Migrating On-premise data to AWS S3

If you are not using S3 till now and if you want to use S3 then without losing any data, you can safely migrate to S3.

Enterprises are often faced with challenges in migrating vast amounts of data efficiently and effectively from their on-premises data storage environments to AWS. To aid and ease this migration, AWS offers offline data transfer services such as AWS Snowball, AWS Snowball Edge, and AWS Snowmobile. At re:Invent 2018, AWS launched a new service to expedite data transfer over the network, called AWS DataSync.

To know more about migrating On-premise data to AWS S3: click here

Now, we got some what better understanding about S3. Let’s discuss all the questions or issues which will be raised when we are using other storage service and also let us understand how S3 will solve all those issues or questions.

What if the data is going to be increasing more in future ?

If we are using other storage service and if the data is increasing more then we should have to expand the storage services manually using some operations but that will cost us more. Where as when you use S3, you don’t need to think about it because AWS will automatically scales the S3 whenever required. Also the scaling cost will not be much more.

When failure occur, then how do you handle it ?

While using other storage services, if there is any failure will occur then we should have to stop the server and we should have to setup another storage service and after setting up another storage service then we should have to restart the server, so this process will take so much time. But with S3, it is less admin overhead because if S3 fails or anything happens to S3 then AWS will alert us immediately and it will allow us to create another S3 service within a less amount of time, let us say in minutes. So that we don’t need to down the application for a longer period of time when compared with other storage service crash.

What about the data backup ?

While the application is in running state and if suddenly storage service will crash, then do you think that you will get the previous data. If you create any backup then you will get, but you won’t get all the data accurately. But with S3, there is no any loss of data at anytime or from anywhere because of replication which is provided by AWS.

What about the privacy ?

With other storage services we can’t guarantee the privacy to our data because of so much security issues. But S3 is highly secured and the data within S3 is in highly encrypted format, so when compared with other storage services privacy, S3 will be having more privacy.

What about the storage cost ?

Any organization or user will first consider about billing cost . When you use other storage services the cost will be more, also in future if you want to expand the storage services then the expanding cost will be high and if your application is down for a some days even though you should have to pay for the services. When you use S3 the cost will be less because in AWS for most of the services we will pay only for the usage services. For example if your app is down for some days, then you need not pay for those days also it is less admin overhead, which means most of the part will be managed by AWS only.

Till now we have covered about S3 and also we have discussed how S3 will be differentiated from other storage services by answering some questions. So by combining all those concepts and theory, within 6 points I will tell you why you should use S3 .

Why should you use AWS S3 ?

  1. Backup and restore
  2. Disaster recovery
  3. Archive
  4. Data lakes and big data analytics
  5. Hybrid cloud storage
  6. Cloud native application data

Benefits of AWS S3

  1. Industry-leading performance, scalability, availability and durability
  2. Wide range of cost-effective storage classes
  3. Unmatched security, compliance and audit capabilities
  4. Easily manage data and access controls
  5. Query-in-place services for analytics
  6. Most supported cloud storage service

Steps to create AWS S3 bucket

  1. Go to Amazon console and type S3 and click on S3
  2. Steps to create a bucket

a. In the S3 dashboard, click Create Bucket.

If this is the first time you have created a bucket, you will see a screen that looks like the image pictured here.

If you have already created S3 buckets, your S3 dashboard will list all the buckets you have created.

b. Enter a bucket name. Bucket names must be unique across all existing bucket names in Amazon S3. There are a number of other restrictions on S3 bucket names as well. Then select a region to create your bucket in.

Select Next.

c. You have many useful options for your S3 bucket including Versioning, Server Access Logging, Tags, Object-level Logging and Default Encryption. We won’t enable them for this tutorial. Select Next.

d. You have the ability to set permission settings for your S3 bucket. Leave the default values and select Next.

e. Review your configuration settings and select Create bucket.

3. Steps to upload a file

In this step, you will upload a file to your new Amazon S3 bucket.

a. You will see your new bucket in the S3 console. Click on your bucket’s name to navigate to the bucket.

b. You are in your bucket’s home page. Select Upload.

c. To select a file to upload, either click Add files and select a sample file that you would like to store OR Drag and Drop a file on the upload box. Select Next after you have selected a file to upload.

d. You have the ability to set permission settings on your object. For this tutorial, leave the default values and select Next.

e. You have the ability to set property settings like storage class, encryption, and metadata with your object. Leave the default values and select Next.

f. Review your configurations and select Upload. You will see your object in your bucket’s home screen.

To know more information about S3, click here.

“I have covered everything about S3 with an example. Hope now you all have a brief knowledge about S3 and their uses also you might have understood how any organization will be benefited by using S3. If you are more excited to know about S3 or if you want to use S3 for your application, feel free to contact us at any time or if you have any questions do comment here. We are always ready to here you”

To know more about upcoming AWS articles, follow me and if you like the article please do claps.

Thank you!!!

--

--

Ranadheer raju D

Software Development Engineer | AWS Solution Architect | Piazza Tech Consulting Group