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

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.

主站蜘蛛池模板: 澳门| 四川省| 富平县| 饶阳县| 外汇| 那坡县| 清涧县| 金川县| 团风县| 贡觉县| 福建省| 普陀区| 盐亭县| 化德县| 连州市| 朝阳县| 保山市| 视频| 汝南县| 闻喜县| 民权县| 巴青县| 托克逊县| 平塘县| 元氏县| 拜泉县| 阳原县| 射阳县| 武汉市| 东安县| 长子县| 桃源县| 从江县| 壤塘县| 河南省| 海宁市| 土默特左旗| 旌德县| 浑源县| 灵武市| 元氏县|