Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.34 KB

File metadata and controls

33 lines (24 loc) · 1.34 KB

Design Amazon Lambda (serverless functions)

A platform that runs user functions on demand, scaling automatically, without users managing servers.

Requirements

  • Run a user's function in response to an event or request.
  • Scale from zero to many instances automatically.
  • Isolate untrusted code safely.
  • Start fast and bill per use.

Key ideas

  • Execution: functions run in isolated sandboxes (containers or microVMs), one per concurrent invocation, with CPU, memory, and time limits.
  • Cold vs warm starts: spinning up a new sandbox is slow (cold start), so the platform keeps warm sandboxes pooled and reuses them.
  • Scheduling: a control plane places invocations onto worker hosts and scales the pool with demand.
  • Isolation is the core challenge, the same concern as a code judging system, but as a general-purpose platform.

High-level design

flowchart LR
    Event[Event / Request] --> CP[Control Plane]
    CP --> W1[Worker Host]
    W1 --> S1[Sandbox: function]
    CP --> W2[Worker Host]
    W2 --> S2[Sandbox: function]
Loading

Go deeper