skip to content

Serverless & FaaS

How functions run and are operated across cloud providers and edge runtimes: sandboxes, cold starts, scaling limits, event delivery, workflows, deployment and the bill.

on this pageshow

questions

page 1 of 2

On a function platform, what is the difference between a published version and an alias, and why do triggers call the alias?

level: juniorimportance: must knowfreq 70%

answer

  1. frozen snapshot vs movable name
  2. code plus configuration, never edited
  3. release by repointing
  4. rollback without a rebuild

basics

~20 s

A published version is an immutable snapshot of a function's code and configuration; an alias is a named pointer to one version. Triggers and callers invoke the alias, so releasing or rolling back is just repointing it.

solid answer

~50 s

Publishing a version freezes the function's code package together with its configuration (memory, timeout, deploy-time environment variables) under an identifier that never changes. An alias such as `live` is a mutable, named pointer to one of those versions and holds no code of its own. API routes, schedules and event triggers are wired to the alias, never to a bare version number or to an editable working copy. A release then becomes a pointer change: publish the new version, move the alias. Rollback is the same move in reverse and takes effect for new invocations almost at once, because the old version is still published and needs no rebuild. Immutability also lets you say exactly which code served a request, and many platforms report metrics per version so the two can be compared during a release.

go deeper

for a junior

Be able to say that a version is a frozen snapshot and an alias is a movable name, and that rolling back means moving the name back.

for a middle

Explain what a version freezes beyond code, such as memory, timeout and environment variables, and why triggers must reference the alias rather than an editable working copy.

for a senior

Show that you have audited what really routes through the alias: triggers pinned to versions, internal callers using the bare name, and whether old versions survive long enough to roll back to.

for a principal

Speak to the release contract a platform team sets: every production trigger through an alias, a retention policy for old versions, and the executed version in every log line.

## Why a function release needs its own primitive On a function platform there is no host to log into, no process to restart and no directory to copy files into. The platform owns the machines: you hand it a code package and configuration, and it starts sandboxes on demand. So a release cannot be "stop the server, swap the files, start it again". Most function platforms instead give an operator two objects that together make releases and rollbacks safe: the **published version** and the **alias**. ## Versions: immutable snapshots Publishing a **version** takes the function as it is now and freezes it under an identifier that never changes, usually an increasing number. What is frozen is more than the code: - the **code package**, as an archive or a container image digest - **runtime configuration** such as memory size, timeout and the runtime itself - **environment variables** set at deploy time - on many platforms, the handler entry point and any attached layers or extensions Because a version cannot be edited, `version 42` means the same thing today and in six months. That is what makes it a safe rollback target, and what lets you say exactly which code served a given request. Platforms that keep an editable working copy beside the published versions treat that copy as a draft: anything wired to it changes the moment someone deploys. ## Aliases: named pointers An **alias** is a stable name, such as `live` or `staging`, that points at one published version. It contains no code. Callers, API routes, schedules and event triggers reference the alias, so none of them needs to know a version number. Many platforms also let an alias point at two versions with weights, which is how a gradual traffic shift works. Some platforms express the same idea as traffic tags on immutable revisions rather than as a separate alias object; the operating model is the same. ## A release and a rollback, step by step 1. Build the code package and deploy it from a template that also declares the function's permissions, triggers and alias. 2. Publish a new version. It now exists but takes no traffic. 3. Move the alias to the new version, all at once or through a weighted shift. 4. Watch the new version's errors and latency. 5. To roll back, move the alias back to the previous version. Step 5 needs no build, no artifact download and no new version. The previous version is still published, so new invocations reach it almost immediately. The first requests may pay for fresh sandboxes, but nothing has to be rebuilt or re-uploaded while the incident is running. ## What must point at the alias The alias controls only the traffic that goes through it. The common leaks are: - **a trigger wired to the editable working copy**: every deploy reaches it at once, with no rollback target and no weighted shift - **a trigger pinned to a fixed version number**: it never receives a release until someone edits the trigger - **another function calling by bare name**: depending on the platform, that may resolve to the working copy rather than the alias - **a client that hard-codes a version**: every release then needs a client change ## Version, alias and working copy compared | | Published version | Alias | Editable working copy | |---|---|---|---| | Changes after creation | Never | Can be repointed | On every deploy | | Holds code | Yes | No, it points at a version | Yes | | Safe target for production triggers | Only when pinning is intended | Yes | No | | Role in a rollback | The target you return to | The thing you move | None | ## Habits that follow from the model - Keep enough old versions to roll back to, and prune old ones on a schedule rather than by hand in the middle of an incident. - Write the executed version into every structured log line, so any request can be tied to the exact code that served it. - Treat a configuration change as a release. On platforms with immutable versions, a changed environment variable means a new version and an alias move, which is why values that rotate on their own schedule, such as credentials, are usually read from a secret store at runtime instead. - Name aliases for their role (`live`, `staging`), not for a release, so that callers never need to change when a release ships.

  • Why is it risky to point a production trigger at a function's editable working copy instead of an alias?
    Every deploy reaches that trigger the moment it lands, with no review step and no weighted shift. There is no previous published version behind it to move back to, so a rollback means rebuilding and redeploying under pressure. Per-version metrics also stop meaning much, because the code behind the trigger changes without a new identifier.
  • If a published version's environment variable needs a new value, can you edit it in place?
    Not on a platform with immutable versions: the configuration is part of the version. You publish a new version carrying the changed value and move the alias to it, which is a release like any other. That cost is why values that rotate on their own schedule are usually read from a secret store at runtime instead of frozen into the version.

