lambda local - a local server for developing aws lambda function in java
TRANSCRIPT
馮彥永 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 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 - 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
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: [email protected]
• Facebook: fb.me/tempofeng