[AWS Beginners] Learn AWS Lambda in 5 minutes!

Hello!
I'm Inoue, the Persian cat at Beyond Shikoku office.

Today, we will explain Lambda, one of the most popular AWS services

What is Lambda?

Lambda is a service that enables serverless computing.
AWS provides an environment where programs can be executed without servers.
Serverless doesn't mean "no servers," as the name suggests.
In fact, servers exist, but AWS handles the construction and maintenance of those servers,
freeing users from the burden of server construction and maintenance, and eliminating the need for any server management.
Normally, to develop and run a program,
you need to prepare a server and keep that server or instance running to execute the program.
However, with Lambda, the above environment is already prepared.
Therefore, users can focus on program development without worrying about server management.

Furthermore, since usage fees are incurred only when a program is executed, you can use Lambda with minimal costs.
This is an advantage over resident servers.
Lambda uses a millisecond-by-millisecond billing system,
meaning you are charged for every millisecond that a function is executed.
You can use it for free until the execution time of your function reaches 400,000 per second per month.
However, the amount of free time varies depending on the memory allocated to your Lambda function.
You are also charged for the number of requests, but you can use it for free up to 1 million requests per month.
You are not charged for creating Lambdas or for waiting time when Lambdas are not running.
AWS Lambda pricing
is based on usage, depending on the number of requests and the execution time of the function ,
大規模なシステムでは、よりコストメリットが大きくなるということです。

Furthermore, because Lambda operates across multiple Availability Zones within a region,
it can provide highly available and fault-tolerant operational performance.
ensures excellent service delivery without regular downtime or server interruptions.
This means high availability and fault tolerance are maintained without the user even being aware of it.

Lambda is a mechanism for automating real-time processing of data and requests, as well as backend processing.
With Lambda, pre-configured processes are automatically executed when certain events occur.
You can easily run Lambda by simply selecting the runtime of the program you want to execute and uploading the source code.
Lambda supports common languages, so you don't need to learn any special languages.
Therefore, you don't need to learn a new language to use Lambda; you can start using Lambda immediately with a language you're already familiar with.
Language support is increasing year by year and is expected to continue to grow.
Currently, the languages ​​supported by Lambda include the following:

  • C#
  • PowerShell
  • Go
  • Java
  • Node.js
  • Python
  • Ruby

If you want to use a language other than those listed above, you can use the custom runtime feature.
Lambda functions are stored in the Lambda service. They are executed
on specific AWS resources when a certain trigger occurs.
For example, uploading an image to an S3 bucket triggers Lambda to resize the image and convert it into an image suitable for a website, etc.
A thumbnail creation function is called, and thumbnails can be automatically created.

■Service that invokes Lambda

The service from which Lambda reads events Kinesis, DynamoDB, SQS
A service that invokes Lambda functions synchronously ELB, ALB, Cognito, Lex, Alexa, API Gateway, CloudFront, Kinesis Data Firehose
A service that invokes Lambda functions asynchronously S3, SNS, SES, CloudFormation, CloudWatch Logs, CloudWatch Events, CodeCommit, Config

By using Lambda effectively, you can create stable web applications at low cost

Integration with AWS services

For example, Lambda can be triggered by the following events:

  1. At a specific time (CloudWatch Events)
  2. When data is uploaded to S3
  3. When a new item is written to DynamoDB
  4. When an Auto Scaling action is executed
  5. When a button is pressed on a web page
  6. When the API is called
  7. When you say, "Alexa, tell me about ____"

In this way, Lambda makes it easy to automate AWS processes

No need to manage servers

As mentioned earlier, Lambda is serverless, meaning no server management is required.
Therefore, you are freed from server operation and can focus on developing program code.
The following server management tasks become unnecessary:

  • Operating System Updates
  • Applying security patches
  • Adding Disk Space
  • Operating system and middleware maintenance
  • Redundancy and failure recovery
  • Ensuring scalability
  • Designing for Disability
  • Retry when an execution error occurs
  • Consideration of jobs being concentrated at specific times

Furthermore, Lambda functions do not execute unless there is an execution instruction such as a request or trigger.
Unlike a resident server, it does not need to continue running while waiting for a request or trigger.
The code is executed only when a request or trigger occurs.
If two requests occur simultaneously, the two Lambda functions will be executed simultaneously.
As the number of requests increases, the number of times Lambda functions are executed will also increase, but
Lambda automatically ensures scalability without the need to configure Auto Scaling.
This is because it scales horizontally according to the number of requests, and Lambda functions are executed in parallel.
Therefore, there is no need to configure Auto Scaling.
By default, there is a limit of 1,000 concurrent executions for Lambda functions across the entire account, but
if you need more than 1,000 concurrent executions, you can request an increase in the number of concurrent executions.
In addition, you can set a limit on the number of concurrent executions for each Lambda function.

Finally

This time, I gave a quick 5-minute explanation of Lambda! What did you think? I think one of the
good things about it is that you are only charged when an event or trigger is executed, and there are no charges for waiting time!
Also, Lambda's fault tolerance and high availability are attractive features.
The fact that failures are less likely to occur means that applications can run stably.
Every time I write a blog about AWS like this, I understand why the AWS cloud is so popular.

I would like to continue blogging about AWS services in a general way, so I would be happy if you would read it

Growing every day, moving forward every day.
I must update myself every single day!!!
Thank you for reading to the end.

If you found this article helpful,please give it a "Like"!
2
Loading...
2 votes, average: 1.00 / 12
4,812
X Facebook Hatena Bookmark pocket

The person who wrote this article

About the author

Ayaka Inoue

I belong to the Systems Solutions Department.
I joined Beyond as a founding member of the Shikoku office. I jumped into the IT industry with no prior experience.
As part of the training team, I create curricula and conduct training for new graduates, mid-career hires, and existing members. My
main duties are server operation and maintenance.
Above all, I value our customers' content.
I also belong to the Web Content Business Department and the YouTube team.