SlideShare a Scribd company logo
AWS Lambda & API Gateway
Tech Talks Tokyo #3
2016-07-05 Tue
me
fumihiko hata (@hatappo)
Server side engineer @ stylerecipe, inc
[Now]: Fashion consultation & advice mobile apps (~ 1 year)
[Previous]: Ad-techs (7 years)
[Langs]: Java, Ruby, Clojure, Node
[Likes]: Scrum, AWS, GCP
aws lambda & api gateway
➢ We built some micro service servers.
➢ Our main web server system is a bit learge and complicated.
➢ So we decide to try Lambda & APIGateway partly.
AWS
➢ Amazon Web Services
➢ Iaas
➢ One of the most famous cloud infrastracture service.
➢ But it’s not come cheap ( of course depends on usage).
AWS::Lambda
➢ Cloud computing resources
➢ Like EC2
■ a per-time charge
➢ Not-like EC2
■ Very restricted environment
Only for simple function code and only with Node.js, Python, or Java.
■ by 100ms (EC2: by 3,600,000ms = 1hour)
■ Very low cost!
No Using, No Charge
Huge free tier: 1,000,000 request/month & 400,000 GB-seconds/month
AWS::Lambda
AWS::Lambda
AWS::APIGateway
➢ Web API management layer that enable to integrate various backends.
■ web services on EC2
■ cooperate with lambda
■ of course not only in AWS endpoints (redirect to another url).
■ (support mock response for depvelopment)
➢ Also low cost
■ You pay only for calls made to your APIs and data transfer out.
AWS::APIGateway
AWS::APIGateway
Swagger
➢ You can import / export settings of the API Gateway as swagger json (or yaml).
➢ IOW, You can commit the settings to your git repository!
➢ Of Course Lambda code is mere function (that is predefined signature).
Using Langs
➢ Node.js
■ Very famous server side implementation of JS.
○ We developed a image converter server.
It convert size & aspect & bg-color only for Twitter cards & OGP.
So This server need not high capacity & has independent feature.
➢ Clojure
■ Clojure is Lisp dialect built on JVM.
■ Of course Runnnable on Lamda.
○ We developed a scraping api server that only target apparel web site.
It’s accept url from query, then scrape that page and response structured that.
This Lambda code also work batch as well as api server.
Tools
➢ Clojure
■ Lein-clj-lambda https://github.com/mhjort/lein-clj-lambda
Build jar & deploy to a Lambda
■ Lein-aws-apigateway https://github.com/trieloff/lein-aws-apigateway
Import/Export settings of API Gateway as Swagger
■ Lambada https://github.com/uswitch/lambada
Macros for Lambda
➢ ClojureScript
■ Cljs-lambda https://github.com/nervous-systems/cljs-lambda
➢ Node.js
■ Serverless https://github.com/serverless/serverless
Big framework for AWS Lambda, Azure Functions, Google CloudFunctions
(Serverlss conf was held May 26,27 2016 http://serverlessconf.io/)
Good
➢ Easy to deply. It’s only to run a api.
➢ AAMOF, Not only for server side but also for batch processing.
Lambda also has scheduler like crontab.
➢ Both is auto scaling!
➢ Both is able to manage in a repo.
NotGood::Testing
➢ There is no easy way to test API Gateway localy.
(Lambda is a mere function)
➢ As in common development on AWS, preparing cost for good local testing
environmet is much higher if you use lambda with other AWS Services something
like S3, DynamoDB.
NotGood::Lambda Restrictions
➢ Deployment package size: max 50MB
→ not enough to learge system.
➢ Processing time: max 300sec
➢ Number of processes & threads: 1024
➢ Disk capacity(“/tmp”): max 512MB
→ not suited to learge data processing. (use asynchronous architecture!)
NotGood::Node Version
➢ Lambda currently support Node.js v4.3.2 & v0.10.36
→ In other words, Lambda doesn’t support full ES6!
Ex.
Promise, arrow operator(=>), let, const, template literal(`foo ${v}`)
Destructuring, rest parameters(...args), default function parameters
NotGood::First Call Performance Penalty
http://numergent.com/2016-01/AWS-Lambda-Clojure-and-ClojureScript.html
Conclusion
➢ Lambda is easy to develop a micro-service function.
➢ APIGateway is a handy interface for http in AWS services.
➢ Lambda & API Gateway need no server manegement.
➢ Lambda & API Gateway are friendly on our wallet :)
➢ But Lambda has few caution (especialy with JVM).
thanks for listining.

