74
David Pallmann GM Custom App Dev, Neudesic http://davidpallmann.blogspot.com @davidpallmann

When worlds collide html5 meets the cloud

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: When worlds collide html5 meets the cloud

David Pallmann GM Custom App Dev, Neudesic http://davidpallmann.blogspot.com @davidpallmann

Sheena.Graham
Stamp
Page 2: When worlds collide html5 meets the cloud

2 Revolutions The HTML5 revolution The Cloud revolution Interactions & Synergies Walkthrough: Creating a Mobile & Global App

Page 3: When worlds collide html5 meets the cloud

Front-End Back-End

Page 4: When worlds collide html5 meets the cloud

Front-End

HTML5 Lingua franca for desktop &

mobile web applications

Mobility Tablets and phones

Power More capable

devices & browser h/w acceleration

Experiences Compelling, touch-oriented experiences

Page 5: When worlds collide html5 meets the cloud

Web just keeps growing in importance Rising experiences & expectations On our devices Social Everywhere Part of our lifestyle

Page 6: When worlds collide html5 meets the cloud

Web just keeps growing in importance Rising experiences & expectations On our devices Social Everywhere Part of our your customers’ & employees’ lifestyle

Page 7: When worlds collide html5 meets the cloud
Page 8: When worlds collide html5 meets the cloud

HTML5 CSS3 JavaScript SVG 100+!

Page 9: When worlds collide html5 meets the cloud

Video & Audio without plugins Canvas & Scalable Vector Graphics w/o plugins New semantic tags Geolocation CSS3, including custom fonts, rounded corners Drag and drop Canvas – 2D drawing, WebGL – 3D graphics New form elements HTML manifest (app caching) & offline storage Hardware acceleration in modern browsers

Page 11: When worlds collide html5 meets the cloud

Angry Birds

Joy Defines the Future (BMW)

Canvas Mol

public online HTML5 sites

Tron Legacy

Page 12: When worlds collide html5 meets the cloud

Source: Shutterstock.com #86494345

Source: Shutterstock.com #72009739

Page 13: When worlds collide html5 meets the cloud
Page 14: When worlds collide html5 meets the cloud

Unified mobile development accounts for much of the HTML5 momentum 327M wireless devices in US CTIA Wireless Association

1 billion wireless devices worldwide iSuppli

IDC: wireless web will outpace desktop web by 2015 Computerworld

Responsive web design: adaptive, fluid layout Mobile-first design, progressive enhancement

Page 15: When worlds collide html5 meets the cloud

A Compelling Experience compelling • immersive • multimedia animated • interactive • responsive Relevant to Your Life integrates with social networks • uses location Ubiquitous runs on PC browser, tablet, phone adaptive layout • touch, mouse or keyboard Maintains Continuity use multiple devices • identity • state • data Constant Availability disconnected operation • sync

Page 16: When worlds collide html5 meets the cloud

http://www.astronautdesigns.com/demo/responsive/

works on tablets

works on phones

Page 17: When worlds collide html5 meets the cloud

Cloud Computing Elastic scale,

consumption-based pricing

Social Social network content, interactions & web identity

CDNs Content Delivery

Networks

Marketplaces App stores, data marketplaces

Back-End

Page 18: When worlds collide html5 meets the cloud

vs.

Page 19: When worlds collide html5 meets the cloud

Elastic Scale Consumption-based Pricing Commitment-free / Easy-in, Easy-out Self-serve / On-demand Managed / Platform-as-a-Service Application & Data Protected through Redundancy 3 9’s SLA (99.9%)

Page 20: When worlds collide html5 meets the cloud

App Clouds

Data Clouds

Media Clouds

Social Clouds

Page 21: When worlds collide html5 meets the cloud

Elastic Scale scale larger/smaller as needed Universal worldwide presence • universal access can run in multiple data centers • CDN Highly Available redundancy • resilient • failover Decentralized distributed • combine multiple services lessened emphasis on locking / transactions

Page 22: When worlds collide html5 meets the cloud
Page 23: When worlds collide html5 meets the cloud

Service Role in a Modern Web Solution

Windows Azure Compute Hosting of web servers

Windows Azure Blob Storage Media (images, video) & other file storage

Windows Azure Table Storage Server-side storage of data / session state

SQL Azure Database Server-side storage of relational data

Windows Azure Traffic Manager Traffic routing across multiple deployments

Content Delivery Network Use of edge cache network to serve content

Cache Service Server-side performance improvements

SQL Azure Data Sync Data sync across multiple deployments

Access Control Service Identity federation

Service Bus Back end processing / integration

Windows Azure Connect Cloud-Enterprise connectivity

Page 24: When worlds collide html5 meets the cloud

Front-End Back-End

