Thursday, 10 February 2022

Introduction to AWS Lambda

 
Falls under Compute category of AWS Services (among which are EC2, EBS, Elastic Load Balancing).
 
We only need to provide the code that needs to run on hardware. Servers are automatically provided so we don't need to provision or manage them. 

AWS Lambda platform provides automatic scaling, based on the workload, in response to each trigger it receives. 

We are charged only for the time that our application is running. 1 ms granularity is used.
 
Lambda can run any type of application or backend services. It supports many programming languages like C++, C#, Java, JavaScript, Python, Go etc... 

It can run the code (functions) in response to events received from other applications or AWS services. These events are actually requests to AWS Lambda. Requests are handled by containers which run the code written in such way to serve the query. If number of requests grows, so grows the number of containers spawned and assigned to this lambda. If number of request decreases, the smaller number of containers gets used. 

Use Case Example: Processing images uploaded to S3
  • image is uploaded to S3 bucket
  • this triggers AWS Lambda 
  • lambda function processes the image and formats it into a thumbnail adjusted for the device it will be showed on (mobile, tablet, PC)

Use Case Example: Extracting trending social media hashtags

  • social media data e.g. hashtags is added to Amazon Kinesis (streaming data processing platform)
  • this triggers AWS Lambda 
  • data is stored in DBs for further processing

Use Case Example: A near real-time data backup system

  • the goal is to save a copy of a document in a temporary storage system as soon as it's uploaded to server
  • create two S3 buckets: one where data is uploaded and another one for storing its copy
  • to allow these buckets talk to each other we need to set up Identity and Access Management (IAM) roles and policies
  • the code which copies data between buckets will be in Lambda function
    • this Lambda function is triggered each time a document is uploaded to first S3 bucket

 

How it differs from EC2? 

How to decide when to use EC2 and when Lambda?


Resources:



4 comments:

Data Analytics Course in Dehradun said...

This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post. Data Science Course in Vadodara

Taylor said...

I just have to introduce this hacker that I have been working with him on getting my credit score been boosted across the Equifax, TransUnion and Experian report. He made a lot of good changes on my credit report by erasing all the past eviction, bad collections and DUI off my credit report history and also increased my FICO score above 876 across my three credit bureaus report you can contact him for all kind of hacks . Email him here support@wavedrive.tech go on their website wavedrive.tech for more details,Whatsapp No:+14106350697 if you want to chat them up,One thing i can assure you would not regret this at all he is 100% legit

data analyst training in chennai said...

This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck. Data Science Course in Dehradun

data analyst training in chennai said...

Superb Information, I really appreciated with it, This is fine to read and valuable pro potential, I really bookmark it, pro broaden read. Appreciation pro sharing. I like it. Data Analytics Course in Dehradun