SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
使⽤用 AWS Lambda
開發 Rest Services
馮彥永
Zaoo
馮彥永 Tempo
• 2012. Cubie
• 2008. Gamelet
• 2004. Willmobile
• http://fb.me/tempofeng, http://tempo.tw
• 產品開發週報 http://fb.me/pdwtaiwan
AWS Lambda
• Launched on 2014
• Run code without provisioning or managing servers -
Serverless
• Supported Node.js, Java, C#, Python
• Why?
• Billed by 100ms (and by memory usage)
• Easier
AWS Lambda - Applications
AWS Lambda - Applications
AWS Lambda - Applications
Hello World! - HTTP
Hello World! - Packaging
Hello World! - Deployment
Hello World! - Testing
Hello World! - Pojo
Hello World! - API Gateway
Hello World! - API Gateway
AWS Lambda Proxy Integration
• Wiring between API Gateway and Lambda is hard!
• Lambda Proxy integration
• Remember to Deploy API!
• http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-
up-simple-proxy.html#api-gateway-simple-proxy-for-lambda-input-format
AWS Lambda Proxy Integration
AWS Lambda - Details
• AWS Lambda Log4j Appender
• http://docs.aws.amazon.com/lambda/latest/dg/java-logging.html
• Server Logs
• AWS CloudWatch logs for Humans™
• https://github.com/jorgebastida/awslogs
AWS Lambda - Details
• Object Serialization
• Plain Objects
• Lambda Proxy Integration is better!
• Api Gateway is hard: Returning HTML, Response Headers, Content-Type, …
• Lambda Proxy Integration is better!
• Local testing
• Unit tests only 😢
Lambda-Local
• https://github.com/tempofeng/lambda-local
• Runs AWS Lambda on your local machine
• Uses syntax like Spring MVC (or Retrofit) to
build Rest Services
• Using Jackson for JSON ⇆ Java
• Migrates AWS Lambda Functions back to
Beanstalk or other Application Servers
Lambda-Local - Hello World
Lambda-Local - Running on Local Machine
Lambda-Local - Object Mapping
Lambda-Local - Path Parameters
Lambda-Local - CrossOrigin
Lambda-Local - Running on Lambda
Thoughts on AWS Lambda
• Dagger vs Spring Framework (IoC Container)
• Start up time
• 5sec
• Using sentry.io to collect exceptions
• Cloudwatch
• Running new services without any cost
• Beanstalk → AWS Lambda
Lambda-local
• Lambda-Local
• https://github.com/tempofeng/lambda-local
• Examples today
• https://github.com/tempofeng/lambda-local-talk
• Suggestions
• email: tempofeng@gmail.com
• Facebook: fb.me/tempofeng

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (19)

AWS Cloud Development Kit (CDK)를 이용한 코드 기반 인프라 개발 및 배포 - 공찬호(리얼리티매직) :: AWS C...
AWS Cloud Development Kit (CDK)를 이용한 코드 기반 인프라 개발 및 배포 - 공찬호(리얼리티매직) :: AWS C...AWS Cloud Development Kit (CDK)를 이용한 코드 기반 인프라 개발 및 배포 - 공찬호(리얼리티매직) :: AWS C...
AWS Cloud Development Kit (CDK)를 이용한 코드 기반 인프라 개발 및 배포 - 공찬호(리얼리티매직) :: AWS C...
 
Introduction 2 to aws and storage options
Introduction 2 to aws and storage optionsIntroduction 2 to aws and storage options
Introduction 2 to aws and storage options
 
Intro To Calypso: Simplifying WordPress
Intro To Calypso: Simplifying WordPressIntro To Calypso: Simplifying WordPress
Intro To Calypso: Simplifying WordPress
 
Containerize all the things!
Containerize all the things!Containerize all the things!
Containerize all the things!
 
Serverless Media Workflow
Serverless Media WorkflowServerless Media Workflow
Serverless Media Workflow
 