A published version is a printed edition of a book, and the alias is the "current edition" label on the library shelf. Readers follow the label; to withdraw a faulty edition, the librarian moves the label back to the previous edition, which is still printed and on the shelf.

  • Rolling back means rebuilding and redeploying the previous commit.
  • An alias is a copy of the code under another name.
  • Pointing production triggers at the latest deployed code is fine if tests pass.
  • Every caller should switch to the newest version number at each release.
  • Editing an environment variable on a published version updates it in place.
open as a page

On a function platform, what happens to work a handler leaves running after it has returned its HTTP response?

level: juniorimportance: must knowfreq 60%

basics

~20 s

Work left running after the response is not guaranteed to finish. A microVM-based platform freezes the sandbox once the handler returns, so un-awaited calls pause until a later invocation thaws it, or vanish if the sandbox is reclaimed first.

open as a page

When a function platform throttles requests, why do the function's own logs stay clean, and where does the throttling show up instead?

level: juniorimportance: must knowfreq 62%

basics

~20 s

A throttled request is rejected before the handler runs, so the function's logs and error count never see it. Throttling shows up in the platform's throttle metric, as too-many-requests errors at callers, and as rising backlog age for queued events.

open as a page

Why does an asynchronously invoked function need a failure destination when the function platform already retries failed events?

level: juniorimportance: must knowfreq 65%

basics

~20 s

Asynchronous retries are bounded: when they run out or the event ages past its limit, the platform discards it, and the caller left long ago. A failure destination keeps the event and its error for alarming, inspection and replay.

open as a page

In a hosted workflow engine, how does a step wait days for a human approval without a function running, and what ends the wait?

level: juniorimportance: must knowfreq 50%

basics

~20 s

The step issues a callback token, the engine saves the execution and runs nothing, and the reviewer's system resumes it by calling the engine with that token. A timeout on the wait ends executions whose token never returns.

open as a page

How do you compute a function's cold-start ratio, and why slice it by deploy and scale-out wave instead of by day?

level: middleimportance: must knowfreq 55%

basics

~20 s

Divide cold invocations by all invocations in a window, per function or route. Cold starts arrive in waves after deploys and traffic ramps, so a daily ratio dilutes the burst; slice by version against time since deploy, and by scale event.

open as a page

How would you roll out a new version of a payments webhook function with a weighted alias shift and automatic rollback?

level: middleimportance: must knowfreq 65%

basics

~20 s

Publish the new version, weight the alias to send it a small share of invocations, and watch its own alarms through a bake period. An alarm makes the deploy tool repoint the alias back; a quiet bake promotes the new version.

open as a page

What does a microVM, a V8 isolate and a container instance each isolate a function from, and what does that mean for multi-tenancy?

level: middleimportance: must knowfreq 50%

basics

~20 s

A microVM gives each sandbox its own guest kernel behind hardware virtualization; an isolate separates heaps inside one shared runtime process; a container separates processes that share the host kernel. Stronger boundaries cost start time and density.

