SlideShare a Scribd company logo
Going Serverless
with AWS Lambda
Gandhi Jay
Why talk about Serverless?
● Web Scraping - Actual use case from Tribelocal
○ Use case is to find Business is listed correctly, incorrectly or not listed on directory.
○ Process
■ Scrap the directory’s web page with parameter
■ Parse businesses and it’s related information
■ Find matching record from parsed data
■ If any information is incorrect or business is not listed, Notify the user.
○ Each directory might have different way to data.
Traditional approach
● In Monolith,
○ Create Directory DataLoader
○ Write XPaths/Css Selectors
○ Write code to scrap directory’s webpage
○ Write code to parse Businesses
○ Write code to match Business and find out it’s correct, incorrect, duplicate or not
listed.
Repeat the process for another directory.
Traditional approach: is it good?
● As number of locations increases requests are
increasing.
● Simple Web scraping problem suddenly
becomes distributed computing nightmare.
● A service take independent functions
● runs it in parallel "containers"
○ can be monitored separately
○ can be scaled separately and automatically
● Pay per execution. (in ms)
● Lets you focus on application, not infrastructure.
What is Serverless?
There are actual servers, located somewhere but you don’t have to worry about.
Someone said use Serverless,
Backend as a Service Function as a Service Serverless+ =
Serverless Approach
● Choose your runtime.
● Write code for AWS Lambda.
● Put it into S3
● Configure AWS Lambda
● Configure Services like API Gateway, SNS etc.
● Test it.
Benefits of Serverless
● Increases flexibility to scale
○ Provisioning based on usage, not instances
○ Self auto-scaling and auto-provisioning
● Reduced time to write code
● Minimum risk
○ No living host or instances
● Decreased Time to Market
● Encourages a modular, well encapsulated, loosely coupled architecture
● Reduced resource cost
○ Costs based on precise usage (no usage = no cost)
Service Providers - Serverless
● AWS Lambda
● Google Cloud Functions
● Azure Functions
● Auth0 Webtask
● IBM OpenWhisk
At ReportGarden - AWS Lambda
● Function as a Service platform
○ Billed per 100ms
○ Node.js, Python, C# and JRE(OpenJDK)
● Event-driven
● Asynchronous invocation
● Can be integrated with other AWS service
● AWS Serverless Ecosystem
○ Lambda
○ API Gateway
○ SNS
○ SQS
○ DynamoDB
○ S3
○ Kinesis
○ CloudWatch
○ Step Functions
AWS Lambda Runtime Environment
● Memory Available from 128MB to 1.5GB
○ Minimum CPU speed and I/O scale will be based on Memory
● 2 Virtual CPUs
● 512MB /tmp storage
● 50MB compressed(jar/zip) for function, 250MB deployment package
● STDOUT and STDERR, goes to CloudWatch Logs
AWS Lambda - http://docs.aws.amazon.com/lambda/latest/dg/welcome.html
Functions runs when events are triggered
● A POST request is sent to API Gateway
● A scheduled cron triggers
● A new item is added to S3 bucket
● An infrastructure event matching rule is found.
● A SAAS webhook is fired.
● A link in email is clicked.
● A new item is added to DB.
Async, Latency Tolerant WebScraping with AWS Lambda Framework - Scrapie
Request with
JSON spec
AWS API
Gateway
Trigger
Lambda
AWS
SNS
scrape
-job
AWS Lambda
ScraperNotifier
Client
System
AWS Lambda
ScraperJob
Hit Callback
URL with
messageid and
content.
AWS CloudWatch &
Rollbar
(Monitoring & Logging)
AWS CloudFormation
(Orchestration)
Gradle & Serverless
(Build & Deployment)
Helium Scraping
Service
Proxy
Configure Lambda, SNS, API Gateway….
Still lot of work & We are lazy.
DEMO
● Prerequisite
○ Install NVM - Node Version Manager
○ Install serverless
○ Install AWS CLI
○ AWS configure with your AccessKey and SecretKey
○ Good to GO!
Challenges - Serverless
● State
● Latency
● Loss of control
● Testing/Tooling
○ Serverless-offline
○ localstack/localstack
○ But not lot of the options.
● Very low latency
○ High Frequency Trading
● Large Scale, in memory, stateful
○ MFTs of TBs of data.
● Long running, stateful
○ Synchronous external transactions
Terrible use cases -
Serverless
Awesome Serverless use cases.
● Async, Latency tolerant
○ Data Pipelines, Automatic Thumbnail generation, New User welcome emails, PDF Generation
● Sync, Latency tolerant
○ Web apps, APIs
● Glue
○ Infrastructure automation, orchestration
● Analytics Stack
○ AWS Athena, AWS Glue
Thank You.
Gandhi Jay

