Serverless compute on AWS: AWS Lambda

Serverless compute on AWS: AWS Lambda

March 26, 2021 / Eternal Team

AWS Lambda is a compute service that lets you run code without provisioning or managing servers.

With AWS Lambda, you can run code for virtually any type of application or backend service all with zero administration.

AWS Lambda manages all the administration and much more:

  • Provisioning and capacity of the compute fleet that offers a balance of memory, CPU, network and other resources
  • Server and OS Maintenance
  • High availability and automatic scaling
  • Monitoring fleet health
  • Applying Security patches
  • Deploying your code
  • Monitoring and logging your Lambda functions
  • AWS Lambda runs your code on a high availability compute infrastructure

AWS Lambda runs your code on a high availability compute infrastructure.

AWS Lambda executes your code only when needed and scales automatically, from a new request per day to thousands per second.

You pay only for the compute time you consume. No charge when your code is not running.

All you need to do is supply your code in the form of one or more lambda function to AWS lambda, in one of the languages that lambda supports (Node.js, JAVA, PowerShell, C#, Ruby, Python & Go) and the service can run the code on your behalf.

Typically, the life cycle of a lambda based application includes anything that is code, deploying code to AWS Lambda and then monitoring and troubleshooting.

This is in exchange for flexibility, which means you can not log the operating system or language runtime for fine-tuning.

If you do want to manage your own compute, you can use EC2 or Elastic Beanstalk.

How Lambda Works??

  • First, you need to upload your code to lambda in one or more lambda functions.
  • AWS Lambda will then execute the code on your behalf.
  • After the code is invoked, Lambda automatically takes care of provisioning and management of the required servers.
AWS Lambda AWS EC2
1. AWS Lambda is Platform-as-a-service 1. AWS EC2 is an Infrastructure-as-a-Service
2. It supports only limited languages like Node.js, Python, Java, C#, Ruby, GO and Powershell 2. No environmental restrictions, you can run only code or language
3. Write your code and push the code into AWS Lambda 3. For the first time in EC2, you have to choose the OS and install all the software required and then push your code in EC2
4. You can not log into computing instances, choose customized OS or language platform 4. You can select a variety of OS, instance types, network & security patches, ROM and CPU etc
5. Pay for the time as your code will run 5. Pay on a second or hourly basis

Important terms used in AWS Lambda

1. Function – A function is a resource that you can invoke to run your code in AWS Lambda.

2. Runtime – Lambda runtimes allow functions in different languages to run in the same base execution environment. Runtime is between Lambda and function code.

3. Event – Event is a JSON formatted document that contains data for a function to process.

4. Event Trigger – An AWS service such as Amazon SNS or a custom service that triggers your function and executes its logic.

5. Downstream Resource – An AWS service such as DynamoDB tables or S3 buckets, that your lambda function calls once it has triggered.

6. Concurrency – Number of requests that your function is serving at any given time.

Lambda Triggers

You can use AWS Lambda to run your code in response to

  • Events such as changes to data in an Amazon S3 bucket or an Amazon DynamoDB table.
  • To run your code in response to HTTP requests using Amazon API Gateway.
  • With these capabilities, you can use lambda to easily build data processing applications triggers for AWS services like Amazon S3 and Amazon DynamoDB,
  • Process streaming data stored in Amazon Kinesis or create your own backend that operates in AWS & scales for performance and security.

Talk to AWS Certified Consultant

    Want to start a project?

    It’s simple.

    Contact us