AWS Lambda, Working, Cost, Advantages, Disadvantages

Hello guys, welcome back to my blog. In this article, I will discuss AWS lambda, working of AWS lambda, Cost of AWS lambda, advantages, disadvantages, etc.

If you need an article on some other topics then comment us below in the comment box. You can also catch me @ Instagram – Chetan Shidling.

Also, read:

  1. Blockchain Technology, History, Working, Applications, Advantages.
  2. Front End And Back End Web Developer, Salary, Skills, Languages.
  3. Difference Between AWS, Microsoft Azure, And Google Cloud.

AWS Lambda

Aws stands for amazon web services. Here we are discussing aws lambda it means, What is mean by AWS lambda and we will also find out how does lambda works and it’s a block diagram, cost, and advantages and disadvantages. Aws lambda is not using servers it means serverless. When we read the above statement we get a lot of doubts about lambda. How lambda works without servers. Here we clarify everything about this aws lambda.

With its event-driven model and flexibility, Aws lambda is a great fit for automating various business tasks that don’t require an entire server at all times. This might include running scheduled jobs that perform cleanup in your infrastructure, processing data from forms submitted on our website, or moving data around between different data stores on demand.

Application developers writing event-driven applications want seamless integration between their Aws based applications. Streaming data from Aws services like s3, kinesis, dynamo DB needs processing. Aws lambda can be configured with external event timers to perform scheduled tasks. Logs generated by Aws services like s3, kinesis, and dynamo Db can be dynamically audited and tracked.

AWS lambda initially released in November 2014 by developers amazon.com. It uses a cross-platform operating system. Aws lambda is one of the services under the compute sections of services that AWS provides.

It runs code without using servers. It is used to execute background tasks. In this, we are just uploading code, and the code is executed. It supports many languages like python, java,c#, go, ruby, js, etc. Whenever we upload our code to lambda. It means automatically handles all the capacities means scaling patching and security.

It automatically scales our application by running code in response to each trigger. Here we are not charged for any of the servers. The only payment required is for the amount of time the code is computed. By default, a lambda can support up to 1000 parallel container executions. In 10 seconds API has 1000 requests. The minimum compressed size of a lambda package is 50 MB with the maximum uncompressed size is being 250 MB.

Cost Of The AWS Lambda

AWS lambda billed in two different ways. The first one based on the number of requests made and another one is the amount of workload it performed during those requests. Usage cost charged in terms of GB seconds. 1 million requests per month are free thereafter $0.20 per additional million requests. 400,000 GB seconds free for a month. Thereafter $0.0000166667 for every GB second. This price will vary on the amount of memory allocated.

128MB of memory×30M executed per month×200MS run time per invocation=$5.83.

Aws Lambda Working and Block Diagram

Block diagram of AWS lambda

The above diagram shows the working of Aws lambda. Lambda function run in its own container. The whole infrastructure of lambda is operated by Aws. Thus the customer doesn’t know how the system operates and they don’t have to worry about updating the underlying machines, avoiding network contention, and so on.

One of the unique architectural features that Aws lambda is that many instances of the same function, or different functions of the same Aws can be executed consistently. Aws lambda works only within the ecosystem. Aws lambda can be figured with external event timers.

Step 1: Here clients send data and clients could be anyone who sending requests to Aws lambda. It could be an application or other amazon web services that sending data to the lambda.

Step 2: Then lambda receives a request and depending on the size of the data and volume of data it runs on. Here we will take some of the Aws services.

Step 3: Aws lambda which has details of the upload code and the event and the which trigger has occurred. Here we take some requests like events from amazon s3, Amazon API, Amazon gateway, Dynamo Db, Amazon SNS, Amazon kinesis, CloudFront, Amazon SES, CloudTrail, Mobile app, etc.

Step 4: Aws lambda executes the code when triggered by the Aws services. Below we will see the amazon services.

a. Amazon s3 (simple storage service) stores the file that uploaded by the user and other details of the file it means file upload, deletion, or moving of file. This all file information passes to the Aws lambda. It does some of the data processing also. The code which is presented in Aws lambda can take to the next step that it receives the event details.

b. Dynamo Db is used for change detection. It also has information like insertion, Updating, and deletion of data in the dynamo Db table. It means when we added the data, update the data, and deleted the data in that particular Db table.

c. API gateway is using get/post methods calls to the API. We share details with API by creating a form. It uses Aws lambda for further processing. We host the lambda function behind the API gateway to create the rest API.

d. SNS is used to push the notifications, and we can also sending an SMS to the phone which receives the trigger from the Aws lambda. It used for Message processing.

e. CloudFront is hosting a website host where we host our website. Its like content delivery network which delivers data, videos, etc.

f. Aws kinesis is a collection of data streams. It is used to store the log entries data stream.

g. CloudTrail is monitoring the logs.

Step 5: when the requests grow it actually creates multiple containers. When the request reduced as well as the number of containers also reduced and that will helps in saving the cost. Remember that we are not paying for resources we only charge for that amount of time our code runs.

Object uploads to amazon s3 buckets updates to amazon dynamo Db tables data and amazon kinesis dreams or in-app activity once you upload your code to lambda the service handles all the capacity scaling and patching and administration of the infrastructures to run your code and provides visibility into performance by publishing real-time metrics and logs to amazon cloud watch all you need to do is write the code.