More Related Content

What's hot (20)

PDF
PloneConf2017: serverless python for astronaut safety
Chris Shenton
 
PDF
Cloud Conf Varna - Cloud Application with AWS Lambda functions
Dimitar Danailov
 
PPTX
Serverless Architectures
Lynn Langit
 
PDF
Cloud in your Cloud
Matthew Campbell
 
PDF
Server-less solution for moving Millions of Images in Cloud - Brett Sutter, ...
AWS Chicago
 
PDF
AWSome day 2018 - database in cloud
Corley S.r.l.
 
PDF
Dray
Brian DeHamer
 
PDF
AWSome day 2018 - scalability and cost optimization with container services
Corley S.r.l.
 
PDF
AWSome day 2018 - API serverless with aws
Corley S.r.l.
 
PPTX
Big data school AWS
DataArt
 
PDF
From business requirements to working pipelines with apache airflow
Derrick Qin
 
PDF
Matt Chung (Independent) - Serverless application with AWS Lambda
Outlyer
 
PDF
AWS Bulgaria: Re:invent 2017 Recap
Ivaylo Bratoev
 
PDF
Ruslan Gibaiev.Doing real-time stream processing in one of the fastest-growin...
IT Arena
 
PPTX
Serverless GraphQL. AppSync 101
Marcin Sodkiewicz
 
PDF
Making Wallstreet talk with GO (GO India Conference 2015)
Matthew Campbell
 
PDF
OSOM - Operations in the Cloud
Marcela Oniga
 
PDF
OSOM Operations in the Cloud
mstuparu
 
PPT
Amazon Webservice & Cloud Computing
Jack Smith
 
PDF
AWS Lambda + AWS Cloudformation
Jordi Miguel
 
PloneConf2017: serverless python for astronaut safety
Chris Shenton
 
Cloud Conf Varna - Cloud Application with AWS Lambda functions
Dimitar Danailov
 
Serverless Architectures
Lynn Langit
 
Cloud in your Cloud
Matthew Campbell
 
Server-less solution for moving Millions of Images in Cloud - Brett Sutter, ...
AWS Chicago
 
AWSome day 2018 - database in cloud
Corley S.r.l.
 
AWSome day 2018 - scalability and cost optimization with container services
Corley S.r.l.
 
AWSome day 2018 - API serverless with aws
Corley S.r.l.
 
Big data school AWS
DataArt
 
From business requirements to working pipelines with apache airflow
Derrick Qin
 
Matt Chung (Independent) - Serverless application with AWS Lambda
Outlyer
 
AWS Bulgaria: Re:invent 2017 Recap
Ivaylo Bratoev
 
Ruslan Gibaiev.Doing real-time stream processing in one of the fastest-growin...
IT Arena
 
Serverless GraphQL. AppSync 101
Marcin Sodkiewicz
 
Making Wallstreet talk with GO (GO India Conference 2015)
Matthew Campbell
 
OSOM - Operations in the Cloud
Marcela Oniga
 
OSOM Operations in the Cloud
mstuparu
 
Amazon Webservice & Cloud Computing
Jack Smith
 
AWS Lambda + AWS Cloudformation
Jordi Miguel
 

Similar to Going Serverless with AWS Lambda at ReportGarden (20)

PDF
Jumpstart your idea with AWS Serverless [Oct 2020]
Dhaval Nagar
 
PDF
Write less (code) and build more with serverless
Dhaval Nagar
 
PDF
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
Dhaval Nagar
 
PDF
State of serverless
Anurag Saran
 
PDF
Crio.do - Deployment on AWS Masterclass
Dhaval Nagar
 
PPTX
Amazon Web Services lection 5
Binary Studio
 
PPTX
Serverless design considerations for Cloud Native workloads
Tensult
 
PDF
GreatLearning Webinar - Microservices and Event-Driven Architecture.pdf
Dhaval Nagar
 
