Files
system-design-101/data/guides/what-makes-aws-lambda-so-fast.md
Kamran Ahmed ee4b7305a2 Adds ByteByteGo guides and links (#106)
This PR adds all the guides from [Visual
Guides](https://bytebytego.com/guides/) section on bytebytego to the
repository with proper links.

- [x] Markdown files for guides and categories are placed inside
`data/guides` and `data/categories`
- [x] Guide links in readme are auto-generated using
`scripts/readme.ts`. Everytime you run the script `npm run
update-readme`, it reads the categories and guides from the above
mentioned folders, generate production links for guides and categories
and populate the table of content in the readme. This ensures that any
future guides and categories will automatically get added to the readme.
- [x] Sorting inside the readme matches the actual category and guides
sorting on production
2025-03-31 22:16:44 -07:00

49 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "What makes AWS Lambda so fast?"
description: "Explore the key factors behind AWS Lambda's impressive speed."
image: "https://assets.bytebytego.com/diagrams/0417-what-makes-aws-lambda-so-fast.png"
createdAt: "2024-02-06"
draft: false
categories:
- cloud-distributed-systems
tags:
- "AWS Lambda"
- "Serverless"
---
![](https://assets.bytebytego.com/diagrams/0417-what-makes-aws-lambda-so-fast.png)
There are 4 main pillars:
## Function Invocation
AWS Lambda supports synchronous and asynchronous invocation.
In synchronous invocation, the caller directly calls the Lambda function using AWS CLI, SDK, or other services.
In asynchronous invocation, the caller doesnt wait for the functions response. The request is authorized and an event is placed in an internal SQS queue. Pollers read messages from the queue and send them for processing.
## Assignment Service
The Assignment Service manages the execution environments.
The service is written in Rust for high performance and is divided into multiple partitions with a leader-follower approach for high availability.
The state of execution environments is written to an external journal log.
## Firecracker MicroVM
Firecracker is a lightweight virtual machine manager designed for running serverless workloads such as AWS Lambda and AWS Fargate.
It uses Linuxs Kernel-based virtual machine to create and manage secure, fast-booting microVMs.
## Component Storage
AWS Lambda also has to manage the state consisting of input data and function code.
To make it efficient, it uses multiple techniques:
* Chunking to store the container images more efficiently.
* Using convergent encryption to secure the shared data. This involves appending additional data to the chunk to compute a more robust hash.
* SnapStart feature to reduce cold start latency by pre-initializing the execution environment