liveBook · Manning

Serverless computing

As explained in Microsoft Azure in Action

Serverless computing is a cloud execution model in which the provider manages server infrastructure while applications run code in response to events or requests.

Suppose an application needs to resize a photo whenever someone uploads one. Keeping a server ready for that brief task may be unnecessary. With serverless computing, the cloud provider manages the server and allocates resources as the service runs, leaving you to focus on the work the application must perform. The servers have not vanished; they are simply someone else’s responsibility. section 2.2.14 section 8.0

Serverless is a spectrum, not an all-or-nothing architecture. An application can combine serverless services with services that rely more directly on servers. Pick the arrangement that fits each job. section 8.0

In Azure, serverless work can take several forms:

  • Azure Functions run single-purpose units of code. Each Function lives in a Function App and starts from one trigger, such as an HTTP request, a new blob, or a queued message. section 2.2.14 section 8.6
  • Logic Apps connect services in workflows. A trigger starts the workflow, and actions work with its data. section 8.6
  • API Management can expose an API built from existing services and resources, including ones outside Azure. section 8.6

Give the photo one job

For an application that stores images from emails and processes uploaded photos, image resizing is a good single-purpose Azure Function. A Logic App can provide the surrounding workflow. The Function need not be responsible for the entire application. section 2.0 section 2.2.14

Hosting choice still matters. A Consumption plan charges for executions and includes a monthly free allowance; other hosting plans can offer predictable fixed monthly pricing. Serverless may save money, but the label alone is no guarantee—consider workload, performance, and cost together. section 8.3 section 8.0

Table 8.5 Comparing the main three differences between PaaS and serverless services

Concept

PaaS

Serverless

Scaling

You get more ways to decide how the service scales as compute requirements change, but you have to configure scaling yourself.

Scaling is done for you and “just works.” There are some options, such as having a Premium tier Function App.

Time to compute

Applications can take a while to spin up and get ready to provide the compute capacity.

Applications are only executed when invoked, but it happens very fast.

Control

You have much more control over the development environment, but that also means more configuration and maintenance.

You have very little control over the development environment, but it’s fast to get started.

Use the comparison to decide between serverless and platform as a service (PaaS): serverless handles scaling with less environment control, while PaaS offers more control and scaling configuration. section 8.5

Respond to an order

An Azure Function can respond to changes in Cosmos DB order data so an online store can update inventory and notify its shipping department. The illustrated Azure CLI commands create a Function App on a Consumption plan and configure deployment from a repository; they do not, by themselves, show the Cosmos DB trigger configuration. section 11.5.2

How Microsoft Azure in Action covers it

How deep it goes
Defines the model, compares hosting trade-offs, and sketches Azure workflows without detailing server infrastructure or a complete Cosmos DB trigger setup.
Examples
Uses photo resizing, workflow integration, and an Azure Function responding to Cosmos DB order changes as examples.
What it assumes
Introduces serverless from first principles; following the deployment example requires working with Azure CLI and Azure resources.
What you can do after
Apply it via Azure Functions and Logic Apps to assign focused tasks and workflows, while weighing Consumption-plan costs against other hosting options.
How it connects
Connects Azure Functions, Logic Apps, API Management, triggers, and platform as a service to serverless architecture.

Also explained in

Compare how 9 books explain serverless computing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microsoft Azure in Action. The section links point to the parts of the book it draws on.