brewing beer with windows azure - ndc2013

60
Brewing Beer with Windows Azure Maarten Balliauw @maartenballiauw

Upload: maarten-balliauw

Post on 19-May-2015

798 views

Category:

Technology


0 download

DESCRIPTION

Inspired by one of the Windows Azure gods (Wade Wegner), Maarten and Panos decided to order a homebrewing starter kit. Being total cloud fanboys, they decided to hook their delicious creations to the cloud. Join us and discover how you can connect a variety of devices (like *duino) and USB temperature sensors to Windows Azure to monitor brewing and fermentation temperatures. We'll show you how to do distributed brewing in this fun yet practical session on an interesting use case for the cloud: beer.

TRANSCRIPT

Page 1: Brewing Beer with Windows Azure - NDC2013

Brewing Beerwith Windows AzureMaarten Balliauw@maartenballiauw

Page 2: Brewing Beer with Windows Azure - NDC2013

Who am I? Maarten Balliauw

Technical Evangelist, JetBrains

AZUG

Focus on web ASP.NET MVC, Windows Azure, SignalR, ... MVP Windows Azure & ASPInsider

http://blog.maartenballiauw.be

@maartenballiauw

Shameless self promotion: Pro NuGet - http://amzn.to/pronuget

http://www.myget.org

Page 3: Brewing Beer with Windows Azure - NDC2013

Setting expectations

Page 4: Brewing Beer with Windows Azure - NDC2013
Page 5: Brewing Beer with Windows Azure - NDC2013
Page 6: Brewing Beer with Windows Azure - NDC2013
Page 7: Brewing Beer with Windows Azure - NDC2013

Agenda Brewing beer

BrewBuddy

Windows Azure Websites

Service Bus & Access Control Service (ACS)

We need an API

Q&A

Page 8: Brewing Beer with Windows Azure - NDC2013

Brewing BeerTurn water into beer

Page 9: Brewing Beer with Windows Azure - NDC2013

How it started…

Page 10: Brewing Beer with Windows Azure - NDC2013

How it started… MVP Summit 2011 Wade Wegner talks about his homebrewing hobby

MVP Summit 2012 Wade Wegner talks about his homebrewing hobby

Let’s do it!

Page 11: Brewing Beer with Windows Azure - NDC2013

The process

Get your kettle clean Add & boil ingredients Pour in kettle Add yeast Rinse

Page 12: Brewing Beer with Windows Azure - NDC2013

Brewing = cleaning!

Page 13: Brewing Beer with Windows Azure - NDC2013

The process

Wait for fermentation to complete

Page 14: Brewing Beer with Windows Azure - NDC2013

The process

Pour into another kettle Rinse Wait another week Bottling time!

Page 15: Brewing Beer with Windows Azure - NDC2013

Difficult part…

Wait at least 6 weeks for it to age

Page 16: Brewing Beer with Windows Azure - NDC2013
Page 17: Brewing Beer with Windows Azure - NDC2013

Maarten…

What does this haveto do with Windows Azure?

Page 18: Brewing Beer with Windows Azure - NDC2013

BrewBuddy.netSocial brewing!

Page 19: Brewing Beer with Windows Azure - NDC2013

BrewBuddy View public recipes

Manage your own recipes

Manage your own brews

Monitor brew fermentation

Page 20: Brewing Beer with Windows Azure - NDC2013

dem

o

BrewBuddySocial brewing at a glance

Page 21: Brewing Beer with Windows Azure - NDC2013

ArchitecturePublic websiteWindows Azure Web Sites

DatabaseSQL Azure database

Sensor data processingWindows Azure Worker Role

Sensor dataService Bus topic

SensorWhatever…

Page 22: Brewing Beer with Windows Azure - NDC2013

Windows AzureWeb SitesScale fast, fail fast

Page 23: Brewing Beer with Windows Azure - NDC2013

Windows Azure Web Sites

Build with ASP.NET, Node.js or PHP Deploy in seconds with FTP, Git or

TFS Start for free, scale up as your

traffic grows

Page 24: Brewing Beer with Windows Azure - NDC2013

1SHARED INSTANCES

:-)

sharedWindows Azure Web Sites

Page 25: Brewing Beer with Windows Azure - NDC2013

2SHARED INSTANCES

:-)

:-)

sharedWindows Azure Web Sites

Page 26: Brewing Beer with Windows Azure - NDC2013

SHARED INSTANCES

:-)

1RESERVED INSTANCE

:-):-)

0reserved

Windows Azure Web Sites

Page 27: Brewing Beer with Windows Azure - NDC2013

2RESERVED INSTANCE

:-)

RESERVED INSTANCE

:-)

reserved

Windows Azure Web Sites

Page 28: Brewing Beer with Windows Azure - NDC2013

2RESERVED INSTANCE

:-)

RESERVED INSTANCE

:-):-)

:-) :-)

:-)

:-) :-)

reserved

Windows Azure Web Sites

Page 29: Brewing Beer with Windows Azure - NDC2013

A perfect ramp-up! Start small Web Sites are cheap Start free Scale from 1 shared instance… …up to 10 reserved instances!

