1 / 27

Developing Advanced Applications with Windows Azure

Developing Advanced Applications with Windows Azure. Steve Marx Technical Strategist Microsoft Corporation. Asynchronous Web/Worker Architecture. Worker Role. Worker Role. Worker Role. Web Role. Web Role. Web Role. LB. Storage. More Complex Architectures. LB. HTTP. XMPP. Web Role.

meris
Download Presentation

Developing Advanced Applications with 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. Developing Advanced Applications with Windows Azure Steve Marx Technical Strategist Microsoft Corporation

  2. Asynchronous Web/Worker Architecture Worker Role Worker Role Worker Role Web Role Web Role Web Role LB Storage

  3. More Complex Architectures LB HTTP XMPP Web Role Web Role Web Role Web Role Web Role Web Role Web Role Web Role Web Role Web Role Web Role Web Role Role F Role E Role A Role B Role D Role C Storage

  4. What We’ll Build Web Role Web Role IIS Port 80 Web Role Web Role Search LB Web Role Web Role SMTP Server Port 25 Storage

  5. Mindchive demo

  6. What We’ll Build • Three-role architecture • Web UI (ASP.NET MVC) • SMTP Server (TCPListener) • Search (Lucene.NET) • New features we’ll take advantage of • Inter-role communication • Non-HTTP endpoints • Role instance lifecycle • VM sizes • Local storage IIS Search LB SMTP Storage

  7. HOWTO: Model Your Application • Draw the boxes and arrows • Each box is a role • Which receive traffic from the internet? • Which need IIS? • Which receive internal communication? IIS Search LB SMTP Storage

  8. Receiving Traffic: Input Endpoints • Different ports on the same domain • Always load balanced • Declared in ServiceDefinition.csdef • Handled by IIS in web roles • Handled by your code in worker roles • API to find out what port to listen on

  9. Input Endpoints demo Web and SMTP

  10. An Aside About Email • Spammers will use Windows Azure • IP ranges can get blacklisted • Send mail via a relay • Receiving mail is fine

  11. Searching • Lucene.NET • Popular search API • .NET port of original Java implementation • Index data • Bring index up to speed on startup • Continually update index • Serve searches (via WCF)

  12. Asynchronous Work Without a Queue • Queues deliver messages to one worker • We need every worker to see the messages • Use a table instead • Build your own secondary index • Order references • (Beware of clock drift!)

  13. HOWTO: Do Initialization • Don’t want traffic until we’re listening • Role instance lifecycle lets us prepare • Both web roles and worker roles • OnStart() – “busy” state, initialization • Run() – do work • OnStop() – traffic stops, graceful shutdown

  14. HOWTO: Internal Endpoints • Declare endpoints in ServiceDefinition.csdef • API to find out what port to listen on:RoleEnvironment.CurrentRoleInstance .InstanceEndpoints["SearchIn"].IPEndpoint • API to find IP addresses of role instancesRoleEnvironment.Roles["Mindchive_Search"] .Instances[i].InstanceEndpoints["SearchIn"]

  15. OnStart and Internal Endpoints demo

  16. HOWTO: Get More RAM • RAMDirectory puts everything in memory • If we have lots of data, we need lots of RAM • Choose among four VM sizes: • Small • Medium • Large • Extra Large • Simple edit to ServiceDefinition.csdef<WorkerRole… vmsize= "ExtraLarge"/>

  17. HOWTO: Save the Index • Lucene.NET writes files to the local system • Preserve those across reboots/upgrades:<LocalStoragecleanOnRoleRecycle="false"/> • Consider writing state on OnStop()

  18. vmsize and cleanOnRecycle demo

  19. Using In-Place Upgrade • Rolling upgrade • Specify which roles to upgrade • Keep local storage intact • Great for stateful roles

  20. What We Built Web Role Web Role IIS Port 80 Web Role Web Role Search LB Web Role Web Role SMTP Server Port 25 Storage

  21. Recap • Any instance can talk to any other • Don’t need IIS to listen for traffic • Use the role instance lifecycle • Choose different VM sizes • In-place upgrades

  22. YOUR FEEDBACK IS IMPORTANT TO US! Please fill out session evaluation forms online at MicrosoftPDC.com

  23. Learn More On Channel 9 • Expand your PDC experience through Channel 9 • Explore videos, hands-on labs, sample code and demos through the new Channel 9 training courses channel9.msdn.com/learn Built by Developers for Developers….

  24. Questions? • Developer resources:http://dev.windowsazure.com/ • Me:http://blog.smarx.com (get the source!)http://twitter.com/smarx • Patterns for Building Scalable, Reliable Applications with Windows AzureBrad Calder (8:30am tomorrow)

More Related