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

Serverless and insects

As already mentioned, using the word serverless gives the impression that servers will not be needed. Serverless is a term used to describe an execution model.

When executing this model you, as the end user, do not need to worry about which server your code is executed on as all of the decisions on placement, server management, and capacity are abstracted away from you—it does not mean that you literally do not need any servers.

Now there are some public cloud offerings which abstract so much of the management of servers away from the end user that it is possible to write an application which does not rely on any user-deployed services and that the cloud provider will manage the compute resources needed to execute your code.

Typically these services, which we will look at in the next section, are billed for the resources used to execute your code in per second increments.

So how does that explanation fits in with the insect analogy?

Let's say I have a website that allows users to upload photos. As soon as the photos are uploaded they are cropped, creating several different sizes which will be used to display as thumbnails and mobile-optimized versions on the site.

In the pets and cattle world, this would be handled by a server which is powered on 24/7 waiting for users to upload images. Now this server probably is not just performing this one function; however, there is a risk that if several users all decide to upload a dozen photos each, then this will cause load issues on the server where this function is being executed.

We could take the chickens approach, which has several containers running across several hosts to distribute the load. However, these containers would more than likely be running 24/7 as well; they will be watching for uploads to process. This approach could allow us to horizontally scale the number of containers out to deal with an influx of requests.

Using the insects approach, we would not have any services running at all. Instead, the function should be triggered by the upload process. Once triggered, the function will run, save the processed images, and then terminate. As the developer, you should not have to care how the service was called or where the service was executed, so long as you have your processed images at the end of it.

主站蜘蛛池模板: 隆化县| 哈密市| 白银市| 阜阳市| 惠安县| 封开县| 梨树县| 卫辉市| 金湖县| 沭阳县| 固安县| 长武县| 科技| 马龙县| 绥宁县| 绥化市| 峨山| 百色市| 海盐县| 临潭县| 宁阳县| 久治县| 闻喜县| 鹤岗市| 灵山县| 阳原县| 苗栗县| 湘潭市| 玛曲县| 岳普湖县| 辽阳县| 浏阳市| 全州县| 玛纳斯县| 全椒县| 沙洋县| 青神县| 柳林县| 龙门县| 泰顺县| 冀州市|