Logo
Free New Skills
DevOps|AWS

Core Concepts of Serverless

Serverless computing allows you to build and run applications and services without thinking about servers.

Key Concepts

  1. Functions as a Service (FaaS): Code is executed in stateless containers that are event-triggered, ephemeral, and fully managed by the cloud provider.
  2. Event-Driven: Functions are triggered by events such as HTTP requests, database modifications, or file uploads.
  3. Pay-per-use: You only pay for the compute time you consume - no charge when your code isn't running.

AWS Lambda Handler

The handler is the method in your function code that processes events. When your function is invoked, Lambda runs the handler method.

def lambda_handler(event, context):
    # Your code here
    return {
        'statusCode': 200,
        'body': 'Hello from Lambda!'
    }

Execution Environment

Lambda runs your code in a secure, isolated execution environment. The environment includes:

  • Runtime (Python, Node.js, Java, etc.)
  • Memory allocation (128 MB to 10 GB)
  • Timeout (up to 15 minutes)
  • Temporary storage (/tmp directory, up to 10 GB)