1 / 43

Learn how to build your first .NET application for the Cloud using Windows Azure

Learn how to build your first .NET application for the Cloud using Windows Azure.

waneta
Download Presentation

Learn how to build your first .NET application for the Cloud using Windows Azure

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Learn how to build your first .NET application for the Cloud using Windows Azure Stefano MallèPrincipal Platform Strategy AdvisorDeveloper and Platform EvangelismMicrosoft Switzerland - Richtistrasse 3 - 8304 WallisellenEmail: stefano.malle@microsoft.comPosterous: [Shared Memory]XING, LinkedIn

  2. Move a «classical» asp.net application from on premise to the Cloud, on the Windows Azure Platform. – And understand the benefits of this step. Goal of the session

  3. a smartway of hosting applications and data. You manage The Windows Azure Platform is… Your Provider Servers Virtualization Server HW Storage Networking

  4. a smartway of hosting applications and data. You manage The Windows Azure Platform is… Microsoft Platform as a Service Applications Runtimes Security & Integration Databases Servers Virtualization Server HW Storage Networking

  5. a smartway of hosting applications and data. You manage The Windows Azure Platform is… Microsoft Platform as a Service Applications Runtimes Security & Integration Databases Servers Virtualization Server HW Storage Compute Storage Management Relational data Management Connectivity Access control Networking

  6. High availability by design Data stored in 3 (geo-)redundant copies 24 x 7, 99.9% reliability Scalability by design Elastic Acquisition (and release) of resources on demand Pay for what you consume (or subscribe) Familiar tools & technologies Staging environment (with instantaneous switch) The Windows Azure Plaform gives you…

  7. Web App SQL DB 0 – Setting the stage

  8. SQL Azure

  9. SQL Azure – What Management Relational Database Microsoft® SQL Azure™ Database is a cloud-based relational database servicebuilt on SQL Server® technologies.

  10. No physical administration Automatic high availability and fault tolerance Elastic: Easy to provision, deploy, and scale databases up or down based on business needs SQL Azure – Why (3 Reasons)

  11. No physical administration Automatic high availability and fault tolerance Elastic: Easy to provision, deploy, and scale databases up or down based on business needs SQL Azure – Why (3 Reasons) Single Database Multiple Replicas Replica 1 Replica 2 DB Your App SQL Azure TDS Replica 3 Connection String

  12. No physical administration Automatic high availability and fault tolerance Elastic: Easy to provision, deploy, and scale databases up or down based on business needs SQL Azure – Why (3 Reasons)

  13. SQL Server 2008 R2 November CTP Management Studio Tools

  14. SQL Azure Web App 1 – Move to SQL Azure

  15. Windows Azure

  16. Windows Azure™ is a cloud operating system that provides developers with on-demand compute and storage to host, scale, and manage web applications on the internet through Microsoft® datacenters. Windows Azure – What Compute Storage Management

  17. Windows Azure – Where is the Magic? AUTOMATED APPLICATION MANAGEMENT AND CONTROL • Fabric: The collection of servers • 8 VMs per server • Each VM runs customized Hypervisor Windows Server 2008 • Fabric Controller performs service management • You tell it what to do—it figures out how • Automatically scale up, scale down, update or roll application back to a previous version Fabric Controler

  18. Windows Azure – Compute Services MASSIVE SCALABILITY Two instance types: Web Role & Worker Role Windows Azure applications are built with web role instances, worker role instances, or a combination of both. Scale “out” – not up – by replicating worker instances as needed. Allow applications to scale user and compute processing independently. Each instance runs on its own VM (virtual machine), replicated as needed

  19. Scalable, Scalable, Scalable Easy & fast deployment (and retirement) Self-healing, always up-to-date, performance optimized platform. WA Compute Services –Why (3 Reasons)

  20. Visual Studio 2008 or 2010 Windows Azure Tools for Microsoft Visual Studio Free download Works with Visual Web Developer Express 2008 & 2010 Requires IIS7 w. ASP.NET Application Development components installed Development Fabric Development Storage Tools

  21. SQL Azure Web Role Development Fabric & Storage Web Role 2 – Move to Windows Azure

  22. Optimizing 4 Windows Azure

  23. Windows Azure – Storage Services

  24. Windows Azure – Blob http://<account>.blob.core.windows.net/<container>/<blobname> Account Container Blob Picture1.jpg images Picture2.jpg myaccount videos Video1.avi REST and .NET Client Libraries* • *Microsoft.WindowsAzure.StorageClientnamespace  Windows Azure Managed Library Reference

  25. SQL Azure Development Fabric & Storage Web Role Blob 3 – Use of Blob Storage

  26. Windows Azure – Worker Role WEB ROLE WORKER ROLE Similar to a Web Page Handles incoming HTTP/HTTPS requests Develop with Microsoft and non-Microsoft tools: ASP.NET, WCF, other .NET tools Java, PHP, etc. Similar to a "batch job" or Windows service Initiates their own requests for data or tasks from the queue Can listen for non http/https Incoming traffic (f.i. smtp)

  27. publicclassWorkerRole : RoleEntryPoint { publicoverridevoid Run() { // This is a sample worker implementation. Replace with your logic. Trace.WriteLine("WorkerRole1 entry point called", "Information"); while (true) { YOUR LOGIC! Thread.Sleep(10000); Trace.WriteLine("Working", "Information"); } } publicoverridebool OnStart() { // Set the maximum number of concurrent connections ServicePointManager.DefaultConnectionLimit = 12; DiagnosticMonitor.Start("DiagnosticsConnectionString"); // For information on handling configuration changes // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357. RoleEnvironment.Changing += RoleEnvironmentChanging; YOUR INITIALILZATION, f.i. to initialize storage access returnbase.OnStart(); } Windows Azure – Worker Role

  28. Loosely Coupled Workflow - Enables workflow between roles Load work in a queue Producer can forget about message once it is in queue Many workers consume the queue Windows Azure – Queue Worker Role Web Role Worker Role Web Role Azure Queue Worker Role Web Role Worker Role

  29. SQL Azure Development Fabric & Storage Web Role Queue Worker Role Blob 4 – Use of Worker Role (and Queue)

  30. Windows Azure – Table Storage Provides Massively Scalable Structured Storage Table can have billions of entities (rows) and TBs of data Account Table Entity Name =… Email = … Picture ID =… Date = … customers Name =… Email = … Picture ID =… Date = … myaccount pictures

  31. Each entity can have up to 255 properties Mandatory Properties for every entity PartitionKey& RowKey Uniquely identifies an entity Defines the sort order Timestamp Optimistic Concurrency No fixed schema for rest of properties Each property is stored as a <name, typed value> pair No schema stored for a table Properties can be the standard .NET types String, binary, bool, DateTime, GUID, int, int64, and double WA Table Storage – Entity Properties

  32. Entity Locality Entities in the same partition will be stored together Efficient querying and cache locality Entity Group Transactions Atomically perform multiple Insert/Update/Delete over entities in same partition in a single transaction Table Scalability We monitor the usage patterns of partitions A partition contains all entities in a Table with the same partition key value Automatically load balance partitions Each partition can be served by a different storage node Scale to meet the traffic needs of your table WA Table Storage – PartitionKey

  33. WA Table Storage – Table Scalability Table Services are really good for highly efficiently storing and retrieving large amount of structured (not relational) data.

  34. publicclassActivityEntry : Microsoft.WindowsAzure.StorageClient.TableServiceEntity { public ActivityEntry() { PartitionKey = DateTime.UtcNow.ToString("yyyy-MM"); RowKey = string.Format("{0:10}_{1}", DateTime.MaxValue.Ticks – DateTime.Now.Ticks, Guid.NewGuid()); } publicstring Sport { get; set; } publicstring StartTime { get; set; } publicstring LapStartTime { get; set; } publicstring LapTotalTime { get; set; } publicstring LapDistance { get; set; } publicstring LapMaximumSpeed { get; set; } publicstring PointTime { get; set; } publicDateTime PointTimeDT { get; set; } publicstring PointLatitude { get; set; } publicstring PointLongitude { get; set; } publicstring PointDistance { get; set; } publicstring PointAltitude { get; set; } } } WA Table Storage – Accessing Tables w .NET publicclassActivityDataContext : TableServiceContext { publicstaticvoid CreateActivityTable() { CloudStorageAccount storageAccount = newConnectionManager().GetStorageAccount(); CloudTableClient.CreateTablesFromModel( typeof(ActivityDataContext), storageAccount.TableEndpoint.AbsoluteUri, storageAccount.Credentials); } public ActivityDataContext(string baseAddress, StorageCredentials credentials) : base(baseAddress, credentials) { } publicIQueryable<ActivityEntry> ActivityEntry { get { returnthis.CreateQuery<ActivityEntry>("ActivityEntry"); } } } Microsoft.WindowsAzure.StorageClientnamespace  Windows Azure Managed Library Reference

  35. publicclassActivityEntry : Microsoft.WindowsAzure.StorageClient.TableServiceEntity { public ActivityEntry() { PartitionKey = DateTime.UtcNow.ToString("yyyy-MM"); RowKey = string.Format("{0:10}_{1}", DateTime.MaxValue.Ticks – DateTime.Now.Ticks, Guid.NewGuid()); } publicstring Sport { get; set; } publicstring StartTime { get; set; } publicstring LapStartTime { get; set; } publicstring LapTotalTime { get; set; } publicstring LapDistance { get; set; } publicstring LapMaximumSpeed { get; set; } publicstring PointTime { get; set; } publicDateTime PointTimeDT { get; set; } publicstring PointLatitude { get; set; } publicstring PointLongitude { get; set; } publicstring PointDistance { get; set; } publicstring PointAltitude { get; set; } } } WA Table Storage – Accessing Tables w .NET publicclassActivityEntryDataSource { privateActivityDataContext context = null; public ActivityEntryDataSource() { CloudStorageAccount storageAccount = newConnectionManager().GetStorageAccount(); this.context = newActivityDataContext(storageAccount. TableEndpoint.AbsoluteUri, storageAccount.Credentials); this.context.RetryPolicy = RetryPolicies.Retry(3, TimeSpan.FromSeconds(1)); } publicList<ActivityEntry> Select() { List<ActivityEntry> results = (from g inthis.context.ActivityEntry where g.PartitionKey == DateTime.UtcNow.ToString("yyyy-MM") select g).ToList(); return results; } Microsoft.WindowsAzure.StorageClient namespace  Windows Azure Managed Library Reference

  36. SQL Azure Development Fabric & Storage Web Role Queue Worker Role Table Blob 5 – Use of Table Storage

  37. Wayne Gretsky – The Great One "skate to where the puck is going, not to where it has been" www.azure.com

  38. Workload Patterns Optimal For Cloud “Growing Fast“ “On and Off“ Inactivity Period Compute Compute Average Usage Usage Average Time Time • On & off workloads (e.g. batch job) • Over provisioned capacity is wasted • Time to market can be cumbersome • Successful services needs to grow/scale • Keeping up w/ growth is big IT challenge • Complex lead time for deployment “Unpredictable Bursting“ “Predictable Bursting“ Compute Compute Average Usage Average Usage Time Time • Unexpected/unplanned peak in demand • Sudden spike impacts performance • Can’t over provision for extreme cases • Services with micro seasonality trends • Peaks due to periodic increased demand • IT complexity and wasted capacity

  39. Compute Per Service Hour Starting at Chf 0.132 / service hour + Variable instance sizes Windows Azure Platform – Pricing Meters Web Edition Per Service Day 1 GB Database Chf 10.98 / month Storage Per GB stored & transactions Blob & table Chf 0.165 / GB Storage Access = Chf 0.11 / 100K Transactions Business Edition Per Service Day 10 GB Database Chf109.89 / month Bandwidth Per GB transfer in or out of a datacenter • US/EU Bandwidth = Chf 0.11 in / Chf 0.165 out / GB

  40. A Swiss Case – Deep Zoom Zermatt

  41. Windows Azure – Compute Services Virtual Machine - Unit of Compute Defined • Equivalent compute capacity of a 1.6Ghz processor (on 64bit platform) • X-Large • Large • Medium • Small 8 x 1.6Ghz 4 x 1.6Ghz 2 x 1.6Ghz 1 x 1.6Ghz (high IO) (high IO) (high IO) (moderate IO) 14 GB memory 7.0 GB memory 3.5 GB memory 1.75 GB memory 2000 GB (instance storage) 1000 GB storage (instance storage) 500 GB storage (instance storage) 250 GB storage (instance storage)

  42. You cannot control the physical resources of SQL Azure For example, you cannot specify the physical hard drive or file group where a database or index will reside. Transact-SQL statements with parameters that allows to specify file groups or physical file paths are to be considered partially supported. see Transact-SQL Support (SQL Azure Database) No Analysis Services, Replication, Reporting Services, and Service Broker. Most data type are supported but: hierarchyid, geography, geometry, and user-defined CLR data types see Data Types (SQL Azure Database) SQL Azure – Some differences to on-premise

More Related