Building services using windows azure

  • Published on

  • View

  • Download




<ul><li> 1. Windows Azure Platform<br />Training Workshop<br /></li> <li> 2. Presentation Outline (hidden slide):<br />Technical Level: 300<br />Intended Audience: Developers<br />Objectives (what do you want the audience to take away):<br />1. To be able to build and deploy a Windows Azure Service<br />2. To be able to use blobs, tables and queues effectively<br />3. Understand how to use the API for logging<br />Presentation Outline (including demos):<br />Compute<br />Demo: Building and Deploying a Service<br />Demo: Logging and Configuration<br />Demo: Worker Roles<br />Storage<br />Demo: Using Blobs<br />Demo: Using Queues<br />Demo: Using Tables<br />Advanced Table Concepts<br /></li> <li> 3. Building Services using Windows Azure<br />Name<br />Title<br />Organization<br />Email<br /></li> <li> 4. Windows Azure<br />Windows Azure is the foundation of Microsofts Cloud Platform<br />It is an Operating System in the Cloud and provides Essential Services for the cloud<br />Virtualized Computation<br />Scalable Storage<br />Automatic Management<br />Developer SDK<br /></li> <li> 5. Role Programming Model<br />Inherits RoleEntryPoint<br />OnStart() Method<br />Called by Fabric on startup, allows you to perform initialization tasks.<br />Reports Busy status to load balancer until you return true.<br />OnStop() Method<br />Called when role is to be shutdown, graceful exit.<br />Run() Method<br />Main logic is here can do anything, typically loop and never exit.<br /></li> <li> 6. Web Role<br />ASP.NET 3.5 SP1 64bit<br />IIS7 Hostable Web Core<br />Hosts<br />Webformsor MVC<br />FastCGI applications (e.g. PHP)<br />Http(s)/TCP<br />WebRole<br />New web.roleConfig to support FastCGI<br />Support same Role model semantics as Worker Role (e.g. OnStart, Run, etc.)<br /></li> <li> 7. Packaging &amp; Deployment<br />ServicePackage<br />ServiceConfiguration<br /></li> <li> 8. Building and Deploying a Service<br />demo<br /></li> <li> 9. Configuration<br />Service Configuration<br />Serviceconfiguration.csdef Service Model<br />ServiceConfiguration.cscfg instance data<br />RoleEnvironment.GetConfigurationSettingValue()<br />Dont use web.config for values you wish to change at runtime<br />Web.config change requires re-deploy<br /></li> <li> 10. Monitoring<br />No Debugging in Cloud<br />Instrument your application using Trace, Debug<br />DiagnosticMonitorTraceListener<br />Use Diagnostics API to Configure and Collect<br />Event Logs<br />Performance Counters<br />Trace/Debug information (logging)<br />IIS Logs, Failed Request Logs<br />Crash Dumps or Arbitrary files<br />Request data on demand or scheduled<br />Transferred into your table and/or blob storage<br />Everything is remotely configurable<br /></li> <li> 11. Logging and Configuration<br />demo<br /></li> <li> 12. Using Queues to Decouple Roles<br />Use Queue to Decouple<br />Design for Idempotency<br />multiple applications of the operation does not change the result<br />Web Role<br />Worker Role<br />Worker Role<br />Web Role<br />Worker Role<br />Worker Role<br />Storage<br />Queue<br />LB<br />LB<br /></li> <li> 13. Using the Worker Roles<br />demo<br /></li> <li> 14. Upgrading Your Application<br />Two Models: VIP Swap and In-Place Upgrade<br />VIP Swap:<br />Uses Staging and Production environments.<br />Allows to quickly swap environments.<br />Production: v1 Staging: v2, after swap then Production: v2 Staging: v1.<br />In-Place Upgrade<br />Performs a rolling upgrade on live service.<br />Entire service or a single role<br />Manual or Automatic across update domains<br /></li> <li> 15. Storage<br />Blobs Provide a simple interface for storing named files along with metadata forthe file <br />Drives A durable NTFS volume backed by blob storage<br />Tables Provide structured storage; A Table is a set of entities, which contain aset of properties<br />Queues Provide reliable storage and delivery of messages for an application<br /></li> <li> 16. Storage in the Dev Fabric<br />Provides a local Mock storage<br />Emulates storage in cloud<br />Allows offline development<br />Requires SQL Express 2005/2008<br /></li> <li> 17. Storage in the cloud<br />Create a Storage Account<br />Endpoints<br />Access Keys<br />CDN<br /></li> <li> 18. Windows Azure Storage Account<br />User creates a globally unique storage account name<br />Can choose geo-location to host storage account<br />US Anywhere, US North Central, US South Central, <br />Can co-locate storage account with compute account<br />Receive a 256 bit secret key when creating account<br />Storage Account Capacity at Commercial Availability<br />Each storage account can store up to 100 TB <br />Default limit of 5 storage accounts per subscription <br /></li> <li> 19. Blob Containers<br />Number of Blob Containers<br />Can have has many Blob Containers that will fit within the storage account limit <br />Blob Container<br />A container holds a set of blobs<br />Set access policies at the container level <br />Private or Public accessible<br />Associate Metadata with Container<br />Metadata are pairs<br />Up to 8KB per container<br />List the blobs in a container<br />Can now include Blob Metadata and MD5 (new)<br /></li> <li> 20. Blob Features and Functions<br />Store Large Objects (100s of GBs in size)<br />Associate Metadata with Blob<br />Metadata is pairs, Up to 8KB per blob<br />Set/Get with or separate from blob data bits<br />Standard REST Interface<br />PutBlob<br />Inserts a new blob, overwrites the existing blob<br />GetBlob<br />Get whole blob or a specific range<br />DeleteBlob<br />CopyBlob(new)<br />SnapshotBlob(new)<br />LeaseBlob(new)<br /></li> <li> 21. Blocks or Pages<br />Blob<br />Container<br />Account<br />Blob Storage ConceptsKey concepts account, container, blob and blocks/pages<br />IMG001.JPG<br />Pictures<br />IMG002.JPG<br />Account<br />Block/Page 1<br />Movies<br />MOV1.AVI<br />Block/Page 2<br />Block /Page 3<br /></li> <li> 22. Two Types of Blobs Under the Hood<br />Block Blob <br />Targeted at streaming workloads<br />Each blob consists of a sequence of blocks<br />Each block is identified by a Block ID<br />Size limit 200GB per blob<br />Page Blob (new)<br />Targeted at random read/write workloads<br />Each blob consists of an array of pages<br />Each page is identified by its offset from the start of the blob<br />Size limit 1TB per blob<br /></li> <li> 23. Block Blob Details<br />Block can be up to 4MB each<br />Each block can be variable size<br />Each block has a 64 byte ID<br />Scoped by blob name and stored with the blob<br />Block operation<br />PutBlock<br />Puts an uncommitted block defined by the block ID for the blob <br />Block List Operations<br />PutBlockList<br />Provide the list of blocks to comprise the readable version of the blob<br />Can use blocks from uncommitted or committed list to update blob<br />GetBlockList<br />Returns the list of blocks, committed or uncommitted for a blob<br />Block ID and Size of Block is returned for each block<br /></li> <li> 24. Page Blob Details<br />Page Blob is created with a Max Blob Size<br />Can change the max size of the blob at anytime.<br />Address space is broken up into fixed sized 512 byte pages for updates<br />Page update operations must be page aligned<br />PutPage- limited to 4MB<br />Overwrite range of pages starting at the specified offset<br />ClearPage- can specify up to max size of blob<br />Clear range of pages at the offset<br />Reading a Page Blob<br />GetBlob can read from any byte offset for any valid range<br />What parts of the Page Blob have stored pages in them<br />GetPageRange<br />Get valid page ranges in the blob<br />Only charged for pages with data stored in them<br /></li> <li> 25. Choosing Between Block and Page Blob <br />Block Blob<br />Targeted at streaming workloads<br />Update semantics<br />Upload a bunch of blocks. Then commit change.<br />Concurrency: ETag Checks<br />Page Blob<br />Targeted at random read/write workloads<br />Update Semantics<br />Immediate update<br />Concurrency: Leases<br /></li> <li> 26. Using Blobs<br />demo<br /></li> <li> 27. Summary Of Windows Azure Blobs<br />Blob Access Patterns<br />Block Blobs streaming<br />Page Blobs random read/write (new)<br />New Blob Operations<br />Copy, Snapshot, and Lease work for both types<br />New Ways of Accessing and Serving Blob Content (see MSDN)<br />Content Delivery Network access<br />Custom Domain Names<br />Root Blob Container<br />Shared Access Signatures <br />Additional new features<br />ListBlob, GetBlob, Blob Properties (see MSDN docs)<br /></li> <li> 28. Queues<br />Simple asynchronous dispatch queue<br />Create and delete queues<br />Message:<br />Retrieved at least once<br />Max size 8kb<br />Operations:<br />put<br />get<br />delete<br /></li> <li> 29. Queue Storage ConceptsAccount, queue and message<br />Message<br />Queue<br />Account<br />128x128, http://<br />Thumbnail Jobs<br />256x256, http://<br />Account<br />http://<br />Indexing Jobs<br />http://<br /></li> <li> 30. Using Queues<br />demo<br /></li> <li> 31. Summary Of Queues<br />Provide reliable message delivery<br />Allows Messages to be retrieved and processed at least once<br />No limit on number of messages stored in a Queue<br />Message size is</li></ul>


View more >