Page 25: When worlds collide html5 meets the cloud

I can use a traditional or HTML5 front-end

here

I can use a traditional or cloud back-end

here

Page 26: When worlds collide html5 meets the cloud

DEDICATED BACK END

Web Services

Web Application

IIS

SQL Server DESKTOP

BROWSER

WEB SERVER

Windows Server

DATABASE SERVER

HOMOGENOUS FRONT END

Page 27: When worlds collide html5 meets the cloud

DECENTRALIZED BACK END

Business Services

Application

TABLET

CLOU

D

HETEROGENEOUS FRONT END

DESKTOP BROWSER

PHONE

Identity Services

IP

Data Stores

Platform Services

Directories

Partner Services

PARTNER

Data Stores

Page 28: When worlds collide html5 meets the cloud

Client-Server Coordination Data Storage Identity State Management Synchronization Caching Location Social

Page 29: When worlds collide html5 meets the cloud

Elasticity Location Social

Page 30: When worlds collide html5 meets the cloud

VM VM VM VM VM

Page 31: When worlds collide html5 meets the cloud
Page 32: When worlds collide html5 meets the cloud

http://outsidetheboxpizza.com

Page 33: When worlds collide html5 meets the cloud

Mobility gives us location independence: take the web with you Mobile web apps can use your current location Map integration

Page 34: When worlds collide html5 meets the cloud

Content Delivery Network serves content efficiently based on locale Traffic Manager routes users to a deployment based on locate

Page 35: When worlds collide html5 meets the cloud

http://responsive-tours.com

Page 36: When worlds collide html5 meets the cloud

Notifications View Content Post Content

Page 37: When worlds collide html5 meets the cloud

Sign-in with web provider Identity federation (Access Control Service) Back-end social network integration

Page 38: When worlds collide html5 meets the cloud

Outside-the-box-Pizza: client-side social Responsive Tours: server-side social identity

Page 39: When worlds collide html5 meets the cloud
Page 40: When worlds collide html5 meets the cloud

1 Design Comps Adobe Creative Suite HTML5, CSS, Media Responsive Web Design

2 Web Platform Neudesic Web Template Client: Open Standards Server: MS Web Platform 3 Integrate

Dynamic Content DB / Storage Data Binding Map Integration

4 Cloud-Ready Windows Azure Web Role / Instances Local Dev/Test

7 Global Worldwide Deployment Multiple Data Centers Traffic Management

5 Secured Single Sign-on Web / Domain ID

6 Deployed Elastic Scale Azure Data Center

AZURE WEB ROLE

Page 41: When worlds collide html5 meets the cloud

1 Design Design Web Site Front-end & Create Assets

1A. Used an Adobe Dreamweaver HTML5 sample already set up for Responsive Web Design

Page 42: When worlds collide html5 meets the cloud

1 Design Design Web Site Front-end & Create Assets

1A. Used an Adobe Dreamweaver HTML5 sample already set up for Responsive Web Design

Page 43: When worlds collide html5 meets the cloud

1 Design Design Web Site Front-end & Create Assets

1B. Customize Content in Dreamweaver – Page Title, Logo, Marquee Text,

Page 44: When worlds collide html5 meets the cloud

1 Design Design Web Site Front-end & Create Assets

1B. Customize Content in Dreamweaver – Page Title, Logo, Marquee Text,

Page 45: When worlds collide html5 meets the cloud

1 Design Design Web Site Front-end & Create Assets

1C. Hand-off to developer – assets are HTML5, CSS, JavaScript, image files

Page 46: When worlds collide html5 meets the cloud

2 Adapt Template-based Web Project

2A. Create Project from Neudesic Web Template

Page 47: When worlds collide html5 meets the cloud

2 Adapt Template-based Web Project

2B. Insert front-end markup/styling/code/images from designer

• Move where some files are to match the templates organization

• Change paths in the HTML and CSS to match file relocation and use ASP.NET ~ path convention

• Segment HTML and insert into appropriate areas of the home view (Index.cshtml)

Page 48: When worlds collide html5 meets the cloud

2 Adapt Template-based Web Project

2B. Insert front-end markup/styling/code/images from designer

@* Optional : Include additional stylesheets *@ @section StylesTop { <link rel="stylesheet" type="text/css" href="~/../css/stylesheet.css" /> <link rel="stylesheet" type="text/css" media="only screen and (min-width:50px) and (max-width:550px)" href="~/../css/screen_small.css"> <link rel="stylesheet" type="text/css" media="only screen and (min-width:551px) and (max-width:800px)" href="~/../css/screen_medium.css"> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <link rel="stylesheet" type="text/css" href="~/../css/stylesheet_ie.css" /> <![endif]--> }