Grow big! Hosted Service – PaaS Scale at will

Page 30: Brewing Beer with Windows Azure - NDC2013

dem

o

Windows AzureWeb SitesCreating a new web site in seconds

Page 31: Brewing Beer with Windows Azure - NDC2013

Service Bus &Access Control ServiceConnecting sensors

Page 32: Brewing Beer with Windows Azure - NDC2013

Windows Azure Service Bus 2 features Relay Queues, Topics, Subscriptions

Page 33: Brewing Beer with Windows Azure - NDC2013

Windows Azure Service Bus Relay

Client Service

relay

Page 34: Brewing Beer with Windows Azure - NDC2013

Topics and subscriptions

SensorBackendWorker

Page 35: Brewing Beer with Windows Azure - NDC2013

Characteristics Workers can scale independently

Workers can fail independently

Sensors connect to service bus directly No layer in between Cheaper

Page 36: Brewing Beer with Windows Azure - NDC2013

What about authN / authZ? Access Control Service to the rescue!

SB authenticates clients over ACS

ACS provides “Send” claim to sensor

Claims can be granted/revoked easily

Page 37: Brewing Beer with Windows Azure - NDC2013

dem

o

Access Control ServiceClaims for authZ on Service Bus

Page 38: Brewing Beer with Windows Azure - NDC2013

Public websiteWindows Azure Web Sites

DatabaseSQL Azure database

Sensor data processingWindows Azure Worker Role

Sensor managementAccess Control Service

Sensor dataService Bus topic

SensorWhatever…

Architecture

Page 39: Brewing Beer with Windows Azure - NDC2013

How do you link a sensor? Every sensor has its sensor ID

Add it as an identity to ACS

Grant a “Send” claim

Page 40: Brewing Beer with Windows Azure - NDC2013

dem

o

Linking a sensorto a brewRegistering a sensor with Access Control Service

Page 41: Brewing Beer with Windows Azure - NDC2013

We need an API

Page 42: Brewing Beer with Windows Azure - NDC2013

Consuming the web 2000-2008: Desktop browser

2008-2012: Mobile browser

2008-2012: iPhone and Android apps

2010-2014: Tablets, tablets, tablets

2014-2016: Your fridge (Internet of Things)

Page 44: Brewing Beer with Windows Azure - NDC2013

Twitter & FacebookBy show of hands

Page 45: Brewing Beer with Windows Azure - NDC2013

Make everyone API(as the French say)

Page 46: Brewing Beer with Windows Azure - NDC2013

What is an API? Software-to-Software interface

Contract between software and developers Functionalities, constraints (technical / legal) Programming

instructions and standards

Open services to other software developers (public or private)

Page 47: Brewing Beer with Windows Azure - NDC2013

Expose services to 3rd parties

Valuable

Flexible

Managed

Supported

Have a plan

Page 48: Brewing Beer with Windows Azure - NDC2013

Reach More Clients

Page 49: Brewing Beer with Windows Azure - NDC2013

ASP.NET Web API Part of ASP.NET MVC 4

Framework to build HTTP Services (REST)

Solid features Modern HTTP programming model Content negotiation (e.g. Xml, json, ...) Query composition (OData query support) Model binding and validation (conversion to .NET objects) Routes Filters (e.g. Validation, exception handling, ...) And more!

Page 50: Brewing Beer with Windows Azure - NDC2013

dem

o

Be detailed! Think about RFC 2324 (HTCPCP)

Page 51: Brewing Beer with Windows Azure - NDC2013

dem

o

ASP.NET Web APILet’s craft a quick API

Page 52: Brewing Beer with Windows Azure - NDC2013

A lot of public API’s…

“your API consumer isn’t really your user,but an application acting on behalf of a user”

(or: API consumer != user)

Page 53: Brewing Beer with Windows Azure - NDC2013

So they do this!

Page 54: Brewing Beer with Windows Azure - NDC2013

In our own API, authN / authZ API access using OAuth2

Access Control Service to the rescue!

Client authorized in BrewBuddy.net

Access/refresh tokens through ACS

Page 55: Brewing Beer with Windows Azure - NDC2013

What about authN / authZ?

Access Control ServiceAccess/Refresh Token

API Consumerclient_id and client_secret

BrewBuddy.netInitial authorization (yes/no)API implementation

authorize

register delegationaccess/refresh token

access API

Page 56: Brewing Beer with Windows Azure - NDC2013

dem

o

Access Control Service for API’sOAuth2 delegation

Install-Package WindowsAzure.Acs.Oauth2 -IncludePrerelease

Page 57: Brewing Beer with Windows Azure - NDC2013

Takeaways

Page 58: Brewing Beer with Windows Azure - NDC2013

Keep in mind… Web Sites start cheap / scale fast

Combine/grow at will (IaaS, PaaS, SaaS)

Service bus for asynchrony and scale

Access Control for devices

Web API & Access Control

Page 59: Brewing Beer with Windows Azure - NDC2013

Thank you!

http://blog.maartenballiauw.be

@maartenballiauw

http://amzn.to/pronuget

Page 60: Brewing Beer with Windows Azure - NDC2013