<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: tetutetu214</title>
    <description>The latest articles on DEV Community by tetutetu214 (@tetutetu214).</description>
    <link>https://dev.to/tetutetu214</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3355092%2F2b0aa07c-e4c5-431a-b842-10788aa65d92.jpg</url>
      <title>DEV Community: tetutetu214</title>
      <link>https://dev.to/tetutetu214</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tetutetu214"/>
    <language>en</language>
    <item>
      <title>A Look into Lambda MicroVMs</title>
      <dc:creator>tetutetu214</dc:creator>
      <pubDate>Sat, 26 Sep 2026 02:26:22 +0000</pubDate>
      <link>https://dev.to/tetutetu214/a-look-into-lambda-microvms-2l3p</link>
      <guid>https://dev.to/tetutetu214/a-look-into-lambda-microvms-2l3p</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://blog.tetutetu214.com/en/posts/aws-lambda-microvms/" rel="noopener noreferrer"&gt;my blog&lt;/a&gt;, where the diagrams are interactive.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;On 2026-06-22, AWS Lambda gained a new unit of execution called MicroVMs (source: &lt;a href="https://aws.amazon.com/about-aws/whats-new/2026/06/aws-lambda-microvms/" rel="noopener noreferrer"&gt;AWS What's New&lt;/a&gt;, checked 2026-08-24).&lt;br&gt;
The name includes "Lambda", so this post looks into how it differs from the Lambda we have used so far.&lt;/p&gt;

&lt;p&gt;In this post, I organize how MicroVMs differ from regular Lambda, containers, and virtual machines.&lt;/p&gt;

&lt;h2&gt;
  
  
  The technology behind Lambda
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What Lambda needed
&lt;/h3&gt;

&lt;p&gt;Lambda is a service that runs code from many unrelated customers packed together on a single physical server. Functions often finish in a few hundred milliseconds, so the execution environment cannot take seconds to start. And because each server is shared with many other customers, those environments must be isolated from each other.&lt;/p&gt;

