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

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.

主站蜘蛛池模板: 余庆县| 察哈| 平山县| 商城县| 黄梅县| 西丰县| 华蓥市| 博白县| 临漳县| 民丰县| 垦利县| 琼结县| 仙居县| 盐亭县| 贺兰县| 临清市| 柘城县| 高雄县| 正阳县| 潮安县| 麻栗坡县| 莱州市| 宁阳县| 阳西县| 皋兰县| 乃东县| 井研县| 元谋县| 龙里县| 泾源县| 南华县| 清流县| 嘉禾县| 永兴县| 包头市| 宿州市| 乌拉特前旗| 长垣县| 巴中市| 茌平县| 玛多县|