PDF
AWS Lambda and Serverless framework: lessons learned while building a serverl...
Luciano Mammino
 
PDF
PyConIT 2018 Writing and deploying serverless python applications
Cesar Cardenas Desales
 
PDF
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
Serverless Optical Character Recognition in support of Astronaut Safety AWS M...
Chris Shenton
 
PDF
Writing and deploying serverless python applications
Cesar Cardenas Desales
 
PPTX
Introduction to amazon web services for developers
Ciklum Ukraine
 
PDF
Low Cost AWS Services For Application Development in the Cloud
Dhaval Nagar
 
PDF
Serverless OCR for NASA EVA: AWS Meetup DC 2017-12-12
Chris Shenton
 
PDF
How to Build a Big Data Application: Serverless Edition
ecobold
 
PDF
Laskar: High-Velocity GraphQL & Lambda-based Software Development Model
Garindra Prahandono
 
PDF
Exposing Lambda Functions as Managed APIs
WSO2
 
PDF
Deploying Serverless Cloud Optical Character Recognition in Support of NASA A...
Chris Shenton
 
Jumpstart your idea with AWS Serverless [Oct 2020]
Dhaval Nagar
 
Write less (code) and build more with serverless
Dhaval Nagar
 
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
Dhaval Nagar
 
State of serverless
Anurag Saran
 
Crio.do - Deployment on AWS Masterclass
Dhaval Nagar
 
Amazon Web Services lection 5
Binary Studio
 
Serverless design considerations for Cloud Native workloads
Tensult
 
GreatLearning Webinar - Microservices and Event-Driven Architecture.pdf
Dhaval Nagar
 
AWS Lambda and Serverless framework: lessons learned while building a serverl...
Luciano Mammino
 
PyConIT 2018 Writing and deploying serverless python applications
Cesar Cardenas Desales
 
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
Serverless Optical Character Recognition in support of Astronaut Safety AWS M...
Chris Shenton
 
Writing and deploying serverless python applications
Cesar Cardenas Desales
 
Introduction to amazon web services for developers
Ciklum Ukraine
 
Low Cost AWS Services For Application Development in the Cloud
Dhaval Nagar
 
Serverless OCR for NASA EVA: AWS Meetup DC 2017-12-12
Chris Shenton
 
How to Build a Big Data Application: Serverless Edition
ecobold
 
Laskar: High-Velocity GraphQL & Lambda-based Software Development Model
Garindra Prahandono
 
Exposing Lambda Functions as Managed APIs
WSO2
 
Deploying Serverless Cloud Optical Character Recognition in Support of NASA A...
Chris Shenton
 
Ad

Recently uploaded (20)

PPTX
MODULE 05 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PPTX
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
PPTX
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
PPTX
MODULE 03 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PPTX
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
PPTX
Knowledge Representation : Semantic Networks
Amity University, Patna
 
PPTX
Distribution reservoir and service storage pptx
dhanashree78
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PPTX
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
PPTX
MODULE 04 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PPTX
Water Resources Engineering (CVE 728)--Slide 3.pptx
mohammedado3
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
PPTX
Final Major project a b c d e f g h i j k l m
bharathpsnab
 
PDF
Electrical Machines and Their Protection.pdf
Nabajyoti Banik
 
PDF
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
PPTX
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
PPTX
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
MODULE 05 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
MODULE 03 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
Knowledge Representation : Semantic Networks
Amity University, Patna
 
Distribution reservoir and service storage pptx
dhanashree78
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
MODULE 04 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
Water Resources Engineering (CVE 728)--Slide 3.pptx
mohammedado3
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
Final Major project a b c d e f g h i j k l m
bharathpsnab
 
Electrical Machines and Their Protection.pdf
Nabajyoti Banik
 
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
Ad