open as a page

Why can a function-backed API's gateway, log ingestion and NAT gateway charges each exceed the function's own compute charge?

level: middleimportance: must knowfreq 62%

basics

~20 s

The function's compute meter is only one line. The gateway charges per request, logging per gigabyte ingested and stored, and a NAT gateway per hour and per gigabyte processed, so short, cheap invocations can leave those lines larger than compute.

open as a page

How do a function platform's asynchronous retry count and maximum event age interact, and how would you set them for an unreliable downstream?

level: middleimportance: must knowfreq 58%

basics

~20 s

Retry count caps attempts; maximum event age caps time since acceptance, including time queued while throttled. Whichever runs out first ends the retries. Set the count from the handler's side effects and the age from how long the event stays useful.

open as a page

When a hosted workflow engine fans one step out over thousands of items, what do you configure to protect downstream services and the fan-in?

level: middleimportance: must knowfreq 50%

basics

~20 s

Cap the fan-out's parallelism at what downstream services and the function concurrency quota can absorb, pass storage references instead of payloads, give each item a retry policy with idempotent steps, and batch very large fans so the fan-in stays bounded.

open as a page

In a function's logs and traces, how can an operator tell which individual invocations were cold starts?

level: juniorimportance: should knowfreq 48%

basics

~20 s

Use the init or startup duration most function platforms record when an invocation starts a new instance, and log your own cold flag: a variable set during init and cleared after that instance's first invocation.

open as a page

What deployable unit do AWS Lambda, Azure Functions, Cloud Run and Cloudflare Workers each expect, and what does that unit decide for you?

level: juniorimportance: should knowfreq 48%

basics

~20 s

AWS Lambda takes a zip archive (optionally with layers) or a container image; Azure Functions a function-app package; Cloud Run any container image serving HTTP; Cloudflare Workers a script bundle or WebAssembly module. The unit decides which dependencies you can ship.

open as a page

Once you know what makes a function's init slow, which changes shrink it, and when does lazy loading only move the cost?

level: middleimportance: should knowfreq 44%

basics

~20 s

Trim init by removing unused dependencies, importing narrowly, bundling and moving reflection to build time; lazy-load only what most requests skip, because a deferred dependency is paid by the first request on each instance that needs it.

open as a page

Why does putting a function's database password in a deploy-time environment variable make rotation harder than fetching it from a secret store at runtime?

level: middleimportance: should knowfreq 55%

basics

~20 s

A deploy-time environment variable is part of the deployed configuration, so changing it means a new version or a restart. A secret read from a store at runtime and cached briefly changes when the store does, with no redeploy.

open as a page

Which workloads cannot run on an isolate-based edge runtime, and how do you check a function fits one before porting it?

level: middleimportance: should knowfreq 35%

basics

~20 s

An isolate-based edge runtime cannot run native binaries, spawn processes, use a general writable disk, open arbitrary raw sockets or do long CPU-bound work. Check by auditing dependencies, building for the target and measuring CPU time per request.

open as a page

Which function platform would you pick for an image-resizing API, and which for a geography-based redirect, and why?

level: middleimportance: should knowfreq 45%

basics

~20 s

An edge isolate runtime such as Cloudflare Workers suits the geography redirect, which needs only request metadata. Image resizing suits a regional platform such as Cloud Run or AWS Lambda, near the stored images and able to run native libraries.

open as a page

How do AWS Lambda, Cloud Run and Cloudflare Workers differ in limit and billing shape for a function that mostly waits on network calls?

level: middleimportance: should knowfreq 38%

basics

~20 s

AWS Lambda bills and limits wall-clock duration per invocation, so waiting is paid per request; Cloud Run bills instance time that concurrent requests share; Cloudflare Workers bills and limits CPU time, so waiting on the network costs almost nothing.

open as a page

On a function platform that sends many requests to one instance, what changes when you raise the per-instance concurrency setting?

level: middleimportance: should knowfreq 42%

basics

~20 s

Each instance holds more requests at once, so the fleet needs fewer instances, starts fewer cold and often costs less per request, until shared memory runs short or CPU contention stretches tail latency. Pick the value by load-testing one instance.

open as a page

