liveBook · Manning

Serverless computing

As explained in Quarkus in Action

A serverless platform is a cloud execution platform that automatically provisions, starts, scales, and stops application instances in response to requests.

Serverless computing runs smaller application deployments that scale independently with demand. The platform automatically starts instances for incoming requests, stops them as traffic falls, and can scale an application to zero when unused. section 11.5.1

Scale to zero reduces payment for idle capacity but introduces cold starts: the first request must wait for a new instance to start. Applications therefore need fast startup. Quarkus supports this model through a low memory footprint, ahead-of-time compilation, and optional GraalVM native-image builds that produce smaller, faster-starting executables. section 11.5.1

Function as a Service platforms include Knative, AWS Lambda, Google Cloud Functions, and Azure Functions. Their Java APIs differ and can lock applications to one provider. Quarkus addresses this with Funqy, a unified API that abstracts the provider integrations. section 11.5.2

A minimal Funqy function

A method annotated with @Funq becomes the function invoked for a user request. Funqy also supports POJO inputs and outputs, reactive Mutiny types, and dependency injection. It exposes HTTP similarly to a REST service but does not replace complete REST functionality. section 11.5.2

Listing 11.18 The example use of the Funqy API
import io.quarkus.funqy.Funq;

public class Function {
    @Funq
    public String process(String input) {
        return "Processed: " + input;
    }
}

Shows the minimal Funqy shape: import the annotation, mark a method with @Funq, accept an input, and return the processed result. section 11.5.2

How Quarkus in Action covers it

How deep it goes
Explains scaling, scale-to-zero, cold starts, native images, and Funqy basics, while deferring deeper Quarkus serverless integrations.
Examples
Uses Quarkus Funqy functions, including an annotated method that returns processed input.
What it assumes
Assumes basic Quarkus familiarity and introduces serverless architecture, FaaS, cold starts, and Funqy fundamentals.
What you can do after
Build it from scratch with Quarkus and Funqy, then target different FaaS providers through one function API.
How it connects
Connects serverless computing with microservices, Function as a Service, REST, Quarkus, and GraalVM native images.

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 Quarkus in Action. The section links point to the parts of the book it draws on.