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

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.

主站蜘蛛池模板: 锡林浩特市| 九龙县| 元谋县| 巩留县| 绥江县| 巍山| 洪雅县| 仙游县| 江永县| 明溪县| 昌吉市| 龙山县| 深泽县| 衡阳市| 湘西| 宁南县| 东源县| 石门县| 河源市| 玛多县| 丹阳市| 陕西省| 宿松县| 红河县| 靖宇县| 香格里拉县| 温州市| 临汾市| 成都市| 曲松县| 东乌珠穆沁旗| 彭山县| 靖安县| 泉州市| 漳平市| 宜昌市| 章丘市| 兴隆县| 新平| 彭山县| 黑龙江省|