# Cheat Sheet: Serverless and Edge on One Page — Serverless & Edge

Source: https://www.skillbyai.com/en/serverless-edge/se-cheat-sheet

> Recall the key terms, rules of thumb and trade-offs of the whole course in one quick revision pass.

## The whole course in eleven lines

- **Serverless**: the provider runs and scales servers; you pay mainly for use; capacity often scales to zero.
- **FaaS lifecycle**: Init (module code, once) -> Invoke (handler, per event) -> freeze and reuse. A cold start is a new Init.
- **Invocation models**: sync (caller retries), async (platform retries, then DLQ or destination), poll-based (queues and streams, in batches).
- **Delivery**: at-least-once, so make side effects idempotent with keys and conditional writes.
- **State**: in external stores. Globals and `/tmp` are caches only.
- **Edge**: V8 isolates in PoPs, Web-standard APIs, tiny cold starts, tight CPU limits.
- **Caching**: `s-maxage` for CDNs, `stale-while-revalidate` to hide refreshes, `private` for user data.
- **Edge data**: KV is eventually consistent; use a strongly consistent primitive for counters and inventory.
- **Concurrency** is about requests per second x duration; reserved concurrency guarantees and caps.
- **Cost**: requests + GB-seconds (or CPU time) + gateways, logs and data transfer.
- **Security**: one least-privilege role per function, managed secrets, validate every event.

## How to revise this course

Revise in three passes: recall the cheat sheet from memory, practise answering interview questions aloud, then take the self-check and revisit weak sections.

![Three connected stages from left to right: recall, practice, and self-check.](assets/figures/serverless-edge/section-11-map.svg) — Figure 11.1: recall the cheat sheet -> practise answers aloud -> self-check and revisit

## Draw it from memory

Close the course and draw the lifecycle (event, init, invoke, freeze) and the edge path (user, PoP cache, KV, origin) on paper. If you can label every box and explain one failure at each step, you are ready for most interview questions on this topic.

**Quiz:** Which pairing is correct?

- [ ] Edge KV: strongly consistent; Durable Objects: eventually consistent
- [ ] Top-level module code: runs on every invocation
- [ ] Asynchronous invocation: the caller waits for the function's result
- [x] Poll-based invocation: the platform reads a queue or stream and invokes the function with batches

*Answer:* Poll-based invocation: the platform reads a queue or stream and invokes the function with batches. Event source mappings poll queues and streams and deliver batches. The other three pairings are reversed or wrong.