Page 49: When worlds collide html5 meets the cloud

2 Adapt Template-based Web Project

2C. Final result is a web project we can run out of VS2010 with F5 – looks no diff from Step 1

Page 50: When worlds collide html5 meets the cloud

3 Integrate Add Dynamic Content

3A. Create a Database for Promotional Data

Page 51: When worlds collide html5 meets the cloud

3 Integrate Add Dynamic Content

3B. Retrieve Content in the MVC Project

public class HomeController : Controller { // // GET: /Home/ public ActionResult Index() { LoadPromos(); return View(); } private void LoadPromos() { Dictionary<string, Promo> Promos = new Dictionary<string, Promo>(); try { using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager .ConnectionStrings["Tours"].ConnectionString)) { ...get the data, add to Promos collection... } } catch (SqlException ex) { // TODO: log exception } ViewBag.Promos = Promos; } }

public class Promo { public string Title; public string Text; public string ImageURL; }

Page 52: When worlds collide html5 meets the cloud

3 Integrate Add Dynamic Content

3C. Embed Content with Razor

<!-- begin - homepage promos --> <div class="home_promo_container"> <div class="home_promo"> <div class="home_promo_content" style="background-image:url(images/@(ViewBag.Promos["1"].ImageURL));"> <h2 data-bind="text: PromoTitle1"></h2> <p data-bind="text: PromoText1"/> <a class="button" href="#">Learn more &raquo;</a> </div> </div> <div class="home_promo"> <div class="home_promo_content" style="background-image:url(images/@(ViewBag.Promos["2"].ImageURL));"> <h2 data-bind="text: PromoTitle2"></h2> <p data-bind="text: PromoText2"/> <a class="button" href="#">Learn more &raquo;</a> </div> </div> <div class="home_promo"> <div class="home_promo_content" style="background-image:url(images/@(ViewBag.Promos["3"].ImageURL));"> <h2 data-bind="text: PromoTitle3"></h2> <p data-bind="text: PromoText3"/> <a class="button" href="#">Learn more &raquo;</a> </div> </div> </div>

Page 53: When worlds collide html5 meets the cloud

3 Integrate Add Dynamic Content

3C. Data Bind with Knockout

<!-- begin - homepage promos --> <div class="home_promo_container"> <div class="home_promo"> <div class="home_promo_content" style="background-image:url(images/@(ViewBag.Promos["1"].ImageURL));"> <h2 data-bind="text: PromoTitle1"></h2> <p data-bind="text: PromoText1"/> <a class="button" href="#">Learn more &raquo;</a> </div> </div> <div class="home_promo"> <div class="home_promo_content" style="background-image:url(images/@(ViewBag.Promos["2"].ImageURL));"> <h2 data-bind="text: PromoTitle2"></h2> <p data-bind="text: PromoText2"/> <a class="button" href="#">Learn more &raquo;</a> </div> </div> <div class="home_promo"> <div class="home_promo_content" style="background-image:url(images/@(ViewBag.Promos["3"].ImageURL));"> <h2 data-bind="text: PromoTitle3"></h2> <p data-bind="text: PromoText3"/> <a class="button" href="#">Learn more &raquo;</a> </div> </div> </div>

Page 54: When worlds collide html5 meets the cloud

3 Integrate Add Dynamic Content

3C. Data Bind with Knockout

<!-- begin - homepage promos --> <div class="home_promo_container"> <div class="home_promo"> <div class="home_promo_content" style="background-image:url(images/@(ViewBag.Promos["1"].ImageURL));"> <h2 data-bind="text: PromoTitle1"></h2> <p data-bind="text: PromoText1"/> <a class="button" href="#">Learn more &raquo;</a> </div> </div> <div class="home_promo"> <div class="home_promo_content" style="background-image:url(images/@(ViewBag.Promos["2"].ImageURL));"> <h2 data-bind="text: PromoTitle2"></h2> <p data-bind="text: PromoText2"/> <a class="button" href="#">Learn more &raquo;</a> </div> </div> <div class="home_promo"> <div class="home_promo_content" style="background-image:url(images/@(ViewBag.Promos["3"].ImageURL));"> <h2 data-bind="text: PromoTitle3"></h2> <p data-bind="text: PromoText3"/> <a class="button" href="#">Learn more &raquo;</a> </div> </div> </div>

Page 55: When worlds collide html5 meets the cloud

3 Integrate Add Dynamic Content

3D. Site with Data Binding

Page 56: When worlds collide html5 meets the cloud

4 Cloud-Ready Set up for Windows Azure – Local Test/Dev in Simulator

4A. Add Windows Azure Project

Page 57: When worlds collide html5 meets the cloud

4 Cloud-Ready Set up for Windows Azure – Local Test/Dev in Simulator

4B. Set Instance Counts

<?xml version="1.0" encoding="utf-8"?> <ServiceConfiguration serviceName="ResponsiveSiteAzure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="1" osVersion="*"> <Role name="ResponsiveSite"> <Instances count="4" /> <ConfigurationSettings> <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" /> </ConfigurationSettings> </Role> </ServiceConfiguration>

Page 58: When worlds collide html5 meets the cloud

4 Cloud-Ready Set up for Windows Azure – Local Test/Dev in Simulator

4C. Run locally in Windows Azure Simulation Environment

Page 59: When worlds collide html5 meets the cloud

5 Secured Sign-in with web Identities

5A. Configure Access Control Service in Windows Azure

Page 60: When worlds collide html5 meets the cloud

5 Secured Sign-in with web Identities

5B. Instrument for identity with Windows Identity Foundation

Page 61: When worlds collide html5 meets the cloud

5 Secured Sign-in with web Identities

5B. Instrument for identity with Windows Identity Foundation

Page 62: When worlds collide html5 meets the cloud

5 Secured Sign-in with web Identities

5C. Retrieve Claims

private void LoadClaims() { ViewBag.Welcome = "Welcome Back!"; var principal = Thread.CurrentPrincipal; var identity = principal.Identity as IClaimsIdentity; var claims = identity.Claims; ViewBag.Claims = claims; string displayName = null; if (claims != null) { string claimType; foreach (Claim claim in claims) { claimType = claim.ClaimType; if (claimType.EndsWith("/nameidentifier")) { displayName = claim.Subject.Name; break; } } if (!String.IsNullOrEmpty(displayName)) { ViewBag.Welcome = "Welcome back, " + displayName; } } }

Page 63: When worlds collide html5 meets the cloud

6 Deployed Deployed to Windows Azure Data Center

6A. Move Promotional Item Images to Blob Storage

http://responsive.blob.core.windows.net/images/homepage_promo_1.jpg http://responsive.blob.core.windows.net/images/homepage_promo_2.jpg http://responsive.blob.core.windows.net/images/homepage_promo_3.jpg

Page 64: When worlds collide html5 meets the cloud

6 Deployed Deployed to Windows Azure Data Center

6B. Change Promotional Image URLs to use Blob Storage

<div class="home_promo_content" style="background-image:url( http://responsive.blob.core.windows.net/images/@(ViewBag.Promos["1"].ImageURL) );">

Page 65: When worlds collide html5 meets the cloud

6 Deployed Deployed to Windows Azure Data Center

6C. Package and Publish

Page 66: When worlds collide html5 meets the cloud

6 Deployed Deployed to Windows Azure Data Center

6D. Access in the Cloud at http://responsive.cloudapp.net

Page 67: When worlds collide html5 meets the cloud

7 Global Deployed Globally to US and Hong Kong with Traffic Management

7A. Turn on CDN

Page 68: When worlds collide html5 meets the cloud

7 Global Deployed Globally to US and Hong Kong with Traffic Management

7B. Change Promotion Item Image URLs to use CDN URL Prefix

<div class="home_promo_content" style="background-image:url( http://az99258.vo.msecnd.net/images/@(ViewBag.Promos["1"].ImageURL) );">

Page 69: When worlds collide html5 meets the cloud

7 Global Deployed Globally to US and Hong Kong with Traffic Management

7C. Deploy to Multiple Data Centers

Page 70: When worlds collide html5 meets the cloud

7 Global Deployed Globally to US and Hong Kong with Traffic Management

7D. Manage Traffic

Page 71: When worlds collide html5 meets the cloud

7 Global Deployed Globally to US and Hong Kong with Traffic Management

7E. Access at http://responsive-tours.com (http://responsive.ctp.trafficmgr.com)

Friendly Domain http://responsive-tours.com

Windows Azure Traffic Manager http://responsive.ctp.trafficmgr.com

South Central US http://responsive-us

.cloudapp.net

East Asia http:// responsive-asia

.cloudapp.net

Windows Azure Access Control Service Web Identity Sign-in

Western Europe http://responsive-europe

.cloudapp.net

Page 72: When worlds collide html5 meets the cloud

http://responsive-tours.com

7 Global Deployed Globally to US and Hong Kong with Traffic Management

Page 73: When worlds collide html5 meets the cloud

8-Part Tutorial http://davidpallmann.blogspot.com/2011/12/mobile-global-in-7-steps-with-html5-mvc.html Source Code on CodePlex http://responsivetours.codeplex.com Online Demo http://responsive-tours.com

Page 74: When worlds collide html5 meets the cloud

David Pallmann GM Custom App Dev, Neudesic http://davidpallmann.blogspot.com @davidpallmann