In this session, Travis will explore what exactly Serverless infrastructure is, and more importantly how you can build ASP.NET Core applications to take advantage of its low cost and infinite scalability. The following topics will be covered:
- What is Serverless Computing?
- Evolution of Compute
- Advantages and Pitfalls of Serverless Infrastructure
- AWS Lambda
- .NET Core on AWS Lambda
- ASP.NET Core MVC on AWS Lambda / API Gateway
From Toronto .NET Meetup Session: https://www.meetup.com/Toronto-NET-Meetup/events/237920730/
2. 2
OVERVIEW
What is Serverless?
“Does that mean there are no servers?”
.NET Core on Serverless
AWS Lambda and other Serverless Components
ASP.NET Core MVC on AWS Lambda
Dealing with code granularity and using vendor abstractions
5. “Serverless architectures refer to applications
that significantly depend on third-party services
("BaaS") or on custom code that's run in
ephemeral containers ("FaaS")”.
Martin Fowler
Programmer, Loud Mouth, Thought Worker
5
6. “Serverless Computing is like this - Your code, a
slider bar, and your credit card. You just have your
function out there and it will scale as long as you can pay
for it. It's as close to "cloudy" as The Cloud can get.”
Scott Hanselman
Microsoft
6
7. WHAT IS SERVERLESS?
7
Serverless: First used to describe continuous integration and source control
servers in “the cloud” (around 2010?).
SaaS Why Do I Care?
• No Servers Provision or Manage
• Never Pay for Idle or “Always On”
• Infinite, Automatic Scaling
• ITS CHEAPER!
8. EVOLUTION OF INFRASTRUCTURE
8
“A Spectrum of Compute”
Unit of
Scale
Packaging Execution Run Time Cost
VMs Machine Images Multi-threaded Hours to
months
Per VM / Hour
Containers Application Container File Multi-threaded,
single task
Minutes to
days
Per VM / Hour
Serverless Function Code Single-thread,
single-task
Micro-seconds
to seconds
Per Memory /
Second /
Request
AWS Re:invent 2016 – Werner Vogels
12. SERVERLESS IS “NOT
ONE SIZE FITS ALL”!
12
Mobile Backend
Static Websites
Event / Data Processing
Scheduled Tasks
Microservices!
13. “Serverless will Eat Containers in the Microservices world.”
13
“What's Better Than Microservices?
Serverless Microservices!”
14. DEMO
AWS LAMBDA with ASP.NET CORE MVC (WEB API)
14
/api/test1
/api/test2
/api/test3
API
Gateway
Proxy
Function
API GATEWAY
PROXY +ANY
GET /API/TEST1 JSON PAYLOAD
AWS SAM CLOUD FORMATION
YOUR CODE