WordPress Deployment
WordPress DeploymentWordPress Deployment
WordPress Deployment
 
Empowering Publishers - Hosting Provider Selection Process - May-15-2013
Empowering Publishers - Hosting Provider Selection Process - May-15-2013Empowering Publishers - Hosting Provider Selection Process - May-15-2013
Empowering Publishers - Hosting Provider Selection Process - May-15-2013
 
Building a PaaS with Docker and AWS
Building a PaaS with Docker and AWSBuilding a PaaS with Docker and AWS
Building a PaaS with Docker and AWS
 
Ruby Setup
Ruby SetupRuby Setup
Ruby Setup
 
Training Slides: Tungsten Replicator AMI - The Getting Started Guide
Training Slides: Tungsten Replicator AMI - The Getting Started GuideTraining Slides: Tungsten Replicator AMI - The Getting Started Guide
Training Slides: Tungsten Replicator AMI - The Getting Started Guide
 
Serverless
ServerlessServerless
Serverless
 
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
 
AWS Webcast - AWS OpsWorks Continuous Integration Demo
AWS Webcast - AWS OpsWorks Continuous Integration Demo  AWS Webcast - AWS OpsWorks Continuous Integration Demo
AWS Webcast - AWS OpsWorks Continuous Integration Demo
 
Serverless Architecture on AWS
Serverless Architecture on AWSServerless Architecture on AWS
Serverless Architecture on AWS
 
Moving Viadeo to AWS (2015)
Moving Viadeo to AWS (2015)Moving Viadeo to AWS (2015)
Moving Viadeo to AWS (2015)
 
Beyond Heroku: Hosting Your Rails App Yourself
Beyond Heroku: Hosting Your Rails App YourselfBeyond Heroku: Hosting Your Rails App Yourself
Beyond Heroku: Hosting Your Rails App Yourself
 
Inrastructure as Code
Inrastructure as CodeInrastructure as Code
Inrastructure as Code
 
DNN & The CloudOS: Windows Azure on your terms
DNN & The CloudOS: Windows Azure on your termsDNN & The CloudOS: Windows Azure on your terms
DNN & The CloudOS: Windows Azure on your terms
 
Oleksandr Skachkov "How to run WebAssembly in your React web application"
Oleksandr Skachkov "How to run WebAssembly in your React web application"Oleksandr Skachkov "How to run WebAssembly in your React web application"
Oleksandr Skachkov "How to run WebAssembly in your React web application"
 

Andere mochten auch

Accelerate Business Agility with PaaS
Accelerate Business Agility with PaaS Accelerate Business Agility with PaaS
Accelerate Business Agility with PaaS
WSO2
 
Transforming your business with PaaS
Transforming your business with PaaSTransforming your business with PaaS
Transforming your business with PaaS
Omar Nawaz
 

Andere mochten auch (20)

Product Market Fit
Product Market FitProduct Market Fit
Product Market Fit
 
AWS Lambda from the Trenches
AWS Lambda from the TrenchesAWS Lambda from the Trenches
AWS Lambda from the Trenches
 
Introduction to Growth
Introduction to GrowthIntroduction to Growth
Introduction to Growth
 
Getting started with Serverless on AWS
Getting started with Serverless on AWSGetting started with Serverless on AWS
Getting started with Serverless on AWS
 
2015/03/29 作主門徒:腓立比書
2015/03/29 作主門徒:腓立比書2015/03/29 作主門徒:腓立比書
2015/03/29 作主門徒:腓立比書
 
2016.11.27 台灣國際基督教會主日講道投影片
2016.11.27 台灣國際基督教會主日講道投影片2016.11.27 台灣國際基督教會主日講道投影片
2016.11.27 台灣國際基督教會主日講道投影片
 
Accelerate Business Agility with PaaS
Accelerate Business Agility with PaaS Accelerate Business Agility with PaaS
Accelerate Business Agility with PaaS
 
