The document discusses serverless architectures and focuses on Node.js, AWS Lambda, and the Serverless Framework. It provides an overview of serverless architectures and their advantages like pay-per-use and easy scaling. It also describes Node.js, AWS Lambda functions, and how the Serverless Framework can help manage serverless projects. Some disadvantages discussed are limitations on AWS Lambda functions and challenges with debugging serverless applications. The document concludes that serverless can be cost effective for event-driven workloads but may not be a good fit for all projects.
2. DO SERVER-SIDE BETTER BY GOING SERVERLESS
OVERVIEW - OUTLINE
▸ What’s all the hype about serverless architectures?
▸ Focus on Node.js, AWS Lambda, & Serverless Framework
▸ Discuss the advantages, disadvantages & limitations of a
serverless architecture
3. DO SERVER-SIDE BETTER BY GOING SERVERLESS
OVERVIEW - TAKEAWAYS
▸ General understanding of
▸ Serverless Architectures
▸ Node.js
▸ AWS Lambda
▸ Serverless Framework
▸ The value they provide
4. DO SERVER-SIDE BETTER BY GOING SERVERLESS
ABOUT ME
▸ Jason Sich
▸ Software Developer at
ClickFunnels.com
▸ Experience in JavaScript, Node.js,
AWS, & Serverless Framework
▸ Not the best
5. DO SERVER-SIDE BETTER BY GOING SERVERLESS
SERVERLESS ARCHITECTURE - SUCH HYPE
▸ News & Social Media (Hacker News, Lobsters, Twitter
▸ Conferences (Serverless Conf US/London)
▸ Libraries/Frameworks (Serverless Framework, Apex,
Chalice, Zappa)
▸ AWS Flourish (Swagger for Lambda/API Gateway?)
6. DO SERVER-SIDE BETTER BY GOING SERVERLESS
SERVERLESS ARCHITECTURE - WHAT IS IT?
▸ Functions as a Service
▸ “custom code that’s run in ephemeral containers” - Mike
Roberts via martinfowler.com/articles/serverless.html
▸ Tightly coupled to providers infrastructure components
▸ e.g. API Gateway, S3
▸ Provides an easy integration point for providers
7. DO SERVER-SIDE BETTER BY GOING SERVERLESS
SERVERLESS ARCHITECTURE - WHAT’S SO COOL ABOUT IT?
▸ Pay for what you need
▸ Easily scales
▸ Don’t have to manage servers!
▸ Easy deployment
9. DO SERVER-SIDE BETTER BY GOING SERVERLESS
NODE.JS - WHAT IS IT?
▸ JavaScript runtime built on V8 engine
▸ Node.js is not exclusive, but is pervasive
▸ AWS Lambda
▸ Azure Functions
▸ Google Cloud Functions
▸ iron.io
10. DO SERVER-SIDE BETTER BY GOING SERVERLESS
NODE.JS - WHAT’S COOL ABOUT IT?
▸ Event-driven, non-blocking I/O model
▸ Callbacks, Promises, Async/Await
▸ Typical use-cases for Serverless
▸ Scripted & Dynamic
▸ REPL
▸ Lots of existing libraries & tooling (aws-sdk)
11. DO SERVER-SIDE BETTER BY GOING SERVERLESS
NODE.JS - USAGE
▸ JavaScript is Ubiquitous (Server/Web Client/Mobile)
▸ Big companies using Node.js
▸ Walmart
▸ Uber
▸ PayPal
▸ Netflix
12. DO SERVER-SIDE BETTER BY GOING SERVERLESS
AWS LAMBDA - WHAT IS IT?
▸ Amazon’s AWS FaaS product
13. DO SERVER-SIDE BETTER BY GOING SERVERLESS
AWS LAMBDA - FEATURES
▸ Pay by millisecond
▸ Horizontal Scaling
▸ Supports Node.js, Python, & Java (JVM Languages)
▸ No need to manage servers
▸ More flexible than PaaS
▸ Run Binaries, Temp Files, …
14. DO SERVER-SIDE BETTER BY GOING SERVERLESS
AWS LAMBDA - THE WHOLE CLOUD (AT LEAST AMAZONS)
▸ API Gateway
▸ IoT
▸ Kinesis
▸ DynamoDB
▸ S3
▸ Cloud Watch
▸ Alexa
▸ CodeCommit
▸ SNS
▸ MORE…
15. DO SERVER-SIDE BETTER BY GOING SERVERLESS
AWS LAMBDA - CONFIGURATION TOOLS
▸ AWS Web Console
▸ CloudFormation
▸ AWS CLI
▸ AWS SDK
16. DO SERVER-SIDE BETTER BY GOING SERVERLESS
AWS LAMBDA - CONFIGURATION OPTIONS
▸ Runtime Support (Node, Java, Python)
▸ Memory
▸ 1536 MB max
▸ Timeout
▸ 5 minutes max
▸ Triggers
17. DO SERVER-SIDE BETTER BY GOING SERVERLESS
AWS LAMBDA - CODE
▸ Inline coding using online editor
▸ S3 Zip
▸ Gotta package dependencies too
21. DO SERVER-SIDE BETTER BY GOING SERVERLESS
SERVERLESS FRAMEWORK
▸ www.serverless.com
▸ CLI tool to create & manage Serverless Projects
22. DO SERVER-SIDE BETTER BY GOING SERVERLESS
SERVERLESS FRAMEWORK - FUN FACTS
▸ Just hit v1.0
▸ $3 million in funding
▸ Source is Open
▸ Supports Node.js, Python, Java & More
▸ Other platforms than AWS coming soon (Serverless
Platform is in beta)
23. DO SERVER-SIDE BETTER BY GOING SERVERLESS
SERVERLESS FRAMEWORK - WHY?
▸ Helps organize & manage a serverless project
▸ Lambda creation, configuration & deployment
▸ AWS resource management via CloudFormation stacks
▸ Setup of Lambdas to Events & Resources
▸ Project structure by Services
24. DO SERVER-SIDE BETTER BY GOING SERVERLESS
SERVERLESS FRAMEWORK - CONCEPTS
▸ Service
▸ Framework’s unit of organization (like a project)
▸ Defines the Functions along with the Events & Resources
they use
25. DO SERVER-SIDE BETTER BY GOING SERVERLESS
SERVERLESS FRAMEWORK - CONCEPTS
▸ Function
▸ AWS Lambda Function
▸ Can be independently deployed
▸ Should do a single thing (separate concerns)
31. DO SERVER-SIDE BETTER BY GOING SERVERLESS
ALL TOGETHER NOW - THE GOOD
▸ Node.js
▸ Event-driven I/O model
▸ Ubiquitous
▸ Prevalent
32. DO SERVER-SIDE BETTER BY GOING SERVERLESS
ALL TOGETHER NOW - THE GOOD
▸ AWS Lambda
▸ Pay per millisecond
▸ No servers to manage
▸ Fairly flexible (binaries, temp files, …)
33. DO SERVER-SIDE BETTER BY GOING SERVERLESS
ALL TOGETHER NOW - THE GOOD
▸ Serverless Framework
▸ Serverless management from the command line
▸ Gives structure/conventions to FaaS project
▸ Stays out of your way during coding
34. DO SERVER-SIDE BETTER BY GOING SERVERLESS
ALL TOGETHER NOW - THE BAD
▸ Node.js
▸ Language & ecosystem are evolving quickly
▸ Async first
▸ Lacking standard library
35. DO SERVER-SIDE BETTER BY GOING SERVERLESS
ALL TOGETHER NOW - THE BAD
▸ AWS lambda limits
36. DO SERVER-SIDE BETTER BY GOING SERVERLESS
ALL TOGETHER NOW - THE BAD
▸ AWS lambda limits
37. DO SERVER-SIDE BETTER BY GOING SERVERLESS
ALL TOGETHER NOW - THE BAD
▸ AWS lambda limits
38. DO SERVER-SIDE BETTER BY GOING SERVERLESS
ALL TOGETHER NOW - THE BAD
▸ AWS lambda
▸ Node v4.3
▸ Cold Start Time
▸ Response Times
▸ API Gateway, CloudFront Distribution, Lambda
▸ AWS Web Console is not fun to use
39. DO SERVER-SIDE BETTER BY GOING SERVERLESS
ALL TOGETHER NOW - THE BAD
▸ AWS Lambda
▸ Debugging can be hard
▸ Statelessness
▸ Resource usage spikes
▸ Vendored dependencies
40. DO SERVER-SIDE BETTER BY GOING SERVERLESS
ALL TOGETHER NOW - THE BAD
▸ Serverless Framework
▸ Evolving quickly JAWS -> SF v0.5 -> SF v1.0
▸ May not play well with other infrastructure tools
▸ New, needs maturity
41. DO SERVER-SIDE BETTER BY GOING SERVERLESS
MORAL OF THE STORY
▸ Great if you are planning to AWS
▸ Can be cost effective vs running & managing a server
▸ Awesome for event handling
42. DO SERVER-SIDE BETTER BY GOING SERVERLESS
THE END
▸ Questions?
▸ Twitter: @jasich, @grdevnight
▸ Slides will get posted there