More Related Content

What's hot (13)

PPTX
AWS API Gateway
Muhammed YALÇIN
 
PPTX
AWS - Lambda Fundamentals
Piyush Agrawal
 
PDF
AWS Lambda
Danilo Poccia
 
PDF
AWS Lambda
Scott Leberknight
 
PPT
Aws Lambda Cart Microservice Server Less
Dhanu Gupta
 
PDF
Amazon Elastic Block Storage and Balancer
Whizlabs
 
PDF
Amazon API Gateway and AWS Lambda: Better Together
Danilo Poccia
 
PPTX
Serverless computing
Dmitriy Ivanov
 
PPTX
2016 - Serverless Microservices on AWS with API Gateway and Lambda
devopsdaysaustin
 
PPTX
AWS Serverless concepts and solutions
ElenaIvannikova3
 
PDF
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Danilo Poccia
 
PDF
Serverless Computing
Rushi Namani
 
PPTX
Serverless Architecture
Elana Krasner
 
AWS API Gateway
Muhammed YALÇIN
 
AWS - Lambda Fundamentals
Piyush Agrawal
 
AWS Lambda
Danilo Poccia
 
AWS Lambda
Scott Leberknight
 
Aws Lambda Cart Microservice Server Less
Dhanu Gupta
 
Amazon Elastic Block Storage and Balancer
Whizlabs
 
Amazon API Gateway and AWS Lambda: Better Together
Danilo Poccia
 
Serverless computing
Dmitriy Ivanov
 
2016 - Serverless Microservices on AWS with API Gateway and Lambda
devopsdaysaustin
 
AWS Serverless concepts and solutions
ElenaIvannikova3
 
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Danilo Poccia
 
Serverless Computing
Rushi Namani
 
Serverless Architecture
Elana Krasner
 

Similar to aws lambda & api gateway (20)

PDF
Writing and deploying serverless python applications
Cesar Cardenas Desales
 
PDF
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
Dhaval Nagar
 
PDF
Čtvrtkon #64 - AWS Serverless - Michal Haták
Ctvrtkoncz
 
PDF
State of serverless
Anurag Saran
 
PDF
PyConIT 2018 Writing and deploying serverless python applications
Cesar Cardenas Desales
 
PDF
What’s new in serverless - re:Invent 2020
AWS Chicago
 
PDF
PyConIE 2017 Writing and deploying serverless python applications
Cesar Cardenas Desales
 
PDF
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
PPTX
Building self service framework
Rovshan Musayev
 
PPTX
Serverless design considerations for Cloud Native workloads
Tensult
 
PDF
Running Containerized Node.js Services on AWS Elastic Beanstalk
zupzup.org
 
PDF
Running R on AWS Lambda by Ana-Maria Niculescu
Paris Women in Machine Learning and Data Science
 
PDF
AWS Community Day 2022 Dhiraj Mahapatro_AWS Lambda under the hood _ Best Prac...
AWS Chicago
 
PDF
AWS Lambdas are cool - Cheminfo Stories Day 1
ChemAxon
 
PDF
Webinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
MongoDB
 
PDF
Serverless APIs with JavaScript - Matt Searle - ChocPanda
Paul Dykes
 
ODP
Go lambda-presentation
Steven White
 
PDF
Serverless in java Lessons learnt
Krzysztof Pawlowski
 
PDF
AWS Lambda and Serverless framework: lessons learned while building a serverl...
Luciano Mammino
 
PDF
Getting Started with AWS Lambda & Serverless Cloud
Ian Massingham
 
Writing and deploying serverless python applications
Cesar Cardenas Desales
 
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
Dhaval Nagar
 
Čtvrtkon #64 - AWS Serverless - Michal Haták
Ctvrtkoncz
 
State of serverless
Anurag Saran
 
PyConIT 2018 Writing and deploying serverless python applications
Cesar Cardenas Desales
 
