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

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.

主站蜘蛛池模板: 敦煌市| 建宁县| 上高县| 林口县| 泸西县| 尼玛县| 明星| 涿州市| 松阳县| 丰城市| 三明市| 南陵县| 深泽县| 尼勒克县| 儋州市| 万安县| 泗阳县| 新闻| 八宿县| 临清市| 城口县| 成武县| 巨鹿县| 防城港市| 舟山市| 玛多县| 蒙阴县| 新平| 丰顺县| 晋州市| 定远县| 墨脱县| 繁昌县| 英德市| 汽车| 汉阴县| 建德市| 横峰县| 广元市| 长白| 河西区|