What does a microVM, a V8 isolate and a container instance each isolate a function from, and what does that mean for multi-tenancy?
answer
- kernel, heap, process
- what is still shared underneath
- stronger wall, fewer per host
- managed containers get an extra layer
basics
~20 sA 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.
solid answer
~50 sThe three models draw the tenant boundary at different layers. A **microVM**, such as one started by Firecracker, is a minimal virtual machine: each sandbox has its own guest kernel and memory, and escaping to the host needs a flaw in the small virtualization layer rather than in a full kernel's system-call interface. A **V8 isolate** separates heaps inside one runtime process that may host many tenants, so the runtime engine's correctness is the boundary, and platforms add process-level layers and fast patching underneath. A **container instance** separates processes with namespaces and resource limits but shares the host kernel, which is why managed container platforms commonly wrap each instance in a microVM or a user-space-kernel sandbox. For multi-tenancy the trade is boundary strength against start time and density, and on every model neighbours still share CPU caches, memory bandwidth and the network, so isolation of memory is never isolation of performance.
go deeper
Recall the one-line contrast: a microVM isolates a kernel, an isolate a heap inside a shared process, a container a process on a shared kernel.
Explain what each model still shares and why that drives start-up time, density and which kind of security bug matters for each one.
Show the production consequences: noisy-neighbour latency on every model, why managed container platforms add a VM layer, and why a warm sandbox never crosses tenants.
Frame the boundary as a cost decision: density and start-up time bought against escape risk, plus the patching duty that follows whichever boundary the organisation chooses.
## Three boundaries, three things shared Every function platform runs customer code inside a **sandbox**, and the sandbox's boundary decides what one function can see or disturb of another. Three models dominate. The cleanest way to compare them is to ask what each one isolates and what it still shares. | Model | What it isolates | What stays shared | Start-up and density | |---|---|---|---| | **microVM** (a minimal virtual machine, e.g. one started by Firecracker) | A whole guest: its own kernel, memory and virtual devices, behind hardware virtualization | The host's virtual machine monitor, physical CPUs, caches and network | Fast for a VM, but slower and heavier than an isolate; fewest per host | | **V8 isolate** | A heap and an execution context inside a language runtime engine | One operating-system process and one engine, often across many tenants | Fastest and densest; many isolates per process is the design goal | | **Container instance** | A process tree, via kernel **namespaces** and resource limits (**cgroups**) | The host kernel itself | Start dominated by pulling and starting an image; density in between | - A **microVM** is a strong default boundary. Code inside it sees a complete machine, so it runs native binaries, threads and a writable filesystem. To reach the host or another tenant, an attacker must break the virtualization layer (the virtual machine monitor and the host's hypervisor), which is kept deliberately small. - A **V8 isolate** separates memory, not processes. Two tenants' code can run in the same process, so the boundary is the correctness of the runtime engine. Platforms built on isolates add layers beneath it: system-call filtering on the process, partitioning tenants across processes, and patching the engine quickly when a flaw is published. - A **container** shares the host kernel, and the kernel's system-call interface is a large attack surface. That is why managed container-instance function platforms commonly run each instance inside a microVM or a user-space-kernel sandbox instead of trusting namespaces alone between tenants. ## What a tenant can still feel from its neighbours Isolating memory and code is not isolating performance. On every model, sandboxes on one host share hardware: - **CPU and cache contention.** A busy neighbour on the same cores evicts your cache lines and raises your tail latency. - **Memory bandwidth and I/O.** Disk and network interfaces are shared, rate-limited per sandbox at best. - **Side channels.** Speculative-execution attacks can infer data across boundaries through shared hardware. Isolate runtimes mitigate this partly by coarsening timers and by moving suspicious tenants into separate processes; microVM platforms commonly by keeping different tenants off sibling hardware threads of one core. - **Engine-level noise.** In an isolate runtime, neighbours share one engine and one process, so the platform enforces a per-request CPU-time cap to stop one tenant monopolising it. Per-sandbox resource limits (a CPU share, a memory cap) turn noisy neighbours into a bounded problem. They do not make it disappear. ## What the model means for multi-tenancy 1. **One tenant per sandbox, on every model.** Platforms reuse warm sandboxes between invocations, and a warm sandbox holds whatever the last invocation left in memory and on disk. Reuse is safe within one function and one tenant, never across tenants. 2. **Match the boundary to the code you accept.** Arbitrary native code needs a machine boundary (a microVM, or a container wrapped in one); scripts in one language, or WebAssembly, can live in isolates. 3. **Treat any single boundary as fallible.** Filter system calls, restrict network egress per tenant, and keep the riskiest tenants on separate hosts or processes. ## What the choice changes for an operator - **Cost shape.** Denser sandboxes cost less per idle tenant; a microVM per tenant pays for a guest kernel and its memory each time. - **What can run.** A microVM or a container runs nearly anything; an isolate runs only what its engine executes, with a narrow system interface. - **Which advisory matters.** A guest-kernel or virtual-machine-monitor bug matters on microVM platforms, a host-kernel bug on container platforms, a runtime-engine bug on isolate platforms. The patch you must apply fast follows the boundary you chose. - **Debugging.** A microVM or container usually lets you ship normal diagnostic tools in the package; an isolate gives you only the runtime's own logging and tracing.
- Why would a platform wrap a container instance in a microVM if containers already isolate processes?Because namespaces and resource limits isolate processes on a shared host kernel, and that kernel's system-call interface is a large attack surface. A kernel bug reachable from one tenant's container can reach every other tenant on the host. Wrapping each instance in a microVM, or a user-space-kernel sandbox, adds a second boundary so a single kernel flaw is no longer a cross-tenant escape.
- If isolates share one process, how does a platform stop one tenant's code from slowing the others?It enforces a per-request CPU-time cap and a per-isolate memory cap, terminating an isolate that exceeds them, and it can move a tenant that misbehaves into a separate process. These bound the damage one tenant can do to shared CPU and memory; they do not remove contention for caches and memory bandwidth.
Detached houses, flats and desks in one shared office. A house has its own walls and foundations, flats share the building's structure, and desks share the room with only a locked drawer each. Stronger separation means fewer tenants fit on the same plot of land.
- A V8 isolate gives each tenant its own operating-system process and kernel.
- Containers are as strong a tenant boundary as virtual machines because each has its own filesystem.
- Once memory is isolated, a neighbour cannot affect your function's latency.
- A warm sandbox is safe to reuse for any tenant because the handler clears its variables.
- A microVM boundary makes patching the host unnecessary.