What’s new in serverless - re:Invent 2020
AWS Chicago
 
PyConIE 2017 Writing and deploying serverless python applications
Cesar Cardenas Desales
 
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
Building self service framework
Rovshan Musayev
 
Serverless design considerations for Cloud Native workloads
Tensult
 
Running Containerized Node.js Services on AWS Elastic Beanstalk
zupzup.org
 
Running R on AWS Lambda by Ana-Maria Niculescu
Paris Women in Machine Learning and Data Science
 
AWS Community Day 2022 Dhiraj Mahapatro_AWS Lambda under the hood _ Best Prac...
AWS Chicago
 
AWS Lambdas are cool - Cheminfo Stories Day 1
ChemAxon
 
Webinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
MongoDB
 
Serverless APIs with JavaScript - Matt Searle - ChocPanda
Paul Dykes
 
Go lambda-presentation
Steven White
 
Serverless in java Lessons learnt
Krzysztof Pawlowski
 
AWS Lambda and Serverless framework: lessons learned while building a serverl...
Luciano Mammino
 
Getting Started with AWS Lambda & Serverless Cloud
Ian Massingham
 
Ad

Recently uploaded (20)

PPTX
Academic Debate: Creation vs Evolution.pptx
JOHNPATRICKMARTINEZ5
 
PPTX
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
 
PDF
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
 
PDF
google promotion services in Delhi, India
Digital Web Future
 
PDF
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
PDF
Strategic Plan New and Completed Templeted
alvi932317
 
PPTX
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 
PDF
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
PPTX
Networking_Essentials_version_3.0_-_Module_5.pptx
ryan622010
 
PDF
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
ssuser73bdb11
 
PPTX
美国电子毕业证帕克大学电子版成绩单UMCP学费发票办理学历认证
Taqyea
 
PDF
web application development company in bangalore.pdf
https://dkpractice.co.in/seo.html tech
 
PPTX
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
PDF
Digital burnout toolkit for youth workers and teachers
asociatiastart123
 
PPTX
CHAPTER 1 - PART 3 FOR GRADE 11 STUDENTS
FSBTLEDNathanVince
 
PDF
Empowering Local Language Email with IDN & EAI – Powered by XgenPlus
XgenPlus Technologies
 
PDF
The Internet - By the numbers, presented at npNOG 11
APNIC
 
PDF
Top 10 Testing Procedures to Ensure Your Magento to Shopify Migration Success...
CartCoders
 
PPTX
Meloniusk_Communication_Template_best.pptx
howesix147
 
PDF
BRKAPP-1102 - Proactive Network and Application Monitoring.pdf
fcesargonca
 
Academic Debate: Creation vs Evolution.pptx
JOHNPATRICKMARTINEZ5
 
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
 
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
 
google promotion services in Delhi, India
Digital Web Future
 
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
Strategic Plan New and Completed Templeted
alvi932317
 
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
Networking_Essentials_version_3.0_-_Module_5.pptx
ryan622010
 
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
ssuser73bdb11
 
美国电子毕业证帕克大学电子版成绩单UMCP学费发票办理学历认证
Taqyea
 
web application development company in bangalore.pdf
https://dkpractice.co.in/seo.html tech
 
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
Digital burnout toolkit for youth workers and teachers
asociatiastart123
 
CHAPTER 1 - PART 3 FOR GRADE 11 STUDENTS
FSBTLEDNathanVince
 
Empowering Local Language Email with IDN & EAI – Powered by XgenPlus
XgenPlus Technologies
 
The Internet - By the numbers, presented at npNOG 11
APNIC
 
Top 10 Testing Procedures to Ensure Your Magento to Shopify Migration Success...
CartCoders
 
Meloniusk_Communication_Template_best.pptx
howesix147
 
BRKAPP-1102 - Proactive Network and Application Monitoring.pdf
fcesargonca
 
Ad

