Amazon Simple Storage Service (S3) is a service where you can save any type of file such as images, log files, and backups. Starting here with a bit of nomenclature, Amazon calls each file as an object and, to store files, you need a root folder that is called as a bucket. In your account, you can have multiple buckets to better organize your data. You can also have folders inside a bucket, but can't have buckets within buckets.
An interesting feature is that each file receives a unique URL in the following format:
https://s3.amazonaws.com/bucketname/filename
With this format, the bucket name must be unique through all accounts to guarantee unique URLs. It means that you can't create a bucket with a common name like “my-photos” because it will already be taken. Be creative and count on luck when choosing a name.
You can restrict the file access if it's a backup or another kind of private data, but what we will explore here is to let the files be publicly available to store our frontend data. This is a powerful feature. For example, you can use it to stream videos. You just need to add a <video> HTML5 tag that references the URL of an mp4 file. For a nice looking player, you could use something like http://videojs.com, which is open source.
We will take advantage of S3 as it is a very cheap storage service and it has the flexibility to share files to build our low cost and serverless frontend. In our bucket, we'll add all static files of our frontend, including HTML, CSS, JavaScript, images, and so on. With proper configuration, which will be detailed in Chapter 4, Hosting the Website, it will be ready to serve our content with high availability, scalability, and low costs.