&lt;p&gt;(Source: &lt;a href="https://www.usenix.org/system/files/nsdi20-paper-agache.pdf" rel="noopener noreferrer"&gt;NSDI '20 paper&lt;/a&gt;, checked 2026-08-24)&lt;/p&gt;

&lt;h3&gt;
  
  
  About MicroVMs
&lt;/h3&gt;

&lt;p&gt;Meeting these requirements calls for a small virtual machine with only the minimum set of features: a MicroVM.&lt;/p&gt;

&lt;p&gt;Creating a virtual machine takes two pieces: KVM (Kernel-based Virtual Machine), the virtualization feature (hypervisor) built into the Linux kernel, and a virtual machine monitor (VMM) that drives KVM to assemble the virtual machine. At the time, the standard VMM was QEMU.&lt;/p&gt;

&lt;p&gt;However, QEMU is a VMM that builds a virtual machine emulating an entire real PC, so it could not produce the small virtual machines that were needed. AWS therefore built its own VMM, Firecracker, as open source, based on Google's open-source "crosvm". Firecracker creates only small virtual machines, and a virtual machine created by Firecracker is called a MicroVM. Lambda runs customer code inside these Firecracker MicroVMs.&lt;/p&gt;

&lt;p&gt;(Source: &lt;a href="https://www.usenix.org/system/files/nsdi20-paper-agache.pdf" rel="noopener noreferrer"&gt;NSDI '20 paper&lt;/a&gt;, checked 2026-08-24)&lt;/p&gt;

&lt;h4&gt;
  
  
  QEMU vs. Firecracker
&lt;/h4&gt;

&lt;p&gt;Comparing QEMU and Firecracker on three points (how many fit on one host, startup time, and available features) gives the following.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;📊 &lt;strong&gt;Interactive diagram:&lt;/strong&gt; this part has a diagram you can click through. &lt;a href="https://blog.tetutetu214.com/en/posts/aws-lambda-microvms/" rel="noopener noreferrer"&gt;See it on my blog →&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Isolation boundaries of virtual machines
&lt;/h4&gt;

&lt;p&gt;Besides virtual machines, containers are another way to isolate execution environments. Containers are light and fast, but everyone on the same server shares the host's single kernel. As a result, a single kernel vulnerability can affect other customers on the same host.&lt;/p&gt;

&lt;p&gt;A virtual machine, on the other hand, has its own guest kernel. A MicroVM is also a virtual machine, so the same applies. Even if the kernel has a vulnerability, it does not cross the boundary to other tenants on the same host.&lt;/p&gt;

&lt;p&gt;Here I compare where the boundary sits for virtual machines, containers, and MicroVMs.&lt;/p&gt;

&lt;p&gt;(Source: &lt;a href="https://firecracker-microvm.github.io/" rel="noopener noreferrer"&gt;Firecracker website&lt;/a&gt; and &lt;a href="https://www.usenix.org/system/files/nsdi20-paper-agache.pdf" rel="noopener noreferrer"&gt;NSDI '20 paper&lt;/a&gt;, checked 2026-08-24)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;📊 &lt;strong&gt;Interactive diagram:&lt;/strong&gt; this part has a diagram you can click through. &lt;a href="https://blog.tetutetu214.com/en/posts/aws-lambda-microvms/" rel="noopener noreferrer"&gt;See it on my blog →&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Lambda functions vs. MicroVMs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Side-by-side comparison
&lt;/h3&gt;

&lt;p&gt;As described above, Firecracker has long been one of the technologies behind Lambda, and regular Lambda code also runs in a MicroVM for each execution environment.&lt;/p&gt;

&lt;p&gt;To see how they differ, I compared Lambda functions and Lambda MicroVMs.&lt;/p&gt;

&lt;h4&gt;
  
  
  Lambda functions vs. Lambda MicroVMs
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Aspect&lt;/th&gt;
&lt;th&gt;Lambda functions&lt;/th&gt;
&lt;th&gt;Lambda MicroVMs&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Execution model&lt;/td&gt;
&lt;td&gt;Event-driven handler invocation&lt;/td&gt;
&lt;td&gt;Connect to a long-running app through a dedicated HTTPS endpoint&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State&lt;/td&gt;
&lt;td&gt;Stateless in principle&lt;/td&gt;
&lt;td&gt;Memory, disk, and processes kept for the session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lifecycle&lt;/td&gt;
&lt;td&gt;Managed by Lambda&lt;/td&gt;
&lt;td&gt;Developer runs run / suspend / resume / terminate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maximum duration&lt;/td&gt;
&lt;td&gt;15 minutes&lt;/td&gt;
&lt;td&gt;8 hours (total)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Billing unit&lt;/td&gt;
&lt;td&gt;GB-seconds + requests, per millisecond&lt;/td&gt;
&lt;td&gt;vCPU-seconds + GB-seconds per second + snapshots + data transfer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OS privileges&lt;/td&gt;
&lt;td&gt;Restricted (no pseudo-terminal, pty)&lt;/td&gt;
&lt;td&gt;Full OS capabilities&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;(Source: &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-microvms-guide.html" rel="noopener noreferrer"&gt;Lambda MicroVMs developer guide&lt;/a&gt;, checked 2026-08-24, as of general availability on 2026-06-22)&lt;/p&gt;

&lt;h4&gt;
  
  
  What the developer can manage
&lt;/h4&gt;

&lt;p&gt;In addition, here is a diagram comparing which layers the developer can touch (and where AWS takes over) across on-premises, EC2, regular Lambda functions, and MicroVMs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;📊 &lt;strong&gt;Interactive diagram:&lt;/strong&gt; this part has a diagram you can click through. &lt;a href="https://blog.tetutetu214.com/en/posts/aws-lambda-microvms/" rel="noopener noreferrer"&gt;See it on my blog →&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;(Source: same as above)&lt;/p&gt;

&lt;h3&gt;
  
  
  The four operations
&lt;/h3&gt;

&lt;p&gt;With MicroVMs, customers can directly perform four operations (run / suspend / resume / terminate) on a MicroVM, the virtual machine created by Firecracker.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;run&lt;/code&gt; and &lt;code&gt;terminate&lt;/code&gt; are called by the developer's application (backend) that embeds MicroVMs. &lt;code&gt;suspend&lt;/code&gt; and &lt;code&gt;resume&lt;/code&gt; are performed automatically by Lambda if you pass an idle policy at &lt;code&gt;run&lt;/code&gt; time (stop after N seconds without traffic, resume when traffic arrives). They can also be called explicitly through the API (source: &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/microvms-launching.html" rel="noopener noreferrer"&gt;Running and using MicroVMs, "Idle policy configuration"&lt;/a&gt;, checked 2026-09-05).&lt;/p&gt;

&lt;h4&gt;
  
  
  MicroVM state transitions
&lt;/h4&gt;

&lt;p&gt;This diagram shows how the four operations move a MicroVM between states.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;📊 &lt;strong&gt;Interactive diagram:&lt;/strong&gt; this part has a diagram you can click through. &lt;a href="https://blog.tetutetu214.com/en/posts/aws-lambda-microvms/" rel="noopener noreferrer"&gt;See it on my blog →&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  The four APIs
&lt;/h4&gt;

&lt;p&gt;Each operation works as follows.&lt;br&gt;
| Operation (CLI name) | Description |&lt;br&gt;
| --- | --- |&lt;br&gt;
| run (&lt;code&gt;run-microvm&lt;/code&gt;) | Starts a MicroVM from the image snapshot and assigns a unique ID and a dedicated HTTPS endpoint |&lt;br&gt;
| suspend (&lt;code&gt;suspend-microvm&lt;/code&gt;) | Pauses the MicroVM while keeping its memory and disk state. No compute charges while suspended. Also happens automatically when the idle time is exceeded |&lt;br&gt;
| resume (&lt;code&gt;resume-microvm&lt;/code&gt;) | Resumes a suspended MicroVM exactly as it was. Automatic resume on incoming traffic can also be configured |&lt;br&gt;
| terminate (&lt;code&gt;terminate-microvm&lt;/code&gt;) | Terminates the MicroVM and releases all resources. It cannot be resumed afterwards. Also happens automatically when the maximum duration is exceeded |&lt;/p&gt;

&lt;p&gt;(Source: &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/microvms-launching.html" rel="noopener noreferrer"&gt;Running and using MicroVMs&lt;/a&gt;, checked 2026-09-03)&lt;/p&gt;

&lt;h4&gt;
  
  
  What makes the four operations possible: snapshots
&lt;/h4&gt;

&lt;p&gt;The foundation of these four operations is the ability to save and restore the entire contents of a MicroVM (memory and disk). When the image is built, the state right after the app starts is saved as a Firecracker snapshot, so &lt;code&gt;run&lt;/code&gt; only has to restore it and does not reload dependencies. &lt;code&gt;suspend&lt;/code&gt; saves the memory and disk at that moment and stops, and &lt;code&gt;resume&lt;/code&gt; restores from there.&lt;/p&gt;

&lt;p&gt;There are limits on what can be kept. A single MicroVM can stay in RUNNING and SUSPENDED for at most 8 hours in total. Memory has a baseline of 0.5–8 GB (up to 4x that at peak, with a maximum of 32 GB / 16 vCPU), and disk is up to 32 GB (source: &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/microvms-how-it-works.html" rel="noopener noreferrer"&gt;Core concepts&lt;/a&gt;, &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/microvms-images.html" rel="noopener noreferrer"&gt;MicroVM images, "MicroVM sizing"&lt;/a&gt;, &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/microvms-launching.html" rel="noopener noreferrer"&gt;Running and using MicroVMs, "Key parameters"&lt;/a&gt;, checked 2026-09-04).&lt;/p&gt;

&lt;h3&gt;
  
  
  Hooks
&lt;/h3&gt;

&lt;p&gt;In addition to the four operations, hooks are also provided.&lt;/p&gt;

&lt;p&gt;Hooks are not something the customer calls. They let Lambda call the customer's app over HTTP at each of the start, suspend, resume, and terminate points, and at the ready / validate points during the build. If you configure them in your app, you can insert your own processing at those points.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hook&lt;/th&gt;
&lt;th&gt;When it is called&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;/ready&lt;/code&gt; (build time)&lt;/td&gt;
&lt;td&gt;After the app starts&lt;/td&gt;
&lt;td&gt;Signal that initialization is done and let the snapshot be taken&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;/validate&lt;/code&gt; (build time)&lt;/td&gt;
&lt;td&gt;When the MicroVM is launched for validation after the build&lt;/td&gt;
&lt;td&gt;Check that the app works correctly after resuming&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/run&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Right after start&lt;/td&gt;
&lt;td&gt;Per-tenant initialization, generating unique values&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/suspend&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Right before suspend&lt;/td&gt;
&lt;td&gt;Flushing writes, closing connections&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/resume&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Right before resume&lt;/td&gt;
&lt;td&gt;Re-establishing connections, refreshing credentials&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/terminate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Right before terminate&lt;/td&gt;
&lt;td&gt;Flushing data, cleanup&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;(Source: &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/microvms-launching.html" rel="noopener noreferrer"&gt;Running and using MicroVMs&lt;/a&gt; and &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/microvms-images.html" rel="noopener noreferrer"&gt;MicroVM images&lt;/a&gt;, checked 2026-09-03)&lt;/p&gt;

&lt;h3&gt;
  
  
  Concrete use cases
&lt;/h3&gt;

&lt;p&gt;Listed use cases include development platforms such as browser IDEs and notebooks, data analytics platforms, AI coding agents, security scanners, and CI/CD (source: &lt;a href="https://aws.amazon.com/blogs/compute/announcing-lambda-microvms-serverless-compute-environments-with-vm-level-isolation-and-near-instant-startup/" rel="noopener noreferrer"&gt;AWS Compute Blog&lt;/a&gt;, checked 2026-09-05).&lt;/p&gt;

&lt;p&gt;Here I take the AI coding agent example and follow the whole flow, from the user's request to cleanup.&lt;/p&gt;

&lt;h4&gt;
  
  
  The flow in an AI coding agent
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;📊 &lt;strong&gt;Interactive diagram:&lt;/strong&gt; this part has a diagram you can click through. &lt;a href="https://blog.tetutetu214.com/en/posts/aws-lambda-microvms/" rel="noopener noreferrer"&gt;See it on my blog →&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How it differs from other services
&lt;/h2&gt;

&lt;p&gt;Giving each user a dedicated execution environment was, of course, already possible with EC2, containers, and Lambda functions. However, each has its own strengths, so you need to decide which one to use for a given requirement.&lt;/p&gt;

&lt;p&gt;Here I prepared a diagram showing which requirements each approach can meet. Switching between approaches shows their strengths and weaknesses.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;📊 &lt;strong&gt;Interactive diagram:&lt;/strong&gt; this part has a diagram you can click through. &lt;a href="https://blog.tetutetu214.com/en/posts/aws-lambda-microvms/" rel="noopener noreferrer"&gt;See it on my blog →&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Restating those points gives the following.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Isolation&lt;/th&gt;
&lt;th&gt;Startup&lt;/th&gt;
&lt;th&gt;State retention&lt;/th&gt;
&lt;th&gt;Fewer constraints&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Virtual machines such as EC2&lt;/td&gt;
&lt;td&gt;Strong (hardware virtualization)&lt;/td&gt;
&lt;td&gt;Minutes (AMI boot and initialization)&lt;/td&gt;
&lt;td&gt;Can keep state&lt;/td&gt;
&lt;td&gt;High (choose duration, specs, and OS)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Containers&lt;/td&gt;
&lt;td&gt;Shares the host kernel&lt;/td&gt;
&lt;td&gt;Seconds&lt;/td&gt;
&lt;td&gt;Can keep state&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lambda functions&lt;/td&gt;
&lt;td&gt;Firecracker (but hidden)&lt;/td&gt;
&lt;td&gt;Cold starts&lt;/td&gt;
&lt;td&gt;15 minutes, stateless&lt;/td&gt;
&lt;td&gt;Low (15 minutes, event-driven)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MicroVMs&lt;/td&gt;
&lt;td&gt;Strong (Firecracker exposed)&lt;/td&gt;
&lt;td&gt;Restored from a snapshot&lt;/td&gt;
&lt;td&gt;Kept for up to 8 hours&lt;/td&gt;
&lt;td&gt;Low (8 hours, ARM64, memory limit)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;(Source: &lt;a href="https://aws.amazon.com/blogs/aws/run-isolated-sandboxes-with-full-lifecycle-control-aws-lambda-introduces-microvms/" rel="noopener noreferrer"&gt;AWS News Blog&lt;/a&gt;, &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-microvms-guide.html" rel="noopener noreferrer"&gt;Lambda MicroVMs developer guide&lt;/a&gt;, checked 2026-09-05)&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this post, I looked into how MicroVMs, newly added to AWS Lambda, differ from the Lambda we have used so far.&lt;/p&gt;

&lt;p&gt;I think the spread of AI is behind this release.&lt;br&gt;
MicroVMs can be used to build execution environments for code written by AI agents. For that use, the ideal is an environment isolated per user, one that can be paused between turns of the conversation, and one that keeps its previous state and continues when asked to run something. I feel MicroVMs are the best option for that.&lt;/p&gt;

&lt;p&gt;The MicroVMs created by Firecracker are a technology that has supported Lambda for a long time. What I personally found most significant is that developers can now handle the Lambda execution environment itself with their own hands through operations such as run and terminate, something that used to be AWS's responsibility.&lt;/p&gt;

&lt;p&gt;Rather than a new feature, MicroVMs, newly added to AWS Lambda, felt to me like a redrawing of the line of responsibility between AWS and developers.&lt;/p&gt;

</description>
      <category>lambda</category>
      <category>aws</category>
      <category>microvm</category>
      <category>firecracker</category>
    </item>
  </channel>
</rss>
