Real World Azure - Dev


Published on

MSDN Events Presents – for the Developer & Architect from

In this session, we will discuss:

Cloud computing architectures in general and the Azure architecture in particular
Several aspects of Azure from the developer’s and architect’s perspective
Azure roles (web, web service and worker)
Azure storage options
Azure security and identity options
How Azure-based applications can be integrated with on-premise applications
Configuration, deployment and scaling Azure-based applications
How development teams can optimize their applications for better management and monitoring

Published in: Technology, Business
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Here’s the datacenter in the cloudA collection of commodity hardwareA collection of storage servers; triple replicationLoad BalancersFabric Controller: the “Brains” behind it all. Web Portal: where to deploy and manage applicationsService – any app you want to run is the service.It’s about running your service in the Microsoft datacenter. Windows Azure is not a SKU that you would install onsite.
  • = Service Deployment (So easy, even a CEO can do it) =Service, the application you want to runModel, service configuration; tells what the service looks like, how many you want to run, etc.Today, you must deploy your service through the portal. In the future, there will be an API available that will you to deploy your service through command-line, TFS build procedures, and other types of automation In this scenario, we are deploying our service through the portal. We upload the two files (the service package and model configuration). The Fabric Controller reads the model configuration which describes how to deploy our service. In this case, we are deploying our service to 3 machines. The Fabric Controller determines which 3 machines to deploy to, copies the service package to the 3 machines, and fires up the services. [Transition] The Fabric Controller then configures the DNS so you have an endpoint exposed for your services for the outside world to communicate with your services. From there, it configures the load balancers and routers. That’s it. It’s completed automated.
  • Managed partner pipeline review -opps in Seibel, partner, PAM; get together and collaborate on opps - more social collaboration, ability to comment, ability to bring people inDidn’t do much in SQL Azure as it wasn’t available at the timeAccomplished goals in 5 mos.
  • Web role - support for multi-tennancy (host multiple customers or segments on set of infrastructure) - web service for updating the opportunity information.NET Service Bus was used to integrate on the backend with SeibelMoved worker role inside firewall as it made more sense (on premise)Heavy use of Tables and BlobsMost Queue work is done with the .NET Service Bus under-the-covers; not a whole lot of work writing directly to QueuesDuring development, SDS did a reset and became SQL Azure; use Azure storage until SQL Azure becomes available (one of the best decisions they made)
  • Community wants to control Personalization, Content, Membership
  • TODO: Convert to Whiteboard template
  • TODO: Convert to Whiteboard template
  • We will bend over backwards to help you out.
  • BlobsBlobs are stored in containers. There are 0 or more blobs per container and 0 or more containers per account. (since you can have 0 containers, but then you would not have any blobs either)Typically url in the cloud is paths can contain the / character, so you can give the illusion of multiple folders, but there is only 1 level of containers.Blob capacity at CTP is 50gb.There is an 8k dictionary that can be associated with blobs for metadata.Blobs can be private or public:Private requires a key to read and writePublic requires a key to write, but NO KEY to read.Use blobs where you would use the file system in the past.
  • Tables are simply collections of Entities.Entites must have a PartitionKey and RowKey – can also contain up to 256 other properties.Entities within a table need not be the same shape! E.g.:Entity 1: PartitionKey, RowKey, firstnameEntity 2: PartitionKey, RowKey, firstname, lastnameEntity 3: PartitionKey, Rowkey, orderId, orderData, zipCodePartitions are used to spread data across multiple servers. This happens automatically based on the partition key you provide. Table “heat” is also monitored and data may be moved to different storage endpoints based upon usage.Queries should be targeted at a partition, since there are no indexes to speed up performance. Indexes may be added at a later date.Its important to convey that whilst you could copy tables in from a local data source (e.g. sql) it would not perform well in the cloud, data access needs to be re-thought at this level. Those wanting a more traditional SQL like experience should investigate SDS.
  • Hosted in Microsoft data centersFor massive scalable applicationsWe’re talking millions of rows, terabytes of dataStorage is one of the pieces of the Azure PlatformIt is NOT relationalWe can take hot data, the data that’s being requested more often, and scale those out to more serversDesigned for online, high-scale, high-throughput applicationsFamiliar if you’re used to .NET, LINQ and ADO.NET Data ServicesShared-key authentication between client and server
  • 05:17Flexible schema, tables don’t have to have the same columns (properties) defined up front; this is not an ‘Add Column’ or ‘Update Schema’Optimistic concurrency, protects you from someone else from modifying your data while you’re working on it
  • 07:17It’s an “Entity Store”, you can store entities, can retrieve entities, do simple querying on these entitiesPartitioned SQL Server: - A-M on this server - N-Z on this serverTop 5 customers that ordered the most, you have to poll 26 servers and aggregate the dataThat’s sort of what we have with Azure Table storage. We went with a highly partitioned approach upfront to gain scale and gain availability. We’ve had to sacrifice some of the complex queries such as joins to support this. It’s just a different way of having to deal with your data.
  • 09:18Entities (Rows)Properties (Columns)An Entity has 2 “Key” properties: -PartitionKey: How to partition data (ie. First-letter of last name, zip code) - every entity will be on the SAME physical server, this sets us up for scale - a good strategy is to keep your partitions small - RowKey: a unique identifier within a partition
  • 11:53Getting the all of dunnry’s post it fast because we’re selecting the entities by a partition keyGetting all of the posts after a certain is slow because we may have to traverse across multiple servers because we’re selecting entities that span partition keysA query without the partition key is really a scan
  • 14:58Keep partitions small, this increases scalability; this allows us to replicate data when its hot and spread data across multiple servers
  • 16:34Whitepaper: Windows Azure Table - Programming Azure Tables,, in working with your entities, you want them to be on the same server or close together; you gain locality by having large partitionsBut… for scalability, we said that you want smaller partitions so we can help manage the distribute the data and therefore the loadScalability is defined on who well you can manage your partition sizesConsiderations: - the only transaction we have our within the same table with the same partition key; take your transactional requirements into consideration when defining you want to partition your data - query efficiency; think through the top queries you want to execute - scalability: managing the size of your partitions - flexible partitioning : A-M, N-Z; change to A-M, N-R, S-Z - partitioning scheme by months (holiday sales, by month but in december by day)
  • 21:51A simple formula for choosing keys (more info in the whitepaper)Potential keys… what are you going to query onOrder by importanceMay need additional information to make it unique (add a GUID)
  • 23:35If you do a query on a non-key property, that’s a scan (very inefficient)Improve performance by scoping - by partition key, and range of row keys - scope by tables (came up in some customer discussions); users have arbitrary queries, no good set of keys (only querying from top 1000 items), make a table of just those 1000 items - data will be replicated but you can determine which partition to query from based on query typeIs it OK to duplicate data? Efficiency over consistency and slowing down updates - Certain types of applications
  • 30:29One of the more important things to understand*NOT* a relational databaseBad – indexes, foreign keys, referential integrity don’t existGood – it scales!Have to write lower level code for Azure table access vs. SQL ServerStorage in triplicateOur experience is Azure storage has been remarkably stable during the CTP; amazing as it’s a CTP and its brand new codeIt is CASE SENSITIVELot of learning in the community
  • 46:44During development, Azure Storage Client library was a sample; they couldn’t use a sample; since then its shipping as part of the SDK (production quality)Leverage client library where you canAzure storage is available via RESTThe hardest part is getting the signature right; its very picky (tutorial available on bartr’s blog)Client library uses ADO.NET Data ServicesSometimes its faster to just pull back a simple string then spin up a bunch of ADO.NET Data Services objectsREST is easier for dealing with versioning
  • 49:23REST requires a lot of parsingLINQ and XML make it easy, but sometimes parsing is easier (and maybe the only thing needed)CLOSE your HTTP connections; wrap in ‘using’ block or physically close themStorage names are picky
  • 50:32Drop table/Create table has about 30-40 sec lag timeOften better to get more data then you need (goes against T-SQL best practices)
  • 52:34List<> is your friend; works well, serializes well, binds wellThe team used this to work with the azure table data
  • 53:20(watch Dave Campbell session on SQL Azure)
  • 54:32SQL Server is very familiar, Azure tables are new and unknownSQL Server will not scale as well for V1; make the right choice for your needs
  • 56:09SQL Azure costs more, but delivers moreDBA’s don’t have the tools available yet to monitor SQL Azure… system catalog is different in the cloud then on premise… this is forthcoming
  • Queues are simple:Messages are placed in queues. Max size is 8k (and it’s a string)Message can be read from the queue, at which point it is hidden.Once whatever read the message from the queue is finished processing the message, it should then remove the message from the queue. If not the message is returned to the queue after a specific user defined time limit. This can be used to handle code failures etc.
  • Use queues as a way of communicating w/ the backend worker rolesWRs call getmessage and pass timeoutTimeout value is importantExpiration time is important; message is marked in the queue as invisible; for duration of timeout it’s invisibleWhen we’re done processing, we call a message to remove the message through a deleteTh reason we do this is imagine we have a second worker role; if something goes wrong, once the timeout expires, the message becomes visible, and the next person to do a get message will get the message
  • C:Program Files (x86)Microsoft .NET Services SDK (July 2009 CTP)SamplesServiceBusGettingStartedEcho
  • If you are or know someone starting a software business, get started building applications for Windows Azure * by joining BizSpark!*inclusion of Windows Azure in the BizSpark program is still being finalized and there is no public information on this topic we can share
  • Real World Azure - Dev

    1. 1. MSDN Events Presents:Real World Azure<br />clint edmonson | architect evangelist |<br />mike benkovich | developer evangelist |<br />
    2. 2. This is Jim<br />Patterns for Cloud Computing<br />
    3. 3. Jim has many questions about cloud computing<br />Patterns for Cloud Computing<br />
    4. 4. The more he reads, the more confused he gets <br />Patterns for Cloud Computing<br />
    5. 5. “What is Cloud Computing?”<br />Patterns for Cloud Computing<br />
    6. 6. “What can I use the Cloud for?”<br />Patterns for Cloud Computing<br />
    7. 7. “What is Microsoft’s roadmap in this space?”<br />Patterns for Cloud Computing<br />
    8. 8.
    9. 9. Define Cloud Computing<br />Break down the parts<br />Highlight the implementation of a Real World Azure scenario<br />
    10. 10.
    11. 11. Jim has heard all the buzzwords<br />
    12. 12. Service Oriented Architecture<br />
    13. 13. Rich Internet Applications<br />
    14. 14. Software as a Service<br />
    15. 15. Software + Services<br />
    16. 16. Are any of these cloud computing?<br />
    17. 17. Styles of application architecture<br />
    18. 18. These styles can work in the cloud, but they are not cloud computing<br />
    19. 19. Where do your applications “live”?<br />
    20. 20. On Premises<br />Hosted<br />Cloud<br />Vendor’s Problem<br />
    21. 21. “What is Microsoft doing in Cloud Computing?”<br />
    22. 22. 3 x Critical Concepts<br />
    23. 23. Roles<br />Web Role<br />Worker Role<br />
    24. 24. Storage<br />Table, Blob, Relational<br />
    25. 25. Messaging<br />Queues<br />
    26. 26. Patterns for Cloud Computing<br />Using the Cloud for Scale<br />
    27. 27. “Isn’t the cloud good for applications that need to scale dynamically?”<br />Patterns for Cloud Computing<br />
    28. 28. For example, tax applications<br />Patterns for Cloud Computing<br />
    29. 29. “How does this work?”<br />Patterns for Cloud Computing<br />
    30. 30. Let’s do some white boarding for Jim…<br />Patterns for Cloud Computing<br />
    31. 31. Using the Cloud for Scale<br />“Wow! What a great site!”<br />Database<br />Request<br />Web Tier<br />B/L Tier<br />Browser<br />Response<br />
    32. 32. Using the Cloud for Scale<br />Browser<br />Browser<br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />“Server Busy”<br />Browser<br />Browser<br />
    33. 33. Using the Cloud for Scale<br />Browser<br />Browser<br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />“Timeout”<br />Browser<br />Browser<br />
    34. 34. How would Jim do this today on premises?<br />
    35. 35. Using the Cloud for Scale<br />How would Jim do this today on premises?<br />Browser<br />Web Tier<br />N L B<br />Browser<br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />Browser<br />Web Tier<br />Browser<br />
    36. 36. Using the Cloud for Scale<br />How would Jim do this today on premises?<br />Browser<br />B/L Tier<br />N L B<br />Browser<br />Database<br />Web Tier<br />Browser<br />B/L Tier<br />Browser<br />B/L Tier<br />Browser<br />
    37. 37. Using the Cloud for Scale<br />How would Jim do this today on premises?<br />Browser<br />Web Tier<br />N L B<br />B/L Tier<br />N L B<br />Browser<br />Database<br />Web Tier<br />Browser<br />B/L Tier<br />Browser<br />Web Tier<br />B/L Tier<br />Browser<br />
    38. 38. Using the Cloud for Scale<br />How would Jim do this today on premises?<br />Browser<br />p1 p2 p3<br />Web Tier<br />N L B<br />B/L Tier<br />N L B<br />Browser<br />Database<br />Web Tier<br />Browser<br />B/L Tier<br />Browser<br />Web Tier<br />B/L Tier<br />Browser<br />
    39. 39. Not without consequences...<br />
    40. 40. Using the Cloud for Scale<br />How would Jim do this today on premises?<br />Browser<br />p1 p2 p3<br />Web Tier<br />N L B<br />B/L Tier<br />N L B<br />Browser<br />Database<br />Web Tier<br />Browser<br />B/L Tier<br />Browser<br />Web Tier<br />B/L Tier<br />Browser<br />“That took a lot of work - and money!”<br />
    41. 41. Using the Cloud for Scale<br />How would Jim do this today on premises?<br />p1 p2 p3<br />“Not so great now…”<br />Web Tier<br />N L B<br />B/L Tier<br />N L B<br />Database<br />Web Tier<br />Browser<br />B/L Tier<br />Web Tier<br />B/L Tier<br />“That took a lot of work - and money!”<br />“Hmmm... Most of this stuff is sitting idle...”<br />
    42. 42. Using the Cloud for Scale<br />Datacenter peak load<br />Idle time<br />Usage<br />Jan<br />Apr<br />Jul<br />Oct<br />
    43. 43. How can Windows Azure help?<br />
    44. 44. Using the Cloud for Scale<br />“Wow! What a great site!”<br />Azure Storage<br />Request<br />Web Role<br />Worker Role<br />Browser<br />Response<br />
    45. 45. Using the Cloud for Scale<br />Browser<br />Browser<br />Azure<br />Storage<br />Web Role<br />Worker Role<br />Browser<br />“Server Busy”<br />Browser<br />Browser<br />
    46. 46.
    47. 47. Using the Cloud for Scale<br />Browser<br />Web Role<br />N L B<br />Browser<br />AzureStorage<br />Web Role<br />Worker Role<br />Browser<br />Browser<br />Web Role<br />Browser<br />You don’t see this bit<br />
    48. 48. Using the Cloud for Scale<br />Browser<br />Web Role<br />N L B<br />Worker Role<br />N L B<br />Browser<br />AzureStorage<br />Web Role<br />Browser<br />Worker Role<br />Browser<br />Web Role<br />Worker Role<br />Browser<br />
    49. 49. Using the Cloud for Scale<br />Browser<br />p1 p2 p3<br />Web Role<br />N L B<br />Worker Role<br />N L B<br />Browser<br />AzureStorage<br />Web Role<br />Browser<br />Worker Role<br />Browser<br />Web Role<br />Worker Role<br />Browser<br />
    50. 50. What’s going on behind the scenes?<br />
    51. 51. Windows Azure<br />Your<br />Service<br />DNS<br />LB<br />Web Portal<br />(API)<br />LB<br />Fabric<br />Controller<br />
    52. 52. Service<br />Service<br />Service<br />Model<br />Your<br />Service<br />DNS<br />LB<br />Web Portal<br />(API)<br />DNS<br />config<br />LB<br />Service Deployment<br />Fabric<br />Controller<br />
    53. 53. Your<br />Service<br />Service<br />Service<br />DNS<br />Service<br />Service<br />Service<br />Service<br />Service<br />LB<br />Service<br />Web Portal<br />(API)<br />LB<br />Model<br />Service Scaling<br />Fabric<br />Controller<br />
    54. 54. Your<br />Service<br />Service<br />DNS<br />Service<br />Service<br />Service<br />LB<br />Web Portal<br />(API)<br />!<br />LB<br />Model<br />Service Monitoring & Recovery<br />Fabric<br />Controller<br />
    55. 55. On to the Case Study…<br />
    56. 56. RXD Incubation Project<br />Project Vision<br />Project Austin delivers a next-generation, micro-community based opportunity management and collaboration experience to our managed partners …<br />Project Goals<br />Gain first-hand experience on Azure<br />Cloud Storage – Security – Integration – Web – SQL Azure<br />Explore a business scenario that leverages the promises of the cloud<br />Provide enterprise feedback to the Azure team<br />Deliver a working prototype in FY09<br />Project Austin Overview<br />
    57. 57. Project Austin delivers a next-generation, micro-community based opportunity management and collaboration experience that brings a managed feel to the unmanaged space, allowing Microsoft to observe and participate in the sales process at scale through dynamic, customer-driven collaboration. <br />Project Austin leverages Windows Azure, CRM Services, and SharePoint Services to provide a rich set of customer and partner capabilities in the cloud while integrating with existing on-premise solutions. <br />Project Austin significantly enhances our understanding of our customers and partners by facilitating relationships with and between customers, partners, and Microsoft, while providing data that allows Microsoft to identify and promote world-class selling techniques and content.<br />Project Austin Vision<br />
    58. 58. Web Role<br />Multi-Tenant; Web App; Web Service<br />Integration<br />Worker Role; .NET Service Bus; Siebel<br />Data Storage<br />Tables; Blobs; Queues; SQL Azure<br />Live ID Integration<br />Web Auth; Access Control Service; WIF; RPS<br />Technical Overview<br />
    59. 59. Community<br />Community <br />Micro Community<br />Factory<br />Community<br />Community<br />Community<br />Groups<br />Community Group A<br />Community Group B<br />Personalization<br />Membership<br />Content<br />Personalization<br />Membership<br />Content<br />High Level Services<br />Personalization<br />Customization<br />Content<br />Security<br />Integration<br />…<br />Navigation<br />Search<br />Membership<br />Identity<br />Groups<br />…<br />Foundation Services<br />Identity<br />Security<br />Storage<br />Eventing<br />Config<br />Content<br />…<br />Micro Community<br />Compute<br />59<br />
    60. 60.
    61. 61.
    62. 62. (TODO: Insert Austin Screenshots or walkthrough application)<br />
    63. 63. (Transition to Developer Evangelist…)<br />This slide is Hidden<br />
    64. 64. Warning – this session contains information about Microsoft Technologies that are in the CTP (pre-Beta) stages. Specifics of the technology may change before final release.<br />
    65. 65. Feedback.<br />
    66. 66. We are here to help. Send us your questions, doubts, concerns, challenges, adoration, regrets, denials, and alibis.<br />We will start a discussion and help you out.<br /><br />
    67. 67. The Development Experience…<br />
    68. 68. Visual Studio<br />Templates<br />Debugging<br />.NET platform<br />.NET, IIS7, WCF<br />“The cloud on your desktop”<br />Complete offline cloud simulation<br />Like Cassini (web development server)<br />Consistent, Familiar Development<br />
    69. 69. Write code on your development machine<br />Test locally<br />Build package w/VS Tools<br />Upload your package to the web portal<br />Push “deploy”<br />Monitor, upgrade, scale…<br />Publishing Your Service To The Cloud<br />
    70. 70. Demo: Developer Experience<br />
    71. 71. Roles<br />Web Role<br />Worker Role<br />Windows Server 2008 x64<br />.NET Start<br />Native Code<br />User Mode<br /><ul><li>Windows Server 2008 x64
    72. 72. IIS 7
    73. 73. FastCGI - PHP
    74. 74. Native Code
    75. 75. Full Trust
    76. 76. User Mode</li></li></ul><li>Demo: Guest Book<br />
    77. 77. Service Models & Roles<br />Bid Now Service<br />Worker X<br />Web A<br />(port 80)<br />Main Web<br />100 instances<br />Image Resize<br />2 instances<br />Worker Y<br />Auction Processing<br />25 instances<br />Web B <br />(port 8081)<br />Admin<br />2 instances<br />Worker Z<br />Notifications<br />10 instances<br />
    78. 78. Debugging the cloud really means logging<br />Simple logging API today<br />More functionality over time<br />Debugging in the Cloud<br />
    79. 79. Demo: Guest Book Logging<br />
    80. 80. Storage in the Cloud…<br />
    81. 81. Blobs, Tables, Relational<br />
    82. 82. Blobs, Tables, Relational<br />
    83. 83. Blobs stored in Containers<br />1 or more Containers per account<br />Scoping is at container level<br />…/Container/blobpath<br />Blobs<br />Capacity 50GB in CTP<br />Metadata, accessed independently <br />name/value pairs (8kb total)<br />Private or Public container access<br />Use Blobs for file system<br />Blobs<br />
    84. 84. Using the Cloud for Storage<br />Blob Container<br />PutBlob<br />PUT<br />Azure <br />Blob Storage<br />REST API<br />Client<br /><br />PutBlob = 64Mb MAX<br />MetaData = 8Kb per Blob<br />
    85. 85. Using the Cloud for Storage<br />Blob Container<br />Azure <br />Blob Storage<br />REST API<br />Client<br />GetBlob<br />GET<br /><br />
    86. 86. Using the Cloud for Storage<br />Blob Container<br />Azure <br />Blob Storage<br />REST API<br />Client<br />GetBlob<br />GET<br />Range: bytes=329300 - 730000<br /><br />
    87. 87. Using the Cloud for Storage<br />Blob Container<br />PutBlock(blobname, blockid, data)<br />PutBlockList(blobname, blockid1, …, blockidN)<br />Azure <br />Blob Storage<br />REST API<br />Client<br /><br />PutBlock = 4Mb MAX to a maximum of 50Gb<br />BlockId = 64 bytes<br />
    88. 88. Blobs, Tables, Relational<br />
    89. 89. Using the Cloud for Storage<br />REST: <br />GET$filter=%20PartitionKey%20eq%20value<br />LINQ:<br />var customers = from o in context.CreateQuery&lt;customer&gt;(“Customer”) where o.PartitionKey == value select o;<br />Azure<br />Table Storage<br />Worker Role<br /><br />Each Table: <br />PartitionKey (e.g. DocumentName) to ensure scalability<br />RowKey (e.g. version number)<br />[fields] for data<br />
    90. 90. Entities and properties (rows & columns)<br />Tables scoped by account<br />Designed for billions+<br />Scale-out using partitions<br />Partition key & row key<br />Operations performed on partitions<br />Efficient queries<br />No limit on number of partitions<br />Use ADO.NET Data Services<br />Tables<br />
    91. 91. Provides structured storage<br />Massively scalable tables (TBs of data)<br />Highly available<br />Durable<br />Familiar and easy-to-use API<br />ADO.NET Data Services – .NET 3.5 SP1<br />.NET classes and LINQ<br />REST – with any platform or language<br />Introduction to Tables<br />
    92. 92. For scalable applications:<br />Billions of rows, TBs of data<br />Automatic load management (hot data)<br />For online applications:<br />High availability<br />Built-in replication<br />Flexible schema (no big “schema migration”)<br />Optimistic concurrency<br />Advantages<br />
    93. 93. No join<br />No group by<br />No order by<br />Think: relational DB partitioned to the max<br />Not a Relational Database<br />
    94. 94. Table<br />A Table is a set of Entities (rows)<br />An Entity is a set of Properties (columns)<br />Entity<br />Two “key” properties form unique ID<br />PartitionKey – enables scale<br />RowKey – uniquely ID within a partition<br />Data Model<br />
    95. 95. Key Example – Blog Posts<br />Partition 1<br />Partition 2<br />Getting all of dunnry’s blog posts is fast<br />Single partition<br />Getting all posts after 2008-03-27 is slow<br />Traverse all partitions<br />
    96. 96. Partition Key – how data is partitioned<br />Row Key – unique in partition, defines sort<br />Goals<br />Keep partitions small (increased scalability)<br />Specify partition key in common queries<br />Query/sort on row key<br />Keys<br />
    97. 97. Tradeoff between locality and scalability<br />Considerations<br />Entity group transactions<br />Query efficiency<br />Scalability<br />Flexible Partitioning<br />Choosing a Partition Key<br />
    98. 98. Pick potential keys (common query filters)<br />Order keys by importance<br />If needed, include an additional unique key<br />Use two most important keys as PK, RK<br />Consider concatenating to form keys<br />A Method of Choosing Keys<br />
    99. 99. A Method for Choosing Keys…<br /><ul><li>Pick potential keys (common query filters)
    100. 100. Order keys by importance
    101. 101. If needed, include an additional unique key
    102. 102. Use two most important keys as PK, RK
    103. 103. Consider concatenating to form keys</li></li></ul><li>Non-key queries are scans<br />Improve performance by scoping<br />Usually by partition key<br />But what about by table?<br />3 tables<br />Top 1,000 popular items<br />Top 10,000 popular items<br />Everything<br />Now arbitrary “top 1,000” queries are fast<br />Better locality than clever partition keys<br />Multiple Tables, Same Keys<br />
    104. 104. Demo: Guest Book Table Storage<br />
    105. 105. Lessons LearnedAzure Storage<br />Azure tables are *not* a relational database<br />Requires a mind shift<br />Azure tables scale<br />3 - 9s availability<br />Azure tables support exactly one key<br />PartitionKey + RowKey<br />Case Matters<br />No foreign keys<br />No referential integrity<br />No stored procedures<br />Leverage the community<br />
    106. 106. Lessons LearnedAzure Storage<br />Azure storage Client Library<br />No longer just a “sample”<br />Azure storage is available via REST<br />Not limited to Azure hosted apps<br />Not limited to Microsoft platform or tools<br />Getting the signature correct is the hard part<br />Console tools are easy to write<br />Ultimate flexibility<br />Use the REST interface early as you’re versioning your tables<br />
    107. 107. Lessons LearnedAzure Storage - RESTful<br />REST is *not* TDS<br />Be prepared to parse<br />LINQ and XML classes help<br />Sometimes, string parsing is the best choice<br />Don’t forget to close your HTTP connections<br />Azure storage names are picky<br />So are Azure key values<br />It’s possible to create an entity in a table and not be able to update or delete it<br />
    108. 108. Lessons LearnedAzure Storage – Roundtrips are expensive<br />Often better to pull back more than you need vs. multiple roundtrips<br />LINQ on results in memory is fast & flexible<br />foreach works well too<br />don’t forget the break;<br />Sort and cache tables on the web tier<br />Use XML Serialization to write the results to local storage<br />It’s generally faster to hydrate from local storage<br />Not as fast as caching in memory<br />
    109. 109. Lessons LearnedAzure Storage – List&lt;&gt;<br />Using List&lt;&gt; with entity types<br />List&lt;&gt; binds well<br />LINQ works well with List&lt;&gt;<br />So does foreach<br />List&lt;&gt; serializes well<br />Add intelligence to your entities<br />Compare, Equals, ToString, etc.<br />
    110. 110. Blobs, Tables, Relational<br />
    111. 111. SQL Server Data Services (MIX08)<br />
    112. 112. Using the Cloud for Storage<br />This is what I’m doing on premises...<br />Data<br />TDS<br />RDBMS<br />Client<br />DB Server<br />
    113. 113. Using the Cloud for Storage<br />So, this is what I would like to do in the cloud...<br />Data<br />TDS<br />RDBMS<br />Client<br />DB Server<br />
    114. 114. SQL Data Services (MIX09)<br />
    115. 115. SQL Azure (July 2009)<br />
    116. 116. Using the Cloud for Storage<br />So, this is what I would like to do…<br />Data<br />TDS<br />RDBMS<br />Client<br />SQL Azure<br />
    117. 117. Using the Cloud for Storage<br />HTTP<br />TDS<br />RDBMS<br />Browser<br />Web Role<br />SQL Azure<br />
    118. 118. Using the Cloud for Storage<br />Queue<br />TDS<br />HTTP<br />RDBMS<br />Browser<br />Web Role<br />Worker Role<br />SQL Azure<br />
    119. 119. Migration!<br />
    120. 120. Using the Cloud for Storage<br />“The Data Center”<br />TDS<br />HTTP<br />RDBMS<br />Browser<br />Web Tier<br />Bus. Logic<br />SQL Server<br />
    121. 121. Using the Cloud for Storage<br />“The Cloud”<br />Queue<br />TDS<br />HTTP<br />RDBMS<br />Browser<br />Web Role<br />Worker Role<br />SQL Azure<br />
    122. 122. Demo: SQL Azure CTP<br />
    123. 123. CTP Limitations TodaySET ANSI_NULLS ONSET ANSI_NULLS OFFPAD_INDEX  = OFFSET ANSI_PADDING OFFALLOW_ROW_LOCKS  = ONALLOW_PAGE_LOCKS  = ONON [PRIMARY]FILLFACTOR = 90Three-part naming (e.g. dbo.TableName.ColumnName)Cannot use “WITH IGNORE_DUP_KEY” w/o the quotesNo @@servernameNo CREATE SCHEMA(Not an exhaustive list)<br />
    124. 124. Lessons LearnedSQL Azure<br />From the database “down” it’s just SQL Server<br />Well, almost …<br />Most tools don’t work today<br />System catalog is different<br />No CLR<br />Above the database is taken care of for you<br />You can’t really change anything<br />
    125. 125. Lessons LearnedSQL Azure<br />SQL Server is very familiar<br />SQL Azure *is* SQL Server in the cloud<br />Security of Azure tables is unknown<br />SQL Server has a very good pedigree<br />A lot of our customers LOVE SQL Server<br />Understand Azure storage<br />Understand SQL Azure<br />Make the right recommendation<br />
    126. 126. Lessons LearnedSQL Azure<br />Azure tables are *not* SQL Azure<br />SQL Azure is not the only storage option<br />SQL Azure is not always the best storage option<br />SQL Azure costs more<br />Delivers a *lot* more functionality<br />SQL Azure is more limited on scale [today]<br />
    127. 127. Queues<br />
    128. 128. Simple asynchronous dispatch queue<br />Create and delete queues<br />Message:<br />Retrieved at least once<br />Max size 8kb<br />Operations:<br />Enqueue<br />Dequeue<br />RemoveMessage<br />Queues<br />
    129. 129. Azure Queues<br />RemoveMessage<br />GetMessage (Timeout)<br />Worker Role<br />PutMessage<br />Queue<br />Msg 1<br />Msg 2<br />Msg 2<br />Msg 1<br />Web Role<br />Worker Role<br />Worker Role<br />Msg 3<br />Msg 4<br />Msg 2<br />
    130. 130. Patterns in the Cloud<br />Using the Cloud for Multi Tenancy<br />
    131. 131. “I like the idea of scaling Web roles…”<br />Patterns for Cloud Computing<br />
    132. 132. “…but need to serve multiple customers”<br />Patterns for Cloud Computing<br />
    133. 133. “Without creating separate codebases!”<br />Patterns for Cloud Computing<br />
    134. 134. Using the Cloud for Multi Tenancy<br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />Customer #1<br />
    135. 135. How would Jim do this today on premises?<br />
    136. 136. #2 - Using the Cloud for Multi Tenancy<br />How would Jim do this today on premises?<br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />Customer #1<br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />Customer #2<br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />Customer #3<br />
    137. 137. Gets expensive pretty quickly<br />
    138. 138. Using the Cloud for Multi Tenancy<br />Browser<br />Customer #1<br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />Customer #2<br />Browser<br />Customer #3<br />
    139. 139. Schema CustomizationsUI Customizations<br />
    140. 140. Schema CustomizationsUI Customizations<br />
    141. 141. 3 options for data in multi tenant environment<br />
    142. 142. Using the Cloud for Multi Tenancy<br />Browser<br />Fixed Schema<br />Customer #1<br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />Customer #2<br />Browser<br />Option 1: Everyone Uses the Same Database/Schema<br />Customer #3<br />Pros: Simplest approach, easy to maintain/upgrade.<br />Cons: No customizations. Restoring of tenant data.<br />
    143. 143. Using the Cloud for Multi Tenancy<br />Database<br />Browser<br />Customer #1<br />Customer #1<br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />Customer #2<br />Customer #2<br />Database<br />Browser<br />Customer #3<br />Customer #3<br />Option 2: Give Each Customer Their Own Database/Schema<br />Pros: Flexible. Tenant restore is easier. High Isolation.<br />Cons: Can be costly. Difficult to upgrade db schemas.<br />
    144. 144. Using the Cloud for Multi Tenancy<br />Fixed Schema<br />with Customizations<br />Browser<br />Customer #1<br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />Customer #2<br />Browser<br />Option 3: Fixed Database/Schema, with customizations<br />Customer #3<br />Pros: Customers can add their own custom fields<br />Cons: Non standard way of customizing the schema. Tenant restore is difficult.<br />
    145. 145. Using the Cloud for Multi Tenancy<br />Tenant<br />1<br />*<br />int<br />TenantID<br />nvarchar<br />TenantName<br />*<br />*<br />Type<br />Employee<br />int<br />TypeID<br />int<br />EmployeeId<br />nvarchar<br />Name<br />nvarchar<br />FirstName<br />nvarchar<br />nvarchar<br />CLRType<br />LastName<br />1<br />1<br />Customization<br />int<br />CustomizationID<br />*<br />*<br />nvarchar<br />Value<br />
    146. 146. Using the Cloud for Multi Tenancy<br />Tenant<br />1<br />*<br />1<br />TenantID<br />UK Branch<br />TenantName<br />*<br />*<br />Type<br />Employee<br />1<br />TypeID<br />1<br />EmployeeId<br />PostalCode<br />Name<br />Gordon<br />FirstName<br />string<br />Brown<br />CLRType<br />LastName<br />1<br />1<br />Customization<br />1<br />CustomizationID<br />*<br />*<br />SW1A 2AA<br />Value<br />
    147. 147. Using the Cloud for Multi Tenancy<br />Tenant<br />1<br />*<br />2<br />TenantID<br />US Branch<br />TenantName<br />*<br />*<br />Type<br />Employee<br />2<br />TypeID<br />2<br />EmployeeId<br />ZipCode<br />Name<br />Barack<br />FirstName<br />string<br />Obama<br />CLRType<br />LastName<br />1<br />1<br />Customization<br />2<br />CustomizationID<br />*<br />*<br />20500<br />Value<br />
    148. 148. Using the Cloud for Multi Tenancy<br />Tenant<br />1<br />*<br />2<br />TenantID<br />Fixed Schema<br />Applies to All Tenants<br />Could be both<br />US Branch<br />TenantName<br />*<br />*<br />Type<br />Employee<br />2<br />TypeID<br />2<br />EmployeeId<br />Customizable<br />Tenant by Tenant Basis<br />ZipCode<br />Name<br />Barack<br />FirstName<br />string<br />Obama<br />CLRType<br />LastName<br />1<br />1<br />Customization<br />2<br />CustomizationID<br />*<br />*<br />20500<br />Value<br />
    149. 149. Schema CustomizationsUI Customizations<br />
    150. 150. #2 - Using the Cloud for Multi Tenancy<br />Browser<br />Customer #1<br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />Customer #2<br />Browser<br />Customer #3<br />
    151. 151. URL Handing<br />
    152. 152. Can ASP.NET MVC Help?<br />
    153. 153. Single Controller per Tenant (ContosoController)<br />
    154. 154. Shared Controller per Tenant (EmployeeController)<br />
    155. 155. Shared Controller per Tenant (with URL mask)<br />
    156. 156. Using the Cloud for Multi Tenancy<br /><br />Browser<br />Customer #1<br /><br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />Customer #2<br />Browser<br />Customer #3<br /><br />
    157. 157. Using the Cloud for Multi Tenancy<br /> -&gt; CNAME (<br />Browser<br />Customer #1<br /><br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />Customer #2<br />Browser<br />Customer #3<br /> -&gt; CNAME (<br />
    158. 158. Using the Cloud for Multi Tenancy<br /> -&gt; CNAME (<br />Browser<br />Customer #1<br /><br />Database<br />Web Tier<br />B/L Tier<br />Browser<br />Customer #2<br />Use custom routing in ASP.NET MVC<br />Browser<br />Customer #3<br /> -&gt; CNAME (<br />
    159. 159. Demo: Multi-Tenant Routing with ASP.NET MVC<br />Tentative<br />
    160. 160. Patterns for Moving to the Cloud<br />Using the Cloud for Communications<br />
    161. 161. Jim’s organization needs to communicate with other organizations<br />Patterns for Cloud Computing<br />
    162. 162. “This has always been a very tricky and expensive process to get working”<br />Patterns for Cloud Computing<br />
    163. 163. “Does the cloud offer anything to help?”<br />Patterns for Cloud Computing<br />
    164. 164. How would Jim have done this before?<br />
    165. 165. Using the Cloud for Communications<br />Telco provided WAN<br />Company 2<br />Company 1<br />Server<br />Client<br />FTP<br />Server<br />FTP<br />Client<br />
    166. 166. Using the Cloud for Communications<br />Internet<br />Telco provided WAN<br />Company 2<br />Company 1<br />Server<br />Client<br />FTP<br />Server<br />FTP<br />Client<br />
    167. 167. Using the Cloud for Communications<br />Internet<br />Telco provided WAN<br />Company 2<br />Company 1<br />DMZ<br />Server<br />Client<br />Extranet<br />Site<br />Browser<br />
    168. 168. What does the cloud provide?<br />
    169. 169. Using the Cloud for Communications<br /><br />Azure Queue<br />REST<br />Client<br />
    170. 170. Using the Cloud for Communications<br />Company 1<br /><br />Client<br />Azure Queue<br />REST<br />Company 2<br />Client<br />
    171. 171. Using the Cloud for Communications<br />x<br />Company 1<br /><br />Client<br />Azure Queue<br />REST<br />Company 2<br />Client<br />
    172. 172. Using the Cloud for Communications<br />Company 1<br /><br />Client<br />Master Key<br />Azure Queue<br />REST<br />Company 2<br />Client<br />Master Key<br />
    173. 173. Using the Cloud for Communications<br />Company 1<br /><br />Client<br />Azure Queue<br />REST<br />Web Role<br />Company 2<br />Client<br />
    174. 174. Using the Cloud for Communications<br />Proxy?<br />Company 1<br />Firewall<br /><br />Client<br />Azure Queue<br />REST<br />Web Role<br />Company 2<br />Client<br />Firewall<br />
    175. 175. Using the Cloud for Communications<br />Company 1<br />Firewall<br /><br />Client<br />Azure Queue<br />REST<br />Web Role<br /><br />Company 2<br />Client<br />Firewall<br /><br />NAT?<br />
    176. 176. Using the Cloud for Communications<br />Company 1<br />Firewall<br /><br />Client<br />Azure Queue<br />REST<br />Web Role<br /><br />Company 2<br />Client<br />Firewall<br /><br />OK, so I’ll do a HTTP poll every minute<br />
    177. 177. Using the Cloud for Communications<br />Company 1<br />Firewall<br /><br />Client<br />Azure Queue<br />REST<br />Web Role<br /><br />Company 2<br />Client<br />Firewall<br /><br />…and how about other protocols other than HTTP?<br />
    178. 178. How does the .NET Service Bus help?<br />
    179. 179. Using the Cloud for Communications<br />Company 1<br />sb://.../myqueue<br />Client<br />.NET <br />Service Bus<br />Company 2<br />Client<br />Firewall<br />Outbound bi-directional socket<br />Kept alive in background<br />
    180. 180. Using the Cloud for Communications<br />Company 1<br />Firewall<br />sb://.../myqueue<br />Client<br />Outbound one-way socket<br />.NET <br />Service Bus<br />Company 2<br />Message routed<br />accordingly<br />Client<br />Firewall<br />Outbound bi-directional socket<br />Kept alive in background<br />
    181. 181. Austin Integration with Siebel (on-premise)<br />Austin<br />Blob<br />Table<br />Queue<br />sb://.../myqueue<br />On-Premise DataCenter<br />.NET <br />Service Bus<br />Synchronization Message<br />Firewall<br />bi-directional socket<br />Kept alive in background<br />Siebel<br />Opp. Exchange<br />Service<br />
    182. 182. Demo: Integration through the .NET Service Bus<br />
    183. 183. High Level of Abstraction<br />Hardware<br />Server OS<br />Network Infrastructure<br />Web Server<br />Availability<br />Automated Service Management<br />Scalability<br />Instance & Partitions<br />Developer Experience<br />Familiar Developer Tools<br />Windows Azure Benefits<br />
    184. 184. Resources<br />Azure Services Training Kit<br />Downloadable hands-on labs, demos, and presentations<br /><br />Blogs<br /> – Steve Marx<br /> - Clemens Vasters (.NET Services)<br />Azure Services Platform Forums<br /><br />
    185. 185. (Transition to Architect Evangelist for wrap-up…)<br /><ul><li>Highlight customer wins or Partner experiences
    186. 186. Q&A
    187. 187. Collect surveys and Hand out tokens
    188. 188. Giveaways</li></ul>TODO<br />
    189. 189. From start to finish in two weeks<br /><ul><li>West Monroe Partners asked to develop an interactive, printable map for the 2009 Taste of Chicago’s two million visitors
    190. 190. Had two weeks to design and build externally facing Web functionality, ensure scalability for up to 50,000 hits per day, with no defined hosting solution in place</li></ul>Taste of Chicago<br />“With Windows Azure and Live Services, we built a solution that uses the equivalent of 25 servers, and yet it required no up-front capital costs and minimal ongoing operational costs.”<br />Cory Chaplin, Technology Solutions Practice Lead, West Monroe Partners <br />[case study]<br />
    191. 191. “Be This Close”<br />Country Music Festival 2009<br /><ul><li>Compelling Silverlight/DeepZoom experience leveraging Windows Azure as the storage mechanism
    192. 192. Less than 1 hour to get up and running on Azure
    193. 193. 850 high resolution photos broken into x,000 tiles
    194. 194. Week a half to build Azure support</li></ul>[play it online]<br />“Windows Azure was a breeze to use and didn&apos;t let us down.”<br />Ben Henderson, Firefly Logic<br />
    195. 195. Customer Costs Reduced 60 Percent<br />Delivers enterprise line of business data to mobile workers anytime, anywhere, at minimal cost to the enterprise. <br />Aggregated LOB data, LOB access rules, and, optionally, even LOBs themselves are stored in the cloud in Microsoft SQL Data Services.<br />Cumulux <br />[case study]<br />“With software-plus-services, we can get our customers up and running on mPortal in two weeks versus two months—a 75 percent time-to-market improvement over on-premises deployment.”<br />RanjithRamakrishnan, Chief Technology Officer for Cumulux<br />
    196. 196. What do I get?<br />MSDN Premium<br />Phone and Online Technical Support<br />Profiled on Microsoft and other web properties<br />How do I qualify?<br /><ul><li>Building software or software services
    197. 197. Privately held
    198. 198. In business for less than 3 years
    199. 199. Less than US $1 million in annual revenue </li></ul>contact briangorbett<br /><br />425-538-0050<br />
    200. 200.<br /><br />© 2009 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.<br />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.<br />