Analytics Redefined

AWS Lambda is a serverless compute service offering in AWS Cloud Space. Serverless is a concept that came into existence not so long ago and it kind of revolutionized cloud tech space. We will dig into this amazing offering and understand why this is so popular and which you might also want to adopt in your projects. Believe me! You will end up moving most of your code components to serverless AWS Lambda and might end up saving a lot of money by this decision

What is Serverless? 

As the name suggests, " NO SERVERS " !!!

I'm just kidding, it is not what the name suggests at all! Serverless means you don't have access to the backend infrastructure where your service is being run. Unlike services like EC2 where you have access to install new packages, upgrade software, etc. , here in Serverless, you don't have any visibility to where your service is running.

You pay only for the duration for which you have used the service and for the calls or invocations of the service ( It depends on what service you are using ). For Example, In the case of Lambda, you pay only for the runtime of your code and the number of invocation of the lambda function ( This will make sense once we speak about Lambda )

In simple terms, all the servers , infrastructures, optimization methodologies like Autoscaling, Load Balancing etc. are handled by the cloud vendor. We only need to worry about the Code (in case of Lambda ) , which is our responsibility. 
So, in Serverless you don't have to pay to purchase some capacity ( compute or storage ) or worry about your VM ( EC2 ) being stopped or terminated so that you can save some bucks !!

There are a lot of services in AWS Cloud Stack for the Serverless space. Some of them are :

AWS Lambda, DynamoDB, API Gateway, Fargate, S3, SNS, SQS, Aurora Serverless, etc.

What is AWS Lambda?

AWS Lambda is the serverless offering from Amazon Cloud in the Compute domain. The non-serverless offerings in this space are Amazon EC2 and BeanStalk. Its mainly used for background tasks, validation tasks, and such tasks which has short execution time.

In AWS Lambda, you just have to provide your code (Lambda function) as input, and AWS will take care of the backend infrastructure where the code will be run, autoscale if required, etc. You pay only for the total execution time of your code and the total number of invocations. Your code will be run on a highly available and scalable compute-optimized infrastructure of Amazon, which is AWS's responsibility and guarantee.

AWS Lambda Features and Limits

  • Runs on highly compute-optimized infrastructure which is highly available and scalable
  • Charged only for the number of invocations ( function calls ) and the total execution time
  • Ideal for tasks which have short execution period
  • Very useful in event-triggered architectural designs when Lambda can be used to carry out background calculations, notifications, etc
  • Popular use cases being API Gateway ­čá× Lambda  ­čá×  DynamoDB, S3  ­čá×  Lambda Event triggers, API Gateway Lambda Authentications, etc

AWS Lambda is not a replacement for Amazon EC2 or Beanstalk! Come on now! You really think Amazon is going to ruin its own popular services and help you save money?

Each service in AWS is offered by closely watching the market, customer needs, and are targeted for specific use cases. If we look closely, each of them has a specific targeted use case. Amazon EC2 provides us with virtual compute space where literally, we have access to all its backend. Most of the time, if you are working in a project, you require to have this sort of flexibility and access as per Client requirements.

Lambda is not ideal for use cases which may have total execution time more than 15 mins as specified by Amazon. Also, you cannot store anything between lambda invocations. So, don't expect a Lambda session to store any information about your previous run. Also, lambda only provides 500 MB of /tmp folder for storage during a lambda invocation session which is not a persistent storage, meaning this storage can be used only for storing temporary data during a particular session.

Each time you invoke a lambda function, your code is being run on random location in Amazon secure infrastructure, thus /tmp folder is relative to the server used for that specific invocation and is erased upon completion of that invocation.

Lambda is ideal for ad-hoc tasks, event trigger tasks, background calculations, etc. Many organizations have requirements where they just want to run maybe a big data code once per week. Earlier they had only EMR as options where you have to pay for the services continuously as long as they are up and created. But except for once a week, rest all days are counted as a waste of money. Here comes Lambda to rescue. Now you can just have lambda run the Adhoc Task. You also have an option for scheduling Lambda to run weekly, daily, etc using step functions for instance. This provides greater flexibility and cost efficiency for the end-user.


Serverless is revolutionizing the world of cloud computing but providing such a cost-efficient and reliable service which completely saves you from the headache of managing the infrastructure and allowing developers to completely focus on the code. This article was intended to provide you with an introduction to one of the amazing serverless compute services provided by AWS, Lambda. 

I hope you are now ready enough to dig deeper into Lambda and I was able to provide you with enough information to get you excited about the service! We will continue with awesome tutorials and articles on AWS Lambda in the coming days to aide your serverless journey. 

Tell us how you feel about Lambda and this article! Tell us how can we improve ourselves to serve you better in the comments below

Related Posts

No comments:

Post a Comment