官术网_书友最值得收藏!

Amazon S3

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.

主站蜘蛛池模板: 黔东| 平舆县| 鄄城县| 宝坻区| 遵义县| 连南| 柘荣县| 兴化市| 六盘水市| 平潭县| 南溪县| 西青区| 南召县| 丰原市| 南陵县| 焦作市| 兰坪| 盘山县| 嘉兴市| 安徽省| 九龙城区| 南平市| 广汉市| 彭山县| 腾冲县| 临洮县| 博客| 滦平县| 台安县| 朝阳县| 杭锦后旗| 定远县| 寿阳县| 大厂| 察雅县| 凤城市| 酉阳| 中西区| 沈阳市| 伽师县| 梁平县|