top of page
  • Writer's pictureArup Roy

Initialize AWS S3 from LWC ( Lightning Web Component)

Amazon Simple Storage Service, widely known as Amazon S3, is a highly scalable, fast, and durable solution for object-level storage of any data type. Unlike the operating systems we are all used to, Amazon S3 does not store files in a file system, instead it stores files as objects. Object Storage allows users to upload files, videos, and documents like you were to upload files, videos, and documents to popular cloud storage products like Dropbox and Google Drive. This makes Amazon S3 very flexible and platform agnostic.

S3 is a storage that can be maintained and accessed over the Internet. Amazon S3 provides the web service which can be used to store and retrieve unlimited amount of data. The same can be done programmatically using Amazon-provided APIs.


☁️ What Is an Amazon S3 Bucket ?


S3 in Amazon has two primary entities called buckets and objects. Objects are stored inside buckets. Also, it does have a flat hierarchy, not like the one you would find in a file system. But in an organization, a file system is needed in an ordered fashion, and that’s why AWS S3 introduced a file system which seems like a traditional one.

Basically, it works like, if you upload images and you want to differentiate it from other files, you can create a file for it and store it so that the logical address of the file would have the prefix ‘pictures.’ For example, pictures/sample.jpg.

By default, the maximum number of buckets that can be created per account is 100. For additional buckets, one can submit a request for a service limit increase.

Each Bucket has an associated access control policy. Public access is granted to buckets & objects through access control list (ACLs) bucket policies, or both.


☁️ Objects:


Objects are the fundamental entities stored in Amazon S3. Objects consist of object data and metadata.

Note: Objects belongs to a bucket that we created in a specific AWS Region, never leave the Region, unless we explicitly transfer them to another Region.

☁️ How Amazon S3 works ?


Amazon S3 works as an object storage service. This is different from your typical file storage or even block storage. When a user uploads data to S3, that file is stored as an object with metadata intact and the object as a whole is given an ID.

There are two different kinds of metadata. System-Defined and User-Defined Metadata. System metadata is used for S3 to maintain important things such as creation date, size, and last-modified.

Objects also take in user-defined metadata. User-defined metadata allows users to assign key-value pairs to the data they upload. These key-value pairs help users identify, organize, and assign objects to specific resources, or allow for easy retrieval.


☁️ Advantages of using Amazon S3


✔️ Scalability on Demand

o If you want your application’s scalability varying according to the change in traffic, then AWS S3 is a very good option.

o Scaling up or down is just mouse-clicks away when you use other attractive features of AWS.


✔️ Content Storage and Distribution

o S3 in Amazon could be used as the foundation for a Content Delivery Network. Because Amazon S3 is developed for content storage and distribution.


✔️ Big Data and Analytics on Amazon S3

o Amazon QuickSight UI can be connected with Amazon S3, and then large amounts of data can be analyzed with it.


✔️ Backup and Archive

o Whether you need timely backups of your website, or store static files for once, or store versions of files you are currently working on. S3 in Amazon has got you covered.


✔️ Disaster Recovery

o Storing data in multiple availability zones in a region gives the user the flexibility to recover files, which are lost, as soon as possible. Also, the cross-region replication technology can be used to store in any number of Amazon’s worldwide data centers.


☁️ Amazon S3 Features :


While durability and reliability are great features, AWS S3 has other features which set it apart from other data storage services. Data can be transferred to S3 via the AWS S3 API over the public internet which makes uploading and automating backups of data easier for developers.


✨ Users are also able to take advantage of other S3 features such as:


1. The ability to write, read, and delete objects from 1 byte to 5 terabytes

2. Unlimited number of objects

3. Authentication mechanisms provided to allow authentication and deny unauthorized access from outside users

4. REST and SOAP API interfaces

5. Simplicity in managing data by segregating data by buckets, monitoring access, and controlling data life-cycles


☁️ Amazon S3 Storage Classes :


Amazon S3 offers customers and users a wide range of storage classes which allows users the flexibility in configuring their storage. The different storage classes include:


💦 Amazon S3 Standard


This is your standard storage for “hot” or live data access. Availability is at 99.99% and usually the go-to storage class for most users.


💦 Amazon S3 Standard-Infrequent Access (S3 Standard-IA)


This storage class is for infrequent access to data. It offers lower storage costs but higher storage restoration costs. This class is recommended for data that can be at rest for 30 days without needing to be accessed, such as archives, but if needed, can be accessed relatively quickly.


💦 Amazon S3 One Zone-infrequent Access (S3 One Zone-IA)


Very similar to Amazon S3 Standard-IA, but costs 20% less due to only being available in one zone as opposed to three.


💦 Amazon S3 Intelligent-Tiering (S3 Intelligent-Tier)


A relatively new storage class introduced in late 2018, data in S3 Intelligent-Tiering is monitored by AWS and automatically converted from S3 to S3-IA if there’s been 30 days of inactivity on the objects. If said object is then accessed, it is moved back to frequent access for cheaper access.


💦 Amazon S3 Glacier (S3 Glacier)


S3 Glacier is great for archiving data for long storage which doesn’t necessarily need instant access or retrieval. S3 Glacier offers storage at a much lower cost than S3 Standard and even S3 Standard-IA but fines users for retrieving data before the 90-day minimum and anything over 10 GB per month.


💦 Amazon S3 Glacier Deep Archive (S3 Glacier Deep Archive)


Amazon has added to their S3 Glacier service and introduced Amazon Glacier Deep Archive. At 1GB/month starting at $0.00099, it will be the cheapest solution to storing data on Amazon AWS. This storage class is specifically meant for data that you absolutely would never need instantly, as the fastest restore time takes 12 hours.


☁️ Amazon S3 Application Programming Interfaces (API)


Customers and end users have the option to interact with Amazon AWS S3 via API. Both REST and SOAP interfaces are provided, making S3 flexible and language neutral. This is great for developers who need to store and retrieve data via a programmable interface. S3 API provides users and customers with the capability to store, retrieve, list, delete, and move objects in Amazon S3.

Since its introduction, Amazon's S3 API has been adopted as the standard for object based storage interfaces. Many vendors and third-party software companies offer support and developer guides for Amazon S3, which continue to make it the leading object storage service.


⚡ Initialize AWS S3 from LWC



1,316 views0 comments

Comments


bottom of page