Aws lambda là gì


We’ve heard a lot about the term “serverless,” how they work, & the benefits that your application brings. A serverless service in general will not require any hệ thống provision to lớn run the application. When you run an application on serverless, users will not have to worry about setting up the operating system, patching, or extending the servers that you will have khổng lồ consider when running your application on a physical server.

Bạn đang xem: Aws lambda là gì

Recently, when it comes lớn serverless, it’s about AWS Lambda services. This is a provision-free serverless compute offering based on Amazon web Services functions. In this article, VTI Cloud will introduce AWS Lambda, including how it links to a serverless architecture, how lớn create it, & when lớn use it.

What is AWS Lambda?

AWS Lambda

is a serverless compute service of Amazon website Services (AWS). AWS Lambda operates on the FaaS (Function-as-a-service) model. With AWS Lambda services, users, especially developers, won’t have to lớn worry about managing and delivering zero administration, just focus on building applications!

By simply uploading code to lớn AWS Lambda, the service runs code, scales about the infrastructure to always ensure application performance & availability.

Code running on AWS Lambda is called lambda function. Currently, lambda function supports the following programming languages:

JavaPythonC #Node.jsGoPowerShellRuby

The function also provides runtime API, which can be used khổng lồ run functions written by other native programming languages.


3. Real-time tệp tin processing

Usually, CMS applications for nội dung management always have the function of uploading images. This image will be saved on the Amazon S3 bucket. Aws Lambda can now be used to create an automated task.

For example, after uploading an image, triggers to create another version of the shape with a lower resolution (thumbnails) and be at another bucket.

AWS Lambda will help applications automatically in in-call logic on demand & only if it is really necessary. Reference: GitHub – aws-samples/lambda-refarch-fileprocessing: Serverless Reference Architecture for Real-time tệp tin Processing

4. Real-time stream processing 

For applications with “tremendous” traffic, the system often uses AWS Lambda and Amazon Kinesis Stream services to process real-time streaming data for application tracking activities, or real-time studies of various data from metrics collect from many data sources such as clickstream websites, Payment transactions, Social truyền thông media timeline, IT logs or Location-based tracking.

Reference: GitHub – aws-samples/lambda-refarch-streamprocessing: Serverless Reference Architecture for Real-time Stream Processing


The service costs

With AWS Lambda, you pay only for what you use. You are charged based on the number of requests for functions & duration, code execution time.

Duration is calculated from when the code is enforced khổng lồ the time the execution is complete or terminate, rounded to lớn the nearest 1ms. The cost will be based on the capacity of the layout allocated lớn the function.

AWS Lambda free usage tier includes 1M free requests and 400,000 GB-s of calculated time per month. Below is the price danh mục for the region Asia Pacific (Singapore) of this service.


You can see more about AWS Lambda pricing here:

How does AWS Lambda work?


The Function window will be open, select Create Function.


Then you need lớn fill in some necessary information for this lambda function. Enter the function name & select the Node .js that you want khổng lồ use for this function.

Xem thêm: Luyện Thanh Cho Người Giọng Yếu Đơn Giản Dễ Làm, 3 Bước Luyện Thanh Giọng Nữ Để Có Giọng Hát Hay

There are 04 methods when creating functions:

Author from scratch – Starts from a simple command lượt thích print("Hello, world!").

Use a blueprint – Allows you khổng lồ build a lambda function using “blueprint”. Blueprint in this context means a pre-written piece of code (NodeJs and Python only) for common use cases, such as logging updates made to lớn a DynamoDB table or activating a function when something is uploaded to lớn the S3 bucket.

Container image – Use the available image container to lớn deploy functions, using this method to lớn take advantage of image containers from the previous project to lớn save time creating new.

Browse serverless phầm mềm repository – Allows you lớn deploy all sample applications from the AWS Serverless Application Repository. These packages can be provided by AWS or by the community.

AWS Lambda is not a global service!

This means you have to change the region khổng lồ where you want to lớn implement Lambda function (depending on project requirements).


Note that depending on the need lớn create functions in VPC cases that can be customized in the Advanced Settings section


Step 2: Upload code lớn AWS Lambda Function

Below is the Function code window. Here will be where you upload your code, be it straight into this window (called AWS internal code editor), or upload as a zip file.


Now click the thử nghiệm button in the top right corner. You will get a pop-up window khổng lồ configure the demo event, enter the event name & click Create.


Pulling upwards will have specific information about this test. Details such as request-id, duration, billed duration, resources configured … with log đầu ra available.



How to lớn configure AWS Lambda with other AWS services

To run code in AWS Lambda, you need to enable lambda function with an external AWS service, which can hotline lambda function. For example, the service can be an S3 bucket.

Within milliseconds, lambda will be ready khổng lồ automatically activate your function when an sự kiện occurs. AWS Lambda runs your code when the trigger event is in call. The service provides management và monitoring of servers for you.

If your function requires a lot of processing power, the service will choose the instance type with more processing power & RAM, or if your lambda code is only executed in two seconds, the service will choose the lowest possible version, saving you money và time.

In this article, VTI Cloud will show you how to địa chỉ API Gateway trigger with Lambda function.



Once done, click Add


That’s it! It’s simple, isn’t it?


For a developer, saving time to manage and operate your infrastructure system ensures that your application can scale, high availability is indeed precious. The AWS Lambda serverless service helps developers just focus on developing their applications without having to pay attention to lớn their code-running infrastructure!

About VTI Cloud

VTI Cloud is an Advanced Consulting Partner of AWS Vietnam with a team of over 50+ AWS certified solution engineers. With the desire to support customers in the journey of digital transformation và migration khổng lồ the AWS cloud, VTI Cloud is proud lớn be a pioneer in consulting solutions, developing software, và deploying AWS infrastructure to customers in Vietnam and Japan.

Xem thêm: Cách Lấy Lại Mật Khẩu Samsung Account, Cách Lấy Lại Mật Khẩu Tài Khoản Samsung Account

Building safe, high-performance, flexible, and cost-effective architectures for customers is VTI Cloud’s leading mission in enterprise technology mission.