Jelastic - DevOps PaaS Business with Docker Support for Service Providers
Jelastic - DevOps PaaS Business with Docker Support for Service ProvidersJelastic - DevOps PaaS Business with Docker Support for Service Providers
Jelastic - DevOps PaaS Business with Docker Support for Service Providers
 
IBM Softlayer Bluemix Marketplace
IBM Softlayer Bluemix MarketplaceIBM Softlayer Bluemix Marketplace
IBM Softlayer Bluemix Marketplace
 
Transforming your business with PaaS
Transforming your business with PaaSTransforming your business with PaaS
Transforming your business with PaaS
 
基于AWS Lambda的无服务器架构在Strikingly中的应用
基于AWS Lambda的无服务器架构在Strikingly中的应用基于AWS Lambda的无服务器架构在Strikingly中的应用
基于AWS Lambda的无服务器架构在Strikingly中的应用
 
AWS Lambda in C#
AWS Lambda in C#AWS Lambda in C#
AWS Lambda in C#
 
Bluemix, PaaS by IBM - Screenshot demo
Bluemix, PaaS by IBM - Screenshot demoBluemix, PaaS by IBM - Screenshot demo
Bluemix, PaaS by IBM - Screenshot demo
 
PaaS, выделенные сервера, облако и снова PaaS
PaaS, выделенные  сервера, облако и снова PaaSPaaS, выделенные  сервера, облако и снова PaaS
PaaS, выделенные сервера, облако и снова PaaS
 
Introduction to Apache Solr
Introduction to Apache SolrIntroduction to Apache Solr
Introduction to Apache Solr
 
Microservices on AWS using AWS Lambda and Docker Containers
Microservices on AWS using AWS Lambda and Docker ContainersMicroservices on AWS using AWS Lambda and Docker Containers
Microservices on AWS using AWS Lambda and Docker Containers
 
Build reactive systems on lambda
Build reactive systems on lambdaBuild reactive systems on lambda
Build reactive systems on lambda
 
IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry)
IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry) IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry)
IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry)
 
IBM Bluemix Nice Meetup #4-20170302 6 Meetup @INRIA - BlockChain
IBM Bluemix Nice Meetup #4-20170302 6 Meetup @INRIA - BlockChainIBM Bluemix Nice Meetup #4-20170302 6 Meetup @INRIA - BlockChain
IBM Bluemix Nice Meetup #4-20170302 6 Meetup @INRIA - BlockChain
 
Amazon CloudWatch Logs and AWS Lambda
Amazon CloudWatch Logs and AWS LambdaAmazon CloudWatch Logs and AWS Lambda
Amazon CloudWatch Logs and AWS Lambda
 

Ähnlich wie Lambda local - A local server for developing AWS Lambda function in Java

What's New in AWS Serverless and Containers
What's New in AWS Serverless and ContainersWhat's New in AWS Serverless and Containers
What's New in AWS Serverless and Containers
Amazon Web Services
 
Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...
Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...
Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...
Amazon Web Services
 

Ähnlich wie Lambda local - A local server for developing AWS Lambda function in Java (20)

Building serverless apps with Node.js
Building serverless apps with Node.jsBuilding serverless apps with Node.js
Building serverless apps with Node.js
 
Developing serverless applications with .NET on AWS
Developing serverless applications with .NET on AWSDeveloping serverless applications with .NET on AWS
Developing serverless applications with .NET on AWS
 
Serverless Frameworks on AWS
Serverless Frameworks on AWSServerless Frameworks on AWS
Serverless Frameworks on AWS
 
Building Serverless APIs on AWS
Building Serverless APIs on AWSBuilding Serverless APIs on AWS
Building Serverless APIs on AWS
 
Symfony aws
Symfony awsSymfony aws
Symfony aws
 
