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

PDF
Serverless haskell
PDF
Serverless Computing with AWS
PPTX
Marshall Magee - Build a dynamic website for less than $1.55/month using S3 a...
PDF
Henrique Rodrigues (NotOnTheHighStreet.com) - Building a Future-Proof Infrast...
PDF
Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...
PPTX
Leonard Austin (Ravelin) - DevOps in a Machine Learning World
PPTX
An experiment with AWS Lambda
PDF
Total cloud immersion
Serverless haskell
Serverless Computing with AWS
Marshall Magee - Build a dynamic website for less than $1.55/month using S3 a...
Henrique Rodrigues (NotOnTheHighStreet.com) - Building a Future-Proof Infrast...
Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...
Leonard Austin (Ravelin) - DevOps in a Machine Learning World
An experiment with AWS Lambda
Total cloud immersion

What's hot (20)

PDF
PloneConf2017: serverless python for astronaut safety
PDF
Cloud Conf Varna - Cloud Application with AWS Lambda functions
PPTX
Serverless Architectures
PDF
Cloud in your Cloud
PDF
Server-less solution for moving Millions of Images in Cloud - Brett Sutter, ...
PDF
AWSome day 2018 - database in cloud
PDF
PDF
AWSome day 2018 - scalability and cost optimization with container services
PDF
AWSome day 2018 - API serverless with aws
PPTX
Big data school AWS
PDF
From business requirements to working pipelines with apache airflow
PDF
Matt Chung (Independent) - Serverless application with AWS Lambda
PDF
AWS Bulgaria: Re:invent 2017 Recap
PDF
Ruslan Gibaiev.Doing real-time stream processing in one of the fastest-growin...
PPTX
Serverless GraphQL. AppSync 101
PDF
Making Wallstreet talk with GO (GO India Conference 2015)
PDF
OSOM - Operations in the Cloud
PDF
OSOM Operations in the Cloud
PPT
Amazon Webservice & Cloud Computing
PDF
AWS Lambda + AWS Cloudformation
PloneConf2017: serverless python for astronaut safety
Cloud Conf Varna - Cloud Application with AWS Lambda functions
Serverless Architectures
Cloud in your Cloud
Server-less solution for moving Millions of Images in Cloud - Brett Sutter, ...
AWSome day 2018 - database in cloud
AWSome day 2018 - scalability and cost optimization with container services
AWSome day 2018 - API serverless with aws
Big data school AWS
From business requirements to working pipelines with apache airflow
Matt Chung (Independent) - Serverless application with AWS Lambda
AWS Bulgaria: Re:invent 2017 Recap
Ruslan Gibaiev.Doing real-time stream processing in one of the fastest-growin...
Serverless GraphQL. AppSync 101
Making Wallstreet talk with GO (GO India Conference 2015)
OSOM - Operations in the Cloud
OSOM Operations in the Cloud
Amazon Webservice & Cloud Computing
AWS Lambda + AWS Cloudformation
Ad

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

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

Recently uploaded (20)

PPTX
Artificial Intelligence
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PPTX
Safety Seminar civil to be ensured for safe working.
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
additive manufacturing of ss316l using mig welding
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Well-logging-methods_new................
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
 
DOCX
573137875-Attendance-Management-System-original
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
 
PPTX
Geodesy 1.pptx...............................................
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Foundation to blockchain - A guide to Blockchain Tech
Artificial Intelligence
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Safety Seminar civil to be ensured for safe working.
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
additive manufacturing of ss316l using mig welding
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Model Code of Practice - Construction Work - 21102022 .pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Well-logging-methods_new................
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
 
573137875-Attendance-Management-System-original
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
CH1 Production IntroductoryConcepts.pptx
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
 
Geodesy 1.pptx...............................................
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Mechanical Engineering MATERIALS Selection
Foundation to blockchain - A guide to Blockchain Tech

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