Sriram Krishnan Program Manager Microsoft Corporation ES03
Act I Architecture
Big, reliable, expensive machine
... <add name="TableStorageSessionStateProvider“ type= "Microsoft.Samples.ServiceHosting.AspProviders.TableStorageSession StateProvider" applicationName=“Foo” />
Default.aspx (Input + Making Coffee) LB
public partial class _Default : System.Web.UI.Page { protected void Button1_Click(object sender,EventArgs e) { var order = txtOrder.Text; ProcessOrder(order); } protected void ProcessOrder(string order) { //Make some coffee!... }
Default.aspx (Input) Windows Azure Queues LB Worker.cs (Make Coffee)
public partial class _Default : System.Web.UI.Page { protected void Button1_Click(object sender,EventArgs e) { var order = txtOrder.Text; QueueStorage qStore = QueueStorage.Create(_account); MessageQueue orderQ = qStore.GetQueue("OrderQueue"); orderQ.PutMessage(new Message(order)); }
public class WorkerRole : RoleEntryPoint { public override void Start() { QueueStorage qStore = QueueStorage.Create(_account); MessageQueue orderQ = qStore.GetQueue("OrderQueue"); while (true) { Message msg = orderQ.GetMessage(); if( msg != null) ProcessOrder(msg.ContentAsString()); } protected void ProcessOrder(string order) { //Make some coffee!... }
Use Windows Azure storage for valuable data
Recap
End of Act I
Act II Updates
Code vN Data vN
Code vN Data vN Code vN +1
Code vN Data vN Data vN+1
class Employee : TableStorageEntity { public Employee(string firstName, string lastName) : base(firstName, lastName) //partition key, row key {} public string JobTitle { get; set; } }... var qResult = from emp in svc.CreateQuery (EmployeeDataServiceContext.EmployeeTable) where emp.PartitionKey == "Steve" && emp.RowKey == "Marx select emp; }
class Employee : TableStorageEntity { public Employee(string firstName, string lastName) : base(firstName, lastName) {} public string JobTitle { get; set; } public int Version { get; set; } }... var qResult = from emp in svc.CreateQuery (EmployeeDataServiceContext.EmployeeTable) where emp.PartitionKey == "Steve" && emp.RowKey == "Marx && emp.Version == 1 select emp; }
Stage Deployment Production Deployment
Future: Precise control
Recap
End of Act II
Oh Oh!
Trickiest patch ever
Act III When things go wrong…
ServiceDefinition.csdef ServiceConfiguration.cscfg
... if (RoleManager.GetConfigurationSetting("LogLevel") == "Verbose") RoleManager.WriteToLog("Information", "Some log message");
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
!
!
Recap
End of Act III
Please fill out your evaluation for this session at: This session will be available as a recording at:
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.