Summary
Highlights
This section introduces AWS Lambda as a serverless computing service, emphasizing its importance in modern cloud architecture. It explains that Lambda allows users to run code without needing to provision or manage servers, contrasting it with traditional methods like using EC2 instances. The main advantage highlighted is the cost-effectiveness, as users only pay for the time their code is actively running.
AWS Lambda manages various aspects, including provisioning and capacity of compute resources (memory, CPU, network), server maintenance, operating system updates, high availability, automatic scaling, and security patching. Users are freed from these administrative tasks, allowing them to focus solely on their code.
Lambda executes code only when needed, triggered by specific events. It automatically scales to handle incoming requests. The billing model is pay-per-use, charged in milliseconds (rounded up to the nearest 100ms) only for the actual computation time. The maximum execution time for a Lambda function is 15 minutes. Users provide their code in supported languages, and AWS handles the rest.
Currently, AWS Lambda supports seven programming languages: Node.js, Java, PowerShell, C#, Ruby, Python, and Go. The speaker notes that more languages may be added in the future. This emphasizes that users must write their code in one of these supported languages.
The Lambda application lifecycle involves writing code, deploying it, and then AWS monitoring and troubleshooting. A key point is that with Lambda, users cannot log in to the compute instance, customize the operating system, or select specific instance types. If such customization is needed, EC2 instances or Elastic Beanstalk are more appropriate choices.
The process begins with uploading code as one or more Lambda functions. AWS then executes this code on your behalf as needed. After execution, Lambda automatically handles the provisioning and management of the necessary server resources, making it seamless for the user.
This section provides a detailed comparison between AWS Lambda and EC2 instances. Lambda is classified as Platform as a Service (PaaS), while EC2 is Infrastructure as a Service (IaaS). Lambda supports a limited set of languages and offers no OS or instance customization, whereas EC2 provides full control over the environment and supports any language. The billing for Lambda is purely based on code execution time (milliseconds), contrasting with EC2's hourly or per-second billing, which applies even when the server is idle.
Important terms include 'Function,' which refers to the code users write and run; 'Runtime,' which represents the programming language environment for the function; 'Event,' a data payload processed by the function; 'Trigger' (also called 'Event Source'), a service that invokes the Lambda function (e.g., S3, SNS, DynamoDB); 'Downstream Resource,' a service that the Lambda function interacts with after being triggered (e.g., DynamoDB to store data); and 'Concurrency,' the number of simultaneous requests a function can handle, with a default limit of 1000 concurrent executions.