पाठ 30 / 32
Cheat Sheet: Serverless and Edge on One Page
यह पाठ अभी हिंदी में अनुवादित नहीं है, इसलिए अंग्रेज़ी में दिखाया जा रहा है।
Recall the key terms, rules of thumb and trade-offs of the whole course in one quick revision pass.
लेखक: Rahul Agarwal · 15 साल से वेब डेवलपर
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
/tmpare caches only. - Edge: V8 isolates in PoPs, Web-standard APIs, tiny cold starts, tight CPU limits.
- Caching:
s-maxagefor CDNs,stale-while-revalidateto hide refreshes,privatefor 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.
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.
त्वरित जाँच: 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
- 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.