Our code uploads as a zip file or designs it in the Aws management console. You can select from a list of function samples. Pre-built for common use cases image conversion, file compression, and change notifications. Built-in support for the Aws SDK makes it easy to call other Aws web services.

Once your function is loaded you select the event source to monitor such as an amazon s3 bucket or dynamo DB table and within a few seconds, lambda will be ready to trigger your function automatically. When an event occurs with lambda any event can trigger your function making it easy to build applications that respond quickly to new information.

Applications Of AWS Lambda

There are a huge number of use cases of AWS lambda and many ways AWS lambda is used specifically in the business world. Let we discuss some uses in all of that,

Image processing

Applications of AWS lambda

Lets the object get uploaded in an s3 bucket in a format. It means the file has been formatted in raw format and Aws lambda is triggered any time when new objects added to the bucket. The other end of the device that could be reading data could be a pc, apple, android and tablet what not based on the devices. Lambda can trigger converted video or picture into the different formats.

Social media data

And Another use case for lambda is to analyze social media data lets say we collecting hashtag trending data and the data is received and its added to the kinesis stream to feed into the amazon environment and lambda action get triggered. And it sees the data is stored in the database which can be used by business users for later analysis.

And some of the companies that use Aws lambda are THOMSON REUTERS, Benchling, NORDSTROM, Robot, coca-cola. that have received amazing benefits by using lambda.

Features Of AWS Lambda

Let’s discuss some of the new features of Aws lambda.

01. Lambda edge: It allows you to easily deploy our lambda functions to multiple regions across the globe this ensures low latency for our customers no matter where they are accessing our application.

02. Lambda destinations: which was recently announced in reinvent last year and that allows you to pipe our lambda functions output directly into other Aws services such as SNS or SQS this is in contrast to you having to manually write the code within our lambda function to publish to these services.

03. Lambda layers: which allow us to easily include reusable libraries into our lambda function so that those libraries can be shared across multiple lambda applications.

04. Provision concurrency (cold start): which was also announced in reinvent last year and allows us to make our application more highly available and less likely to receive latency spikes during the first few invitations which are also known as the cold start.

Advantages Of AWS Lambda

01. No server to manage – Here Aws lambda runs our code without requiring us to rule or manage servers. This serverless platform will provide us the best and clear separation between the infrastructure and applications that run on the top of the platform. Then the system engineers can focus on managing the core services. By this completely serverless this Aws lambda doesn’t require system administration.

02. Multi-language support – Aws lambda can support standard languages like node.js, python, java, c# and go. These are the most popular languages know that’s why any developer can easily find out code.

03. Billing based on usage – We are only charging for the amount of time function runs. So it reduces the number of costs means minimized the cost.

04. We can also use Aws lambda for free. We login to Aws free tier. After completion of login it gives us free service for 1 year.

05. Ease case of working with code – we just upload our code lambda takes care of maintaining the code and triggers the code. The product engineers can innovate them rapidly as they are serverless they reduce the problems of system engineering then you will spend less time on operational issues.

06. Continues scaling – Aws lambda automatically scales our application by running code in response to each trigger. Our code runs in parallel and processes each trigger individually scaling definitely with the size of the workload

07. Cloud provider – the cloud provider handles all the hardware and software. No need to do deploy, update, monitor and manage servers.

08. In this function as a service, the units of this code can be exposed to the outside of the world. It means the programmer doesn’t worry about multithreading and handling HTTP requests.

09. Aws lambda is fast it will execute our code within milliseconds.

10. There are no new language tools or frameworks to learn you can use any third party library even native ones.

Disadvantages Of AWS Lambda

01. For small projects its not suitable.

02. We need to carefully analyze and write our code. It may take a long time for our code to be executed. It gets terminated as per the time out specified on it. Then our code will not be fully executed.

03. Aws lambda infrastructure completely depends on Aws. We will not be able to install any additional software as requested by our code.

04. This Aws lambda currently limits you to 1000 concurrent executions only. You will run out of lambda.

05. Aws lambda functions are aborted if they run longer than 5 minutes. Less configuration, cross amount execution limits impact on how you test.

Conclusion

After knowing all the details of Aws lambda. Here we have a lot of advantages by using Aws lambda and it is highly profitable. We can easily do our work it means we just upload the correct code to the lambda. Lambda takes care of all the next steps. It saves our time and cost.

In spite of the more advantages, it also has some drawbacks. In the early days, we have such wonderful technologies. Amazon web services also very popular technology in that. For the execution of our long code, it may terminate for some specified time out to overcome this drawback we upload our long code to Aws batch is used for long running process. So, we can execute our total code without any terminations. Nowadays we have very fast developers. So utilize our technology receives new development.

Change world with technology

Content writer – G.Pravalika

I hope this article may help you all a lot. Thank you for reading. If you have any doubts related to this article, then comment below.

Also, read:

Chetan Shidling

Learning Addicted, Engineer, Blogger, YouTuber, Content Writer, Google Adsense Expert, SEO Expert, Digital Marketer, Web Developer, App Developer, Cloud Computing, and a lot more...

Leave a Reply

Your email address will not be published. Required fields are marked *