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

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.

主站蜘蛛池模板: 赞皇县| 离岛区| 靖西县| 焉耆| 新河县| 昭通市| 彭州市| 沙洋县| 应城市| 浪卡子县| 和田市| 韶关市| 成安县| 木兰县| 沁水县| 马山县| 阿拉尔市| 延长县| 吴堡县| 禹城市| 织金县| 普兰店市| 岗巴县| 古蔺县| 屏山县| 老河口市| 肥城市| 洮南市| 江陵县| 三河市| 衡山县| 军事| 崇阳县| 宜城市| 普兰县| 大港区| 泰顺县| 呼图壁县| 昌都县| 肃北| 蕉岭县|