AWS Lambda
Lambda functions are event-driven code snippets that run in secure, isolated execution environments. Each function exists within a runtime environment that provides the necessary resources (CPU, memory, and network) based on your configuration.
When an event triggers a function, the service automatically provisions and manages the compute resources needed to execute your code. The execution environment is temporary, meaning it can be created, used, and destroyed as needed, supporting the serverless nature of the service. Lambda handles concurrent executions by creating multiple instances of your function, each running in its own isolated environment. These environments do not maintain any data between executions, though you can use external services for persistent storage.
Lambda technical concepts
Function
A function is the fundamental unit containing your code, configuration, and any dependencies required for execution. Functions are triggered by events and run in isolated environments.
Execution environment
The execution environment is the secure, isolated runtime context where your function runs. It includes the necessary compute resources (CPU, memory, network) and the runtime for your chosen programming language.
Cold start
Cold start is the initialization process when Lambda creates a new execution environment for your function. This includes loading your code, starting the runtime, and executing initialization code.
Warm start
Warm start is when Lambda reuses an existing execution environment from a previous invocation, resulting in faster function startup times.
Concurrency
Concurrency is the number of function instances that can run simultaneously. Lambda automatically manages concurrency scaling based on incoming requests.
Runtime
Runtime is the language-specific environment that runs your code. Lambda supports multiple programming languages through different runtimes (for example Node.js, Python, Java).
Event source mapping
Event source mapping is the configuration that connects event sources to your function, defining how events trigger function executions.
Function configuration
The function configuration refers to the settings that define how your function operates, including memory allocation, timeout settings, and environment variables.