28
Serverless With Azure Functions Dec 3 rd 2016 Vivek. P.S Vivek. P.S http://vivekcek.wordpress.com

Azure functions

Embed Size (px)

Citation preview

Page 1: Azure functions

Serverless With Azure FunctionsDec 3rd 2016

Vivek. P.S

Vivek. P.S

http://vivekcek.wordpress.com

Page 2: Azure functions

Vivek P.SSystem Analyst @ Ust GlobalTech Evangelist Blogger

http://[email protected]

Page 3: Azure functions

Agenda• Why Serverless?• What is serverless? • Intro Azure Functions• Serverless patterns / Real-world examples

Page 4: Azure functions

Before cloud

On-PremiseCo-Lo

Page 5: Azure functions

Before cloud

How many servers do I need?

Which OS should I use?

How often should I patch my servers?

What size of servers

should I buy?

How often should I backup

my server?

How can I increase server utilization?

How I deploy new code to my server?

Which packages should be on my server?

It takes how long to provision a new server?

Are my server in a

secure location?

What happens if

the

power goes out?Do I n

eed secondary

network connection?

What is th

e right si

ze of

servers for m

y business n

eeds?

Who has physical

access to my servers?

Do I need a UPS?

What media should I

use to keep backup?

What storage I need to use?

How I scale my app?

What happens in case of

server hardware failure?

How can I d

ynamically

configure my app?

Who monitors

my Servers?Who monitors

my App?

Page 6: Azure functions

Then came IaaS …

How many servers do I need?

Which OS should I use?

How often should I patch my servers?

What size of servers

should I buy?

How often should I backup

my server?

How can I increase server utilization?

How I deploy new code to my server?

Which packages should be on my server?

It takes how long to provision a new server?

Are my server in a

secure location?

What happens if

the

power goes out?Do I n

eed secondary

network connection?

What is th

e right si

ze of

servers for m

y business n

eeds?

Who has physical

access to my servers?

Do I need a UPS?

What media should I

use to keep backup?

What storage I need to use?

How I scale my app?

What happens in case of

server hardware failure?

How can I d

ynamically

configure my app?

Who monitors

my Servers?Who monitors

my App?

Page 7: Azure functions

Is it PaaS time?

How many servers do I need?

Which OS should I use?

How often should I patch my servers?

How often should I backup

my server?

How can I increase server utilization?

How I deploy new code to my server?

Which packages should be on my server?

What is th

e right si

ze of

servers for m

y business n

eeds?

How I scale my app?

How can I d

ynamically

configure my app?

Who monitors

my App?

Page 8: Azure functions

Is it PaaS time?

How many servers do I need?

Which OS should I use?

How often should I patch my servers?

How often should I backup

my server?

How can I increase server utilization?

How I deploy new code to my server?

Which packages should be on my server?

What is th

e right si

ze of

servers for m

y business n

eeds?

How I scale my app?

How can I d

ynamically

configure my app?

Who monitors

my App?

Page 9: Azure functions

Serverless . . .

How many servers do I need?

How can I increase server utilization?What is

the rig

ht size of

servers for m

y business n

eeds?

How I scale my app?

Page 10: Azure functions

Event-driven/ instant scale

Sub-second billing

Abstraction of

servers

What is Serverless?

Page 11: Azure functions

Focus on Business

LogicReduced Time To Market

Reduced DevOps

Benefits of Serverless?

Page 12: Azure functions

Application’s evolution

Ship.

Acct. Mang.

Hist.

Database

Client

Ship.

DB

Client

Hist.

DB

Mang.

DB

Acct.

DB

POST

GET

POST

UPDATE

Monolithic Microservices

Page 13: Azure functions

Application’s evolution

Ship.

Acct. Mang.

Hist.

Database

Client

Monolithic

Ship.

DB

Client

Hist.

DB

Mang.

DB

Acct.

DB

POST

GET

POST

UPDATE

Microservices

Page 14: Azure functions

Application’s evolution

Ship.

DB

Client

Hist.

DB

Mang.

DB

Acct.

DB

POST

GET

POST

UPDATE

Microservices

Page 15: Azure functions

Application’s evolution

Client Mang.

DB

Microservices

POST Users

Users/Id

Users/Id

Users/Id

CreatUser

GetUser

UpdateUser

DeleteUser

GET

UPDATE

DELETE

Serverless

Page 16: Azure functions

Azure FunctionsProcess events with Serverless code.

Make composing Cloud Apps insanely easyDevelop Functions in C#, Node.js, F#, Python, PHP, Batch and more Easily schedule event-driven tasks across servicesExpose Functions as HTTP API endpointsScale Functions based on customer demandEasily integrate with Logic Apps

Code Events + dataAzure Functions

Page 17: Azure functions

Functions Hello WorldDemo

Page 18: Azure functions

Functions Programming ModelTrigger(data) Input Input

code

Output

Output

• Function as a single unit of work• Functions are executed per trigger • Functions have inputs and outputs

Input

Page 19: Azure functions

Triggers and

bindings

Page 20: Azure functions

Functions Programming Model - Best Practices• Functions should “do one thing”• Functions should be stateless• Functions should be idempotent• Functions should finish as quickly as possible

1

Page 21: Azure functions

Serverless Patterns

Page 22: Azure functions

Every 15 minutes Clean tableFind and clean invalid data

ApplicationsExample: Timer based processing

Page 23: Azure functions

File added toBlob Storage

Transform CSV to datarows Power BIChart graphic

ApplicationsExample: Azure service event processing

Page 24: Azure functions

Photo taken andWebHook called Stores in blob storage Produces scaled images

Async background processingExample: Serverless Mobile back ends

Page 25: Azure functions

Loaded web pagecallsWebHook

Completed pageCreate ad based on user profile

ApplicationsExample: Serverless Web Applications architectures

Page 26: Azure functions

Millionsof devices feedinto Stream Analytics

Store data inSQL Online

Transform to structured data

ApplicationsExample: Real-time stream processing

Page 27: Azure functions

Microsoft and ServerlessTry Functions – https://functions.azure.comTry App Service – https://tryappservice.azure.com

Page 28: Azure functions