introduction to serverless architecture - amazon s3 · pdf fileintroduction to serverless...

37
Introduction to Serverless Architecture @JarredOlson http://getstepitup.com http://www.jarredolson.com/speaking/serverless/index.html

Upload: lecong

Post on 01-Feb-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Introduction to Serverless Architecture

@JarredOlson

http://getstepitup.com

http://www.jarredolson.com/speaking/serverless/index.html

Page 2: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that
Page 3: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that
Page 4: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Bad Software Architecture

• Inability to scale

• Slow performance

• Increased time to deliver features

• Loss of income

Page 5: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

http://www.forbes.com/sites/benkepes/2015/06/03/30-of-servers-are-sitting-comatose-according-to-research/

#3b3df47f2c2e

Page 6: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

What is serverless?

Page 7: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that
Page 8: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

What is serverless?

• Backend as a Service (BaaS)

• Function as a Service (FaaS)

Page 9: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

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.

Page 10: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Backend as a Service (BaaS)

https://aws.amazon.com/s3/

Page 11: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Backend as a Service (BaaS)

https://auth0.com/

Page 12: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Backend as a Service (BaaS)

https://firebase.google.com/

Page 13: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Client (browser)

Application Server

Save File

Page 14: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Client (browser)

Get Auth

Save File

Facebook

S3

Application Server

Page 15: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

BaaS Demo

Page 16: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Backend as a Service (BaaS)

• Why reinvent the wheel?

• Startups and New projects

• Cost analysis

Page 17: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

–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

Page 18: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Isn’t that just ‘the cloud’?

Page 19: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

No

Page 20: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

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

Page 21: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that
Page 22: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that
Page 23: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that
Page 24: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

So how is FaaS different?

Page 25: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Function as a Service (FaaS)

• Stateless

• Event-triggered

• Last a short time

• Fully managed by a 3rd party

Page 26: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Function

Event

FaaS

• Upload code

• Runtime (Java, Python, Node.js)

• Define the entry point

• Memory

Trigger

Page 27: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Function

Trigger

Trigger

Trigger

Event

Event

Event

Page 28: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

FaaS Demo

Page 29: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that
Page 30: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Cost

$0.00001667 (1/60,000 th of a cent) for every GB/s used.

$0.20 for every 1 million requests

Page 31: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Serverless Architecture Pros

• Can save money

• Provides horizontal scalability

• Focus on your business

Page 32: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

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

Page 33: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that
Page 34: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Serverless Architecture Cons

• Vendor specific

• Testing

• Lack of tooling

Page 35: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

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

Page 36: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

Closing Thoughts

Page 37: Introduction To Serverless Architecture - Amazon S3 · PDF fileIntroduction to Serverless Architecture ... authentication and authorization, ... “Stateless compute containers that

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/