how far can ‘serverless’ actually go? - alex mang

26
@ITCAMPRO #ITCAMP17 Community Conference for IT Professionals How Far Can ‘Serverless’ Actually Go? Alex Mang Azure MVP @mangalexandru

Upload: itcamp

Post on 18-Mar-2018

317 views

Category:

Technology


0 download

TRANSCRIPT

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

How Far Can ‘Serverless’ Actually Go?

Alex Mang

Azure MVP

@mangalexandru

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

Many thanks to our sponsors & partners!

GOLD

SILVER

PARTNERS

PLATINUM

POWERED BY

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

Alex Mang

• Azure MVP

• Azure Advisor

• MCSE, MCSD

• PSM

@mangalexandru

www.alexmang.com

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

source: Microsoft Build 2017, B8039

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

Long, long ago, in a cloud-less land…

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

Then a wild IaaS appeared…

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

… and a PaaS!

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

…and so did serverless!

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

Scaling happens at the lowest unit a service understands

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

There is only one LIMIT!

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

What is ‘serverless’?

Event-driven/ instant scale

Micro-billingAbstraction of servers

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

‘Serverless’ is *AWESOME*!

Focus on Business

Logic

Reduce Time-To-Market

Reduce DevOps

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

WHAT ABOUT AZURE FUNCTIONS?

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

• Process events with Serverless code

–Make composing Cloud Apps insanely easy

–Develop Functions in C#, Node.js, F#, Python,

PHP, Batch and more

–Easily schedule event-driven tasks across

services

–Expose Functions as HTTP API endpoints

–Scale Functions based on customer demand

–Easily integrate with Logic Apps

Azure Functions

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

• Respond to any event

• Develop your way

• Integrated DevOps

• Pay for what you use

• Fully open source

Azure Functions

NO RUNTIME

OPTIMIZATION

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

Light-weight CPU Intensive Tasks

run.cmd, run.bat run.exe run.ps1 run.sh run.php run.py run.js

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

function.json

"bindings": [{

"type": "httpTrigger","direction": "in","webHookType": "genericJson","name": "req"

},{

"type": "http","direction": "out","name": "res"

},{

"type": "queue","name": "eventOutput","queueName": "aievents1","connection":"AiStorageConnection","direction": "out"

}]

public static class OrderHandler{

[FunctionName("OrderWebhook")]public static async Task<HttpResponseMessage> Run(

[HttpTrigger] HttpRequestMessage req,[Queue("aievents1", Connection = "AiStorageConnection")]

IAsyncCollector<String> eventOutput,TraceWriter log)

{log.Info($"Webhook was triggered!");

string jsonContent = await req.Content.ReadAsStringAsync();dynamic data = JsonConvert.DeserializeObject(jsonContent);

await eventOutput.AddAsync(JsonConvert.SerializeObject(GetLogData(data)));

int orderId = PlaceOrder(data);

return req.CreateResponse(HttpStatusCode.OK, new {orderNumber = orderId });

}

. . .}

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

• Functions should “do one thing”

• Functions should be idempotent

• Functions should finish as quickly as

possible

Architectural best practices

1

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

DEMO

Alex Mang

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

Azure Functions Runtime Preview

https://aka.ms/azafr

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

• Developer experience

–Same consistent Programming Model

–Same Azure Functions portal

–Publish directly from Visual Studio tooling

– Leverage triggers: timer trigger and new SQL Service

Broker trigger

Azure Functions Runtime

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

• Administrator features

–Take advantage of Azure Functions on premises

• Workers can run in spare compute – i.e. desktops left on

overnight within orgs

–Only provision two types of roles

• Management Role – Hosts Portal, Publishing Endpoint and

• Worker Role – Runs Function in Windows Server Containers

Azure Functions Runtime (cont’d)

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

DEMO

Alex Mang

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals

Q & A

@mangalexandru

www.alexmang.com

@ITCAMPRO #ITCAMP17Community Conference for IT Professionals