Post on 01-Feb-2018
Introduction to Serverless Architecture
@JarredOlson
http://getstepitup.com
http://www.jarredolson.com/speaking/serverless/index.html
Bad Software Architecture
• Inability to scale
• Slow performance
• Increased time to deliver features
• Loss of income
http://www.forbes.com/sites/benkepes/2015/06/03/30-of-servers-are-sitting-comatose-according-to-research/
#3b3df47f2c2e
What is serverless?
What is serverless?
• Backend as a Service (BaaS)
• Function as a Service (FaaS)
Backend as a Service (BaaS)
3rd party services with simple APIs to handle common backend features. For example,
authentication and authorization, push notifications, storage, etc.
Backend as a Service (BaaS)
https://aws.amazon.com/s3/
Backend as a Service (BaaS)
https://auth0.com/
Backend as a Service (BaaS)
https://firebase.google.com/
Client (browser)
Application Server
Save File
Client (browser)
Get Auth
Save File
S3
Application Server
BaaS Demo
Backend as a Service (BaaS)
• Why reinvent the wheel?
• Startups and New projects
• Cost analysis
–Mike Roberts
“Stateless compute containers that are event-triggered, (last a short time), and fully managed
by a 3rd party…”
Function as a Service (FaaS)
http://martinfowler.com/articles/serverless.html
Isn’t that just ‘the cloud’?
No
The Cloud
• Decide on Operating System
• Install tools that install tools: yum, apt-get
• Install tools: tomcat, apache, nginx, java, php, ruby…
• Have an upgrade plan for tools
• Have an upgrade plan for the OS
• Be responsible for security patches
So how is FaaS different?
Function as a Service (FaaS)
• Stateless
• Event-triggered
• Last a short time
• Fully managed by a 3rd party
Function
Event
FaaS
• Upload code
• Runtime (Java, Python, Node.js)
• Define the entry point
• Memory
Trigger
Function
Trigger
Trigger
Trigger
Event
Event
Event
FaaS Demo
Cost
$0.00001667 (1/60,000 th of a cent) for every GB/s used.
$0.20 for every 1 million requests
Serverless Architecture Pros
• Can save money
• Provides horizontal scalability
• Focus on your business
When should I use a Serverless Architecture?
• Microservices
• Processing items in a queue
• Traffic is highly inconsistent or unknown
• Developing a Minimum Viable Product (MVP)
• Developing IoT
Serverless Architecture Cons
• Vendor specific
• Testing
• Lack of tooling
When should I not use a Serverless Architecture?
• Don’t go looking for a problem to fit a solution
• If it’s going to cause problems downstream
• Stateful operations, Workflows
Closing Thoughts
Thank You!
• http://martinfowler.com/articles/serverless.html
• https://d0.awsstatic.com/whitepapers/AWS_Serverless_Multi-Tier_Architectures.pdf
• https://www.manning.com/books/serverless-architectures-on-aws
• https://aws.amazon.com/developers/getting-started/browser/