Going Serverless with AWS Lambda at ReportGarden

  • 1. Going Serverless with AWS Lambda Gandhi Jay
  • 2. Why talk about Serverless? ● Web Scraping - Actual use case from Tribelocal ○ Use case is to find Business is listed correctly, incorrectly or not listed on directory. ○ Process ■ Scrap the directory’s web page with parameter ■ Parse businesses and it’s related information ■ Find matching record from parsed data ■ If any information is incorrect or business is not listed, Notify the user. ○ Each directory might have different way to data.
  • 3. Traditional approach ● In Monolith, ○ Create Directory DataLoader ○ Write XPaths/Css Selectors ○ Write code to scrap directory’s webpage ○ Write code to parse Businesses ○ Write code to match Business and find out it’s correct, incorrect, duplicate or not listed. Repeat the process for another directory.
  • 4. Traditional approach: is it good? ● As number of locations increases requests are increasing. ● Simple Web scraping problem suddenly becomes distributed computing nightmare.
  • 5. ● A service take independent functions ● runs it in parallel "containers" ○ can be monitored separately ○ can be scaled separately and automatically ● Pay per execution. (in ms) ● Lets you focus on application, not infrastructure. What is Serverless? There are actual servers, located somewhere but you don’t have to worry about. Someone said use Serverless, Backend as a Service Function as a Service Serverless+ =
  • 6. Serverless Approach ● Choose your runtime. ● Write code for AWS Lambda. ● Put it into S3 ● Configure AWS Lambda ● Configure Services like API Gateway, SNS etc. ● Test it.
  • 7. Benefits of Serverless ● Increases flexibility to scale ○ Provisioning based on usage, not instances ○ Self auto-scaling and auto-provisioning ● Reduced time to write code ● Minimum risk ○ No living host or instances ● Decreased Time to Market ● Encourages a modular, well encapsulated, loosely coupled architecture ● Reduced resource cost ○ Costs based on precise usage (no usage = no cost)
  • 8. Service Providers - Serverless ● AWS Lambda ● Google Cloud Functions ● Azure Functions ● Auth0 Webtask ● IBM OpenWhisk
  • 9. At ReportGarden - AWS Lambda ● Function as a Service platform ○ Billed per 100ms ○ Node.js, Python, C# and JRE(OpenJDK) ● Event-driven ● Asynchronous invocation ● Can be integrated with other AWS service ● AWS Serverless Ecosystem ○ Lambda ○ API Gateway ○ SNS ○ SQS ○ DynamoDB ○ S3 ○ Kinesis ○ CloudWatch ○ Step Functions
  • 10. AWS Lambda Runtime Environment ● Memory Available from 128MB to 1.5GB ○ Minimum CPU speed and I/O scale will be based on Memory ● 2 Virtual CPUs ● 512MB /tmp storage ● 50MB compressed(jar/zip) for function, 250MB deployment package ● STDOUT and STDERR, goes to CloudWatch Logs AWS Lambda - http://docs.aws.amazon.com/lambda/latest/dg/welcome.html
  • 11. Functions runs when events are triggered ● A POST request is sent to API Gateway ● A scheduled cron triggers ● A new item is added to S3 bucket ● An infrastructure event matching rule is found. ● A SAAS webhook is fired. ● A link in email is clicked. ● A new item is added to DB.
  • 12. Async, Latency Tolerant WebScraping with AWS Lambda Framework - Scrapie Request with JSON spec AWS API Gateway Trigger Lambda AWS SNS scrape -job AWS Lambda ScraperNotifier Client System AWS Lambda ScraperJob Hit Callback URL with messageid and content. AWS CloudWatch & Rollbar (Monitoring & Logging) AWS CloudFormation (Orchestration) Gradle & Serverless (Build & Deployment) Helium Scraping Service Proxy
  • 13. Configure Lambda, SNS, API Gateway…. Still lot of work & We are lazy.
  • 14. DEMO ● Prerequisite ○ Install NVM - Node Version Manager ○ Install serverless ○ Install AWS CLI ○ AWS configure with your AccessKey and SecretKey ○ Good to GO!
  • 15. Challenges - Serverless ● State ● Latency ● Loss of control ● Testing/Tooling ○ Serverless-offline ○ localstack/localstack ○ But not lot of the options. ● Very low latency ○ High Frequency Trading ● Large Scale, in memory, stateful ○ MFTs of TBs of data. ● Long running, stateful ○ Synchronous external transactions Terrible use cases - Serverless
  • 16. Awesome Serverless use cases. ● Async, Latency tolerant ○ Data Pipelines, Automatic Thumbnail generation, New User welcome emails, PDF Generation ● Sync, Latency tolerant ○ Web apps, APIs ● Glue ○ Infrastructure automation, orchestration ● Analytics Stack ○ AWS Athena, AWS Glue

Editor's Notes

  • #5: Need to ask why? Bar