ContainerDayVietnam2016: Serverless & Current Trends
Click here to load reader
-
Upload
docker-hanoi -
Category
Technology
-
view
133 -
download
0
Transcript of ContainerDayVietnam2016: Serverless & Current Trends
![Page 1: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/1.jpg)
Serverless & current trends VIETPH
![Page 2: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/2.jpg)
Outline
Some History Background
What is Serverless
Serverless in AWS
Why serverless?
How serverless?
Prediction: Future is (mostly) serverless
![Page 3: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/3.jpg)
*** as a service
Container as a Service
Provide container as a service
(Or running container on top of IaaS)
Function as a Service
Provide function as a service
IaaS
Provide VM as a service PaaS
Provide Platform as a service
SaaS
Provide Software as a service Traditional
Cloud
When we
add
Container
DevOps,
Microservice
When we
add
Function
NoLessOps,
Nanoservice
![Page 4: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/4.jpg)
How serverless was born
People ask AWS: “I use S3 to store image files and
generate icons. Do I need to manage a cluster of virtual
machines for that? We just want some place to run
code”
AWS: “OK, we give you Lambda”. And serverless is born.
Every big public cloud now has their own serverless
offering: IBM OpenWhisk, AWS Lambda, Azure Function,
Google Cloud Function
![Page 5: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/5.jpg)
How serverless was born
Pet vs Cattle vs Herd
Hardware becomes invisible, there’s only the
application.
![Page 6: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/6.jpg)
What is Serverless?
Serverless means “No server”
Serverless is a software architecture style
In serverless, you write applications that run without
any traditional servers or VMs
Serverless code can be triggered to run from
service events (e.g. a Lambda code which run
every time a new file is inserted into S3 bucket)
![Page 7: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/7.jpg)
Serverless as the “glue”
Serverless has two main purposes
Act as glues to stick together other public cloud service
A place to quickly run your code in a elastic, scalable, highly available way
Serverless is applicable for many scenarios: Serverless web site, back end processing
![Page 8: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/8.jpg)
Is serverless the same as PaaS?
PaaS: Run code without managing underlying server
Microsoft Azure: Web Role and Worker Role
Google App Engine
Heroku
Traditional PaaS was not serverless
Unit of execution
Complexity
Pricing
![Page 9: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/9.jpg)
Normal web application with EC2
Web Server ELB Dynamo
DB Route53
Static Content
AutoScaling Group
Browser
Is it perfect?
![Page 10: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/10.jpg)
Normal web application with EC2
Web Server ELB Dynamo
DB Route53
Static Content
AutoScaling Group
Browser
No it is not perfect!
• Needs at least
two instances to
ensure 99.95%
availability
• Lower utilization
• Must manage
server, OS
(monitoring,
patching,
logging,…)
![Page 11: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/11.jpg)
How about that?
• ECS runs in EC2
• Still needs at
least two
instances to
ensure 99.95%
availability
• Better utilization
• Must still manage
server, OS
(monitoring,
patching,
logging,…), but
less work with
Docker
Web Server
ECS ELB Dynamo
DB Route53
Static Content
AutoScaling Group
Browser
With ECS
![Page 12: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/12.jpg)
With Lambda
Dynamo
DB
API
Gateway
Static Content
Browser Lambda
• Automatically
triggered – No
need to maintain
two EC2s running
all time
• Best utilization
• Cheaper in many
circumstances
(e.g. rarely visited
web site)
![Page 13: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/13.jpg)
Sample Code
![Page 14: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/14.jpg)
So why serverless?
Advantages:
To maintain no server is easier than to maintain some
servers
Less thing to manage is generally a good thing
Higher utilization
Lower cost (in many circumstances)
Simpler design due to integration with other cloud
services
Modern best practice: Micro/nanoservice, DevOps…
![Page 15: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/15.jpg)
So why (not) serverless?
Disadvantages:
Lock-in (somewhat remediated by framework such as
Serverless)
Limits (e.g. 5 minute processing time, only natively
support Go)
New technology, so the ecosystem around serverless is
not mature
![Page 16: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/16.jpg)
How do we apply serverless?
Design an application to use cloud backend as a
services (e.g. Kinesis, Aurora,…)
Use cloud function as a services to glue those backend
together
Large number of serverless functions will require a
framework
Stateless, Microservice, Nanoservice, DevOps/NoOps
![Page 17: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/17.jpg)
How do we apply serverless? (cont.)
Serverless means stateless
Time is money precompile and optimize your code
Can leverage existing artifacts, but don’t count on their
existence
End graciously
Use alias and versioning
![Page 18: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/18.jpg)
Is the future serverless?
Yes
![Page 19: ContainerDayVietnam2016: Serverless & Current Trends](https://reader037.fdocuments.in/reader037/viewer/2022100723/58efd9df1a28abf0748b45c9/html5/thumbnails/19.jpg)
Appendix
• http://docs.aws.amazon.com/l
ambda/latest/dg/getting-
started.html
• https://aws.amazon.com/blogs
/compute/category/aws-
lambda/
• http://www.allthingsdistributed.
com/2016/06/aws-lambda-
serverless-reference-
architectures.html