Skip to content
All Articles

MicroVMs and V8 Isolates: Two Ways to Run Untrusted Code

Learn how Firecracker microVMs and V8 isolates balance isolation, startup work, density, and runtime capabilities.

6 min read
  • Runtime Isolation
  • Firecracker
  • V8
On this page
  1. The isolation-versus-startup problem
  2. Why traditional VMs start slowly
  3. How Firecracker reduces VM overhead
  4. How V8 isolates provide another model
  5. Capabilities and limitations
  6. Choosing the correct execution model
  7. Key takeaways
  8. What comes next
  9. Further reading

A serverless platform runs code from many customers on shared hardware. That creates a difficult constraint.

Each workload must be separated from the others, but its execution environment must also be cheap enough to create on demand.

Strong boundaries often require more machinery. Fast startup often requires less. Modern platforms use several designs to balance the two.

This article compares two important designs: Firecracker microVMs and V8 isolates.

The isolation-versus-startup problem

Imagine two customers running functions on the same physical server.

One function must not read the other's memory, inspect its secrets, consume all shared resources, or access the host operating system.

The platform therefore needs an isolation boundary around every workload. It also needs controls for CPU, memory, networking, and storage.

A traditional virtual machine provides a strong boundary. Each guest runs its own kernel behind a hypervisor.

That general-purpose design carries work a short-lived function may not need. The guest kernel, virtual devices, services, and language runtime must all become ready before the handler can run.

A process or language sandbox can be lighter. It shares more host machinery, so the platform must enforce isolation through the runtime and surrounding system.

Neither approach wins every time. The useful question is: which boundary provides the required capabilities at an acceptable cost?

Why traditional VMs start slowly

A normal VM behaves like a complete computer.

Its virtual hardware may include devices that make sense for a general operating system but add no value to a small HTTP handler.

Starting it can involve loading a kernel, discovering devices, mounting filesystems, starting system services, and then launching the application runtime.

Not every VM performs every step, and snapshots can avoid part of the work. The general problem remains: more machine surface means more state to prepare and secure.

Serverless platforms need a narrower machine—one designed for headless, short-lived workloads rather than an interactive computer.

How Firecracker reduces VM overhead

Firecracker (opens in a new tab) is an open-source virtual machine monitor built for multi-tenant function and container services.

It runs in user space and uses Linux KVM for hardware-assisted virtualization. The lightweight guests it manages are called microVMs.

The key idea is subtraction.

Firecracker exposes a minimal device model instead of emulating a broad collection of PC hardware. It also supports a streamlined kernel-loading path and resource rate limiting.

The guest still has its own kernel. That preserves a VM-style boundary while removing machinery that a server workload does not need.

Firecracker publishes performance targets for its own microVM configuration. Those figures describe the technology, not a universal cold-start promise for every platform or application.

Your observed latency also includes runtime startup, dependency loading, application initialization, scheduling, and provider-specific work.

A microVM can host different language runtimes and native programs because its boundary surrounds an operating-system guest, not one programming language.

That flexibility is valuable when code expects Node.js APIs, Python packages, native binaries, filesystem access, or ordinary network sockets.

How V8 isolates provide another model

V8 (opens in a new tab) is the JavaScript and WebAssembly engine used by Chrome and other runtimes.

An isolate is an isolated instance of the V8 engine. It owns engine state such as its managed heap and garbage collector.

V8 also has contexts. A context gives unrelated JavaScript applications separate global objects inside an isolate.

The terms are easy to blur. An isolate is the larger engine boundary; contexts are execution environments created within it.

An isolate does not boot a guest operating system. A host process embeds V8, creates execution state, and exposes selected capabilities to user code.

That lets a platform reuse one already-running runtime process while keeping workloads in separate engine-managed environments.

Cloudflare Workers is one implementation of this model. Its documentation says Workers isolates have isolated memory and share the overhead of a runtime process.

The platform supplies web APIs, bindings, scheduling, limits, and security controls around V8. The isolate alone is not the complete sandbox or serverless product.

This distinction matters because V8 is not a general operating system. It executes JavaScript and WebAssembly; the embedder decides which host APIs are available.

For example, Workers favors web-standard APIs and supports a documented subset of Node.js APIs. It also offers platform APIs such as TCP sockets.

So “isolate runtime” does not mean “browser APIs only,” and it does not guarantee the same capabilities across providers.

The architecture of a KVM microVM compared with a V8 isolate.

Capabilities and limitations

MicroVMs and isolates place the boundary at different layers.

QuestionFirecracker microVMV8 isolate-based runtime
What is separated?A lightweight guest machineAn instance of the JavaScript engine
Guest kernelYesNo
Language modelChosen inside the guestJavaScript and WebAssembly through V8
Host APIsOS and runtime dependentExplicitly supplied by the embedder
Startup workGuest, runtime, and app preparationEngine state, bindings, and app preparation
Best fitBroad runtime compatibilityHigh-density JavaScript workloads

This table compares architectural tendencies, not universal service guarantees.

A provider can keep microVMs warm, restore snapshots, pool runtimes, preload code, or add caching. An isolate platform can add Node.js compatibility, networking, and persistent services.

Security also depends on the complete implementation.

A VM boundary is not automatically invulnerable. An isolate is not secure merely because V8 created it. Providers still need patching, quotas, syscall controls, process isolation, and abuse detection.

The architecture tells you where the main boundary sits. It does not replace a security review.

Choosing the correct execution model

As an application developer, you rarely choose Firecracker or create V8 isolates directly. You choose a platform and runtime whose constraints match the workload.

Choose a full serverless runtime when the workload needs broad Node.js compatibility, native dependencies, long computations, or ordinary operating-system facilities.

Choose an isolate-based runtime when the code fits its API surface and must start or scale with very little per-workload machinery.

Do not decide from the word “edge.” It describes placement near users, not one isolation technology or capability set.

Read the provider's current runtime documentation. Check supported APIs, execution limits, networking, package compatibility, regional placement, and data access.

Then measure the deployed workload. Architecture explains the likely trade-offs; production traces reveal the ones that matter to users.

A decision flow for choosing between full serverless and isolate-based runtimes.

Key takeaways

  • Multi-tenant platforms need both workload isolation and efficient startup.
  • Firecracker removes general-purpose VM machinery while retaining a guest kernel and KVM boundary.
  • A V8 isolate is an engine instance, not a small virtual machine.
  • Isolate platforms expose capabilities through the host runtime around V8.
  • Runtime features vary by provider and can change over time.
  • “Edge” describes location; it does not imply V8 or a fixed API set.
  • Choose from workload requirements, then verify with measurements.

What comes next

Fast startup cannot remove the delay created by a distant user and origin.

The next article follows a request through a content delivery network and explains how nearby caches reduce both latency and origin work.

Further reading