서버리스(Serverless) 프레임웍 비교 - ClaudiaJS와 Chalice를 중심으로 (윤석찬)
서버리스(Serverless) 프레임웍 비교 - ClaudiaJS와 Chalice를 중심으로 (윤석찬)서버리스(Serverless) 프레임웍 비교 - ClaudiaJS와 Chalice를 중심으로 (윤석찬)
서버리스(Serverless) 프레임웍 비교 - ClaudiaJS와 Chalice를 중심으로 (윤석찬)
 
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
 
Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)
 
Building serverless applications (April 2018)
Building serverless applications (April 2018)Building serverless applications (April 2018)
Building serverless applications (April 2018)
 
What's New in AWS Serverless and Containers
What's New in AWS Serverless and ContainersWhat's New in AWS Serverless and Containers
What's New in AWS Serverless and Containers
 
Application Lifecycle Management on AWS
Application Lifecycle Management on AWSApplication Lifecycle Management on AWS
Application Lifecycle Management on AWS
 
Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)
 
Scala Matsuri 2017
Scala Matsuri 2017Scala Matsuri 2017
Scala Matsuri 2017
 
Serverless DevOps to the Rescue
Serverless DevOps to the RescueServerless DevOps to the Rescue
Serverless DevOps to the Rescue
 
Managing Your Cloud Assets
Managing Your Cloud AssetsManaging Your Cloud Assets
Managing Your Cloud Assets
 
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWSCloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
 
DevOps for Serverless Computing with Demo
DevOps for Serverless Computing with DemoDevOps for Serverless Computing with Demo
DevOps for Serverless Computing with Demo
 
Matt Chung (Independent) - Serverless application with AWS Lambda
Matt Chung (Independent) - Serverless application with AWS Lambda Matt Chung (Independent) - Serverless application with AWS Lambda
Matt Chung (Independent) - Serverless application with AWS Lambda
 
MJ Berends talk - Women & Non-Binary Focused Intro to AWS
 MJ Berends talk - Women & Non-Binary Focused Intro to AWS MJ Berends talk - Women & Non-Binary Focused Intro to AWS
MJ Berends talk - Women & Non-Binary Focused Intro to AWS
 
Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...
Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...
Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...
 

Mehr von Yenwen Feng (13)

在 Kotlin/Android 使用 Ethereum Smart Contract
在 Kotlin/Android 使用 Ethereum Smart Contract在 Kotlin/Android 使用 Ethereum Smart Contract
在 Kotlin/Android 使用 Ethereum Smart Contract
 
Growth
GrowthGrowth
Growth
 
Growth
GrowthGrowth
Growth
 
消費性 APP 的募資經驗分享
消費性 APP 的募資經驗分享消費性 APP 的募資經驗分享
消費性 APP 的募資經驗分享
 
Thoughts behind Cubie Messenger
Thoughts behind Cubie MessengerThoughts behind Cubie Messenger
Thoughts behind Cubie Messenger
 
Facebook flash api and social game development
Facebook flash api and social game developmentFacebook flash api and social game development
Facebook flash api and social game development
 
Our experience to start a startup
Our experience to start a startupOur experience to start a startup
Our experience to start a startup
 
GWT: Our Experiences
GWT: Our ExperiencesGWT: Our Experiences
GWT: Our Experiences
 
Entrepreneurship3
Entrepreneurship3Entrepreneurship3
Entrepreneurship3
 
Intro to Google Gadgets
Intro to Google GadgetsIntro to Google Gadgets
Intro to Google Gadgets
 
Suggestions for Building Websites
Suggestions for Building WebsitesSuggestions for Building Websites
Suggestions for Building Websites
 
Ajax by Examples 2
Ajax by Examples 2Ajax by Examples 2
Ajax by Examples 2
 
Hibernate Cache
Hibernate CacheHibernate Cache
Hibernate Cache
 

Kürzlich hochgeladen

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Kürzlich hochgeladen (20)

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 

Lambda local - A local server for developing AWS Lambda function in Java