aws lambda & api gateway

  • 1. AWS Lambda & API Gateway Tech Talks Tokyo #3 2016-07-05 Tue
  • 2. me fumihiko hata (@hatappo) Server side engineer @ stylerecipe, inc [Now]: Fashion consultation & advice mobile apps (~ 1 year) [Previous]: Ad-techs (7 years) [Langs]: Java, Ruby, Clojure, Node [Likes]: Scrum, AWS, GCP
  • 4. ➢ We built some micro service servers. ➢ Our main web server system is a bit learge and complicated. ➢ So we decide to try Lambda & APIGateway partly.
  • 5. AWS ➢ Amazon Web Services ➢ Iaas ➢ One of the most famous cloud infrastracture service. ➢ But it’s not come cheap ( of course depends on usage).
  • 6. AWS::Lambda ➢ Cloud computing resources ➢ Like EC2 ■ a per-time charge ➢ Not-like EC2 ■ Very restricted environment Only for simple function code and only with Node.js, Python, or Java. ■ by 100ms (EC2: by 3,600,000ms = 1hour) ■ Very low cost! No Using, No Charge Huge free tier: 1,000,000 request/month & 400,000 GB-seconds/month
  • 9. AWS::APIGateway ➢ Web API management layer that enable to integrate various backends. ■ web services on EC2 ■ cooperate with lambda ■ of course not only in AWS endpoints (redirect to another url). ■ (support mock response for depvelopment) ➢ Also low cost ■ You pay only for calls made to your APIs and data transfer out.
  • 12. Swagger ➢ You can import / export settings of the API Gateway as swagger json (or yaml). ➢ IOW, You can commit the settings to your git repository! ➢ Of Course Lambda code is mere function (that is predefined signature).
  • 13. Using Langs ➢ Node.js ■ Very famous server side implementation of JS. ○ We developed a image converter server. It convert size & aspect & bg-color only for Twitter cards & OGP. So This server need not high capacity & has independent feature. ➢ Clojure ■ Clojure is Lisp dialect built on JVM. ■ Of course Runnnable on Lamda. ○ We developed a scraping api server that only target apparel web site. It’s accept url from query, then scrape that page and response structured that. This Lambda code also work batch as well as api server.
  • 14. Tools ➢ Clojure ■ Lein-clj-lambda https://github.com/mhjort/lein-clj-lambda Build jar & deploy to a Lambda ■ Lein-aws-apigateway https://github.com/trieloff/lein-aws-apigateway Import/Export settings of API Gateway as Swagger ■ Lambada https://github.com/uswitch/lambada Macros for Lambda ➢ ClojureScript ■ Cljs-lambda https://github.com/nervous-systems/cljs-lambda ➢ Node.js ■ Serverless https://github.com/serverless/serverless Big framework for AWS Lambda, Azure Functions, Google CloudFunctions (Serverlss conf was held May 26,27 2016 http://serverlessconf.io/)
  • 15. Good ➢ Easy to deply. It’s only to run a api. ➢ AAMOF, Not only for server side but also for batch processing. Lambda also has scheduler like crontab. ➢ Both is auto scaling! ➢ Both is able to manage in a repo.
  • 16. NotGood::Testing ➢ There is no easy way to test API Gateway localy. (Lambda is a mere function) ➢ As in common development on AWS, preparing cost for good local testing environmet is much higher if you use lambda with other AWS Services something like S3, DynamoDB.
  • 17. NotGood::Lambda Restrictions ➢ Deployment package size: max 50MB → not enough to learge system. ➢ Processing time: max 300sec ➢ Number of processes & threads: 1024 ➢ Disk capacity(“/tmp”): max 512MB → not suited to learge data processing. (use asynchronous architecture!)
  • 18. NotGood::Node Version ➢ Lambda currently support Node.js v4.3.2 & v0.10.36 → In other words, Lambda doesn’t support full ES6! Ex. Promise, arrow operator(=>), let, const, template literal(`foo ${v}`) Destructuring, rest parameters(...args), default function parameters
  • 19. NotGood::First Call Performance Penalty http://numergent.com/2016-01/AWS-Lambda-Clojure-and-ClojureScript.html
  • 20. Conclusion ➢ Lambda is easy to develop a micro-service function. ➢ APIGateway is a handy interface for http in AWS services. ➢ Lambda & API Gateway need no server manegement. ➢ Lambda & API Gateway are friendly on our wallet :) ➢ But Lambda has few caution (especialy with JVM).