How do you attribute a function workload's bill to individual functions and individual requests when the gateway, logs and NAT are shared?

level: middleimportance: should knowfreq 38%

basics

~20 s

Function compute usually splits per function in billing data; shared lines need allocation keys: gateway by requests, logs by bytes, NAT by bytes sent. Per-request cost comes from each invocation's billed duration and memory where the platform bills per invocation.

open as a page

How do you choose a batch size and batching window for a queue-triggered function, trading message latency against invocation count?

level: middleimportance: should knowfreq 52%

basics

~20 s

A batch is sent when full, when the batching window ends, or at the payload cap. Bigger batches and longer windows cut invocations but add latency on quiet queues and enlarge the unit that fails together.

open as a page

How does a definition-based workflow state machine differ from code-first durable execution, and why must durable workflow code be deterministic?

level: middleimportance: should knowfreq 40%

basics

~20 s

A definition-based engine interprets a declared state machine and saves state at each transition. Code-first durable execution runs ordinary workflow code and rebuilds its state by replaying recorded step results, so that code must make identical decisions on every replay.

open as a page

A checkout API's function shows tail latency jumping for ten minutes after every deploy, with long init durations; how do you find which dependency makes init slow?

level: seniorimportance: should knowfreq 46%

basics

~20 s

Confirm the slow requests are the cold ones, time each init step (imports, framework bootstrap, clients, config and secret fetches) as child spans, profile a fresh process offline, and look for init-time network calls a deploy makes all at once.

open as a page

After a team sets a minimum instance count on a latency-critical function, how do you prove it reduced the cold starts users actually wait on?

level: seniorimportance: should knowfreq 40%

basics

~20 s

Measure the request-path cold ratio (cold flag set and a near-zero gap since init) and the route's tail in matching before and after windows that each include a deploy and a peak, then check spillover above the minimum and warm-pool utilisation.

open as a page

A payments webhook function enqueues work for a second function, but traces stop at the queue; how do you carry trace context across that asynchronous hop?

level: seniorimportance: should knowfreq 40%

basics

~20 s

Trace context crosses HTTP calls in headers, but a queued message only carries what the producer puts in it. Inject the context into message attributes on send, extract it per message in the consumer, and use per-message spans or links for batches.

open as a page

A payments webhook function's 10% canary passed its rollback alarm, yet errors jumped after full promotion; what went wrong, and how would you fix the release checks?

level: seniorimportance: should knowfreq 45%

basics

~20 s

The rollback alarm most likely watched the function's combined error rate, which a small canary share dilutes, or the bake saw too few invocations or none of the failing event type. Alarm on the new version's own metrics and cover every event type.

open as a page

A function's traces and metrics are missing for a fraction of invocations, though its logs show every request succeeded; how do you diagnose and fix it?

level: seniorimportance: should knowfreq 45%

basics

~20 s

Telemetry libraries buffer data and export it on a background timer, which stops when the sandbox is frozen after the response, so buffered spans arrive late or are lost. Flush before returning, or export through a local extension or log lines.

open as a page

After quiet periods, a function's first call to a downstream service fails with a connection-reset error and succeeds on retry; how does the sandbox lifecycle cause this?

level: seniorimportance: should knowfreq 35%

basics

~20 s

A pooled connection kept from an earlier invocation sits idle while the sandbox is frozen. The server, load balancer or NAT closes it at its idle timeout, the frozen client never notices, and the first write after the thaw fails.

open as a page

What does porting a working function from AWS Lambda to Cloud Run or Cloudflare Workers cost beyond rewriting its handler?

level: seniorimportance: should knowfreq 32%

basics

~20 s

Rewriting the handler is the cheap part. The cost is re-wiring triggers and retry semantics, permissions, configuration and secrets, packaging, telemetry and templates, then re-testing under a new concurrency model and limits; Cloudflare Workers adds native-dependency and data-locality work.

open as a page

How do you size a per-function concurrency cap that keeps a function from flooding a rate-limited downstream API, and what does the cap fail to guarantee?

level: seniorimportance: should knowfreq 48%

basics

~20 s

Set the cap near the downstream's sustainable rate times the function's average duration. A cap bounds requests in flight, not per second, so a faster function can still breach the rate limit, and the excess lands on callers or a backlog.

open as a page

showing 1–30 of 41