Building Highly Scalable Java Applications on Windows Azure<br />David Chou<br />david.chou@microsoft.com<br />blogs.msdn....
>Introduction<br />Agenda<br />Overview of Windows Azure<br />Java How-to<br />Architecting for Scale<br />What’s Next<br />
>Azure Overview<br />What is Windows Azure?<br />A cloud computing platform(as-a-service)<br />on-demand application platf...
>Azure Overview<br />How this may be interesting to you<br />Not managing and interacting with server OS<br />less work fo...
> Azure Overview >Anatomy of a Windows Azure instance<br />Compute – instance types: Web Role & Worker Role. Windows Azure...
> Azure Overview > Application Platform Services<br />Application Platform Services<br />Application<br />Marketplace<br /...
> Azure Overview >Application Platform Services<br />Application Platform Services<br />Application Services<br />Hosting<...
>Java How-To<br />Java and Windows Azure<br />Provide your JVM<br />any version or flavor that runs on Windows<br />Provid...
> Java How-To > Boot-strapping<br />Some boot-strapping in C#<br />Kick-off process in WorkerRole.run()<br />get environme...
> Java How-To > Tomcat<br />Running Tomcat in Windows Azure<br />Service Instance<br />listen port(x)<br />Service Instanc...
> Java How-To > Jetty<br />Running Jetty in Windows Azure<br />Boot-strapping code in WorkerRole.run()<br />Service end po...
> Java How-To > Limitations<br />Current constraints<br />Platform<br />Dynamic networking<br /><your app>.cloudapp.net<br...
> Java How-To > Platform Enhancements<br />Improvements on the way<br />Platform<br />Networking control<br />fixed VM por...
> Java How-To >Platform Enhancements<br />Running Jetty with fixed VM ports<br />Boot-strapping code in WorkerRole.run()<b...
> Java How-To >Platform Enhancements<br />Running Jetty with admin mode<br />Execute startup script in ServiceDefinition.c...
> Java How-To >Platform Enhancements<br />Deployment Options<br />Worker Role<br />fabric sandbox native deployment<br />a...
> Azure Overview >Ideal Scenarios<br />What’s this good for?<br />Web Applications<br /><ul><li>massive scale infrastructure
burst & overflow capacity
temporary, ad-hoc sites</li></ul>Service Applications<br /><ul><li>composite applications
mobile/client connected services
Web API’s</li></ul>Hybrid Applications<br /><ul><li>component services
distributed processing
distributed data
external storage</li></ul>Media Applications<br /><ul><li>CGI rendering
content transcoding
media streaming</li></ul>Information Sharing<br /><ul><li>reference data
common data repositories
knowledge discovery & management</li></ul>Collaborative Processes<br /><ul><li>multi-enterprise integration
B2B & e-commerce
supply chain management
health & life sciences
domain-specific services</li></li></ul><li>> Architecting for Scale<br />Size matters<br />Facebook (2009)<br />+200B page...
> Architecting for Scale > Vertical Scaling<br />Traditional scale-up architecture<br />Common characteristics<br />synchr...
> Architecting for Scale >Vertical Scaling<br />Traditional scale-up architecture<br />To scale, get bigger servers<br />e...
> Architecting for Scale >Vertical Scaling<br />Traditional scale-up architecture<br />When problems occur<br />bigger fai...
> Architecting for Scale >Vertical Scaling<br />Traditional scale-up architecture<br />When problems occur<br />bigger fai...
> Architecting for Scale > Horizontal scaling<br />Use more pieces, not bigger pieces<br />LEGO 7778 Midi-scale Millennium...
356 pieces</li></ul>LEGO 10179 Ultimate Collector's Millennium Falcon<br /><ul><li>33 x 22 x 8.3 inches (L/W/H)
5,195 pieces</li></li></ul><li>> Architecting for Scale > Horizontal scaling<br />Scale-out architecture<br />Common chara...
> Architecting for Scale > Horizontal scaling<br />Scale-out architecture<br />To scale, add more servers<br />not bigger ...
> Architecting for Scale > Horizontal scaling<br />Scale-out architecture<br />When problems occur<br />smaller failure im...
> Architecting for Scale > Horizontal scaling<br />Scale-out architecture<br />When problems occur<br />smaller failure im...
> Architecting for Scale > Horizontal scaling<br />Scale-out architecture + distributed computing<br />parallel tasks<br /...
> Architecting for Scale > Horizontal scaling<br />Scale-out architecture + distributed computing<br />When problems occur...
> Architecting for Scale > Horizontal scaling<br />Scale-out architecture + distributed computing<br />When problems occur...
> Architecting for Scale >Cloud Architecture Patterns<br />Live Journal (from Brad Fitzpatrick, then Founder at Live Journ...
> Architecting for Scale >Cloud Architecture Patterns<br />Flickr (from Cal Henderson, then Director of Engineering at Yah...
> Architecting for Scale >Cloud Architecture Patterns<br />SlideShare(from John Boutelle, CTO at Slideshare, 2008)<br />We...
Upcoming SlideShare
Loading in …5
×

Building Highly Scalable Java Applications on Windows Azure - JavaOne S313978

8,839
-1

Published on

Presentation delivered at JavaOne 2010. Talks about how to use Java to build highly scalable and reliable applications on Windows Azure.

Published in: Technology
0 Comments
8 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
8,839
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
202
Comments
0
Likes
8
Embeds 0
No embeds

No notes for slide
  • Microsoft&apos;s Windows Azure platform is a virtualized and abstracted application platform that can be used to build highly scalable and reliable applications, with Java. The environment consists of a set of services such as NoSQL table storage, blob storage, queues, relational database service, internet service bus, access control, and more. Java applications can be built using these services via Web services APIs, and your own Java Virtual Machine, without worrying about the underlying server OS and infrastructure. Highlights of this session will include: • An overview of the Windows Azure environment • How to develop and deploy Java applications in Windows Azure • How to architect horizontally scalable applications in Windows Azure
  • To build for big scale – use more of the same pieces, not bigger pieces; though a different approach may be needed
  • Building Highly Scalable Java Applications on Windows Azure - JavaOne S313978

    1. 1. Building Highly Scalable Java Applications on Windows Azure<br />David Chou<br />david.chou@microsoft.com<br />blogs.msdn.com/dachou<br />
    2. 2. >Introduction<br />Agenda<br />Overview of Windows Azure<br />Java How-to<br />Architecting for Scale<br />What’s Next<br />
    3. 3. >Azure Overview<br />What is Windows Azure?<br />A cloud computing platform(as-a-service)<br />on-demand application platform capabilities<br />geo-distributed Microsoft data centers<br />automated, model-driven services provisioning and management<br />You manage code, data, content, policies, service models, etc.<br />not servers (unless you want to)<br />We manage the platform<br />application containers and services, distributed storage systems<br />service lifecycle, data replication and synchronization<br />server operating system, patching, monitoring, management<br />physical infrastructure, virtualization networking<br />security<br />“fabric controller” (automated, distributed service management system)<br />
    4. 4. >Azure Overview<br />How this may be interesting to you<br />Not managing and interacting with server OS<br />less work for you<br />don’t have to care it is “Windows Server” (you can if you want to)<br />but have to live with some limits and constraints<br />Some level of control<br />process isolation (runs inside your own VM/guest OS)<br />service and data geo-location<br />allocated capacity, scale on-demand<br />full spectrum of application architectures and programming models<br />You can run Java!<br />plus PHP, Python, Ruby, MySQL, memcached, etc.<br />and eventually anything that runs on Windows<br />
    5. 5. > Azure Overview >Anatomy of a Windows Azure instance<br />Compute – instance types: Web Role & Worker Role. Windows Azure applications are built with web role instances, worker role instances, or a combination of both.<br />Storage – distributed storage systems that are highly consistent, reliable, and scalable.<br />Anatomy of a Windows Azure instance<br />HTTP/HTTPS<br />Each instance runs on its own VM (virtual machine) and local transient storage; replicated as needed<br />Guest VM<br />Guest VM<br />Guest VM<br />Host VM<br />Maintenance OS,<br />Hardware-optimized hypervisor<br />The Fabric Controller communicates with every server within the Fabric. It manages Windows Azure, monitors every application, decides where new applications should run – optimizing hardware utilization.<br />
    6. 6. > Azure Overview > Application Platform Services<br />Application Platform Services<br />Application<br />Marketplace<br />Information Marketplace<br />Personal Data Repository<br />Application Services<br />Workflow Hosting<br />Distributed Cache<br />Services Hosting<br />Frameworks<br />Claims-Based Identity<br />Federated Identities<br />Secure Token Service<br />Declarative Policies<br />Security<br />Registry<br />On-Premise Bridging<br />Service Bus<br />Connectivity<br />Transact-SQL<br />Data Synchronization<br />Relational Database<br />ADO.NET, ODBC, PHP<br />Data<br />Compute<br />C / C++<br />Win32<br />VHD<br />Dynamic Tabular Data<br />Blobs<br />Message Queues<br />Distributed File System<br />Content Distribution<br />Storage<br />
    7. 7. > Azure Overview >Application Platform Services<br />Application Platform Services<br />Application Services<br />Hosting<br />Caching<br />Frameworks<br />WIF, ADFS2, MFG<br />Security<br />Access Control<br />“Sydney”<br />Connectivity<br />Service Bus<br />SQL Azure Data Sync<br />“Houston”<br />Data<br />VM Role<br />Compute<br />Table Storage<br />Blob Storage<br />Queue<br />Drive<br />Content Delivery Network<br />Storage<br />
    8. 8. >Java How-To<br />Java and Windows Azure<br />Provide your JVM<br />any version or flavor that runs on Windows<br />Provide your code<br />no programming constraints (e.g., whitelisting libraries, execution time limit, multi-threading, etc.)<br />use existing frameworks<br />use your preferred tools (Eclipse, emacs, etc.)<br />File-based deployment<br />no OS-level installation(conceptually extracting a tar/zip with run.bat)<br />Windows Azure “Worker Role” sandbox<br />standard user (non-admin privileges; “full trust” environment)<br />native code execution (via launching sub-processes)<br />service end points (behind VIPs and load balancers)<br />
    9. 9. > Java How-To > Boot-strapping<br />Some boot-strapping in C#<br />Kick-off process in WorkerRole.run()<br />get environment info (assigned end point ports, file locations)<br />set up local storage (if needed; for configuration, temp files, etc.)<br />configure diagnostics (Windows Server logging subsystem for monitoring)<br />launch sub-process(es) to run executable (launch the JVM)<br />Additional hooks (optional)<br />Manage role lifecycle<br />Handle dynamic configuration changes<br />Free tools<br />Visual Studio Express<br />Windows Azure Tools for Visual Studio<br />Windows Azure SDK<br />
    10. 10. > Java How-To > Tomcat<br />Running Tomcat in Windows Azure<br />Service Instance<br />listen port(x)<br />Service Instance<br />Worker Role<br />Sub-Process<br />Tomcat<br />server.xml<br />Catalina<br />index.jsp<br />new Process()<br />RoleEntry Point<br />bind port(x)<br />get<br />runtime<br />info<br />SQL Database<br /> JVM<br />http://instance:x<br />http://instance:y<br />Service<br />Bus<br />Access Control<br />http://app:80<br />Fabric Controller<br />Load Balancer<br />Table<br />Storage<br />Blob<br />Storage<br />Queue<br />
    11. 11. > Java How-To > Jetty<br />Running Jetty in Windows Azure<br />Boot-strapping code in WorkerRole.run()<br />Service end point(s) in ServiceDefinition.csdef<br />string response = ""; try{     System.IO.StreamReadersr;     string port = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["HttpIn"].IPEndpoint.Port.ToString();     stringroleRoot = Environment.GetEnvironmentVariable("RoleRoot");     stringjettyHome = roleRoot + @"approotappjetty7";     stringjreHome = roleRoot + @"approotappjre6";     Processproc = newProcess();     proc.StartInfo.UseShellExecute = false;     proc.StartInfo.RedirectStandardOutput = true;     proc.StartInfo.FileName = String.Format(""{0}inava.exe"", jreHome);     proc.StartInfo.Arguments = String.Format("-Djetty.port={0} -Djetty.home="{1}" -jar "{1}tart.jar"", port, jettyHome);     proc.EnableRaisingEvents = false;     proc.Start();     sr = proc.StandardOutput;     response = sr.ReadToEnd();} catch(Exception ex) {     response = ex.Message;     Trace.TraceError(response); } <br /><Endpoints> <InputEndpointname="HttpIn"port="80"protocol="tcp" /></Endpoints> <br />
    12. 12. > Java How-To > Limitations<br />Current constraints<br />Platform<br />Dynamic networking<br /><your app>.cloudapp.net<br />no naked domain<br />CNAME re-direct from custom domain<br />sending traffic to loopback addresses not allowed and cannot open arbitrary ports<br />No OS-level access<br />Non-persistent local file system<br />allocate local storage directory<br />read-only: Windows directory, machine configuration files, service configuration files<br />Available registry resources<br />read-only: HKEY_CLASSES_ROOT, HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CURRENT_CONFIG<br />full access: HKEY_CURRENT_USER<br />Java<br />Sandboxed networking<br />NIO (java.nio) not supported<br />engine and host-level clustering<br />JNDI, JMS, JMX, RMI, etc.<br />need to configure networking<br />Non-persistent local file system<br />logging, configuration, etc.<br />REST-based APIs to services<br />Table Storage – schema-less (noSQL)<br />Blob Storage – large files (<200GB block blobs; <1TB page blobs)<br />Queues<br />Service Bus<br />Access Control<br />
    13. 13. > Java How-To > Platform Enhancements<br />Improvements on the way<br />Platform<br />Networking control<br />fixed VM ports (e.g., match external ports)<br />fixed and ranges for inter-role ports<br />inter-role communication access control<br />Plugins<br />diagnostics<br />Intellitrace<br />remote desktop<br />Full IIS<br />multiple websites in same role<br />virtual directories<br />applications, modules<br />Admin mode<br />OS-level installations and configurations<br />VM Role<br />run your own Windows Server-based VM<br />Java<br />Traditional deployment models<br />deploy your own Java EE stack<br />configure internal networking<br />More frameworks, packages, and extended languages<br />verify deployment and configuration<br />Solution accelerators <br />with bootstrapping and configuration<br />Java API support<br />map to lower-level services<br />
    14. 14. > Java How-To >Platform Enhancements<br />Running Jetty with fixed VM ports<br />Boot-strapping code in WorkerRole.run()<br />Service end point(s) in ServiceDefinition.csdef<br />string response = ""; try{     System.IO.StreamReadersr;     string port = "80";    stringroleRoot = Environment.GetEnvironmentVariable("RoleRoot");     stringjettyHome = roleRoot + @"approotappjetty7";     stringjreHome = roleRoot + @"approotappjre6";     Processproc = newProcess();     proc.StartInfo.UseShellExecute = false;     proc.StartInfo.RedirectStandardOutput = true;     proc.StartInfo.FileName = String.Format(""{0}inava.exe"", jreHome);     proc.StartInfo.Arguments = String.Format("-Djetty.port={0} -Djetty.home="{1}" -jar "{1}tart.jar"", port, jettyHome);     proc.EnableRaisingEvents = false;     proc.Start();     sr = proc.StandardOutput;     response = sr.ReadToEnd();} catch(Exception ex) {     response = ex.Message;     Trace.TraceError(response); } <br /><Endpoints><InputEndpointname="HttpIn"protocol=“http"port="80"localPort="80"/></Endpoints> <br />
    15. 15. > Java How-To >Platform Enhancements<br />Running Jetty with admin mode<br />Execute startup script in ServiceDefinition.csdef<br /><Startup><TaskcommandLine=“runme.cmd"executionContext=“elevated"askType=“simple"> </Task></Startup> <br />
    16. 16. > Java How-To >Platform Enhancements<br />Deployment Options<br />Worker Role<br />fabric sandbox native deployment<br />automated, need additional code<br />available now<br />Admin Mode<br />script-based installation and execution<br />automated, need scripts<br />available shortly<br />Remote Desktop<br />login remotely and manually install<br />manual, full control<br />available shortly<br />VM Role<br />host your own pre-configured VM image<br />automated, full control<br />available later<br />
    17. 17. > Azure Overview >Ideal Scenarios<br />What’s this good for?<br />Web Applications<br /><ul><li>massive scale infrastructure
    18. 18. burst & overflow capacity
    19. 19. temporary, ad-hoc sites</li></ul>Service Applications<br /><ul><li>composite applications
    20. 20. mobile/client connected services
    21. 21. Web API’s</li></ul>Hybrid Applications<br /><ul><li>component services
    22. 22. distributed processing
    23. 23. distributed data
    24. 24. external storage</li></ul>Media Applications<br /><ul><li>CGI rendering
    25. 25. content transcoding
    26. 26. media streaming</li></ul>Information Sharing<br /><ul><li>reference data
    27. 27. common data repositories
    28. 28. knowledge discovery & management</li></ul>Collaborative Processes<br /><ul><li>multi-enterprise integration
    29. 29. B2B & e-commerce
    30. 30. supply chain management
    31. 31. health & life sciences
    32. 32. domain-specific services</li></li></ul><li>> Architecting for Scale<br />Size matters<br />Facebook (2009)<br />+200B pageviews /month<br />>3.9T feed actions /day<br />+300M active users<br />>1B chat mesgs /day<br />100M search queries /day<br />>6B minutes spent /day (ranked #2 on Internet)<br />+20B photos, +2B/month growth<br />600,000 photos served /sec<br />25TB log data /day processed thru Scribe<br />120M queries /sec on memcache<br />Twitter (2009)<br />600 requests /sec<br />avg 200-300 connections /sec; peak at 800<br />MySQL handles 2,400 requests /sec<br />30+ processes for handling odd jobs<br />process a request in 200 milliseconds in Rails<br />average time spent in the database is 50-100 milliseconds<br />+16 GB of memcached<br />Google (2007)<br />+20 petabytes of data processed /day by +100K MapReduce jobs <br />1 petabyte sort took ~6 hours on ~4K servers replicated onto ~48K disks<br />+200 GFS clusters, each at 1-5K nodes, handling +5 petabytes of storage<br />~40 GB /sec aggregate read/write throughput across the cluster<br />+500 servers for each search query < 500ms<br />>1B views / day on Youtube (2009)<br />Myspace(2007)<br />115B pageviews /month<br />5M concurrent users @ peak<br />+3B images, mp3, videos<br />+10M new images/day<br />160 Gbit/sec peak bandwidth<br />Flickr (2007)<br />+4B queries /day<br />+2B photos served<br />~35M photos in squid cache<br />~2M photos in squid’s RAM <br />38k req/sec to memcached (12M objects) <br />2 PB raw storage<br />+400K photos added /day<br />
    33. 33. > Architecting for Scale > Vertical Scaling<br />Traditional scale-up architecture<br />Common characteristics<br />synchronous processes<br />sequential units of work<br />tight coupling<br />stateful<br />pessimistic concurrency<br />clustering for HA<br />vertical scaling<br />units of work<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />
    34. 34. > Architecting for Scale >Vertical Scaling<br />Traditional scale-up architecture<br />To scale, get bigger servers<br />expensive<br />has scaling limits<br />inefficient use of resources<br />app server<br />web<br />data store<br />app server<br />web<br />
    35. 35. > Architecting for Scale >Vertical Scaling<br />Traditional scale-up architecture<br />When problems occur<br />bigger failure impact<br />data store<br />app server<br />web<br />app server<br />web<br />
    36. 36. > Architecting for Scale >Vertical Scaling<br />Traditional scale-up architecture<br />When problems occur<br />bigger failure impact<br />more complex recovery<br />app server<br />web<br />data store<br />web<br />
    37. 37. > Architecting for Scale > Horizontal scaling<br />Use more pieces, not bigger pieces<br />LEGO 7778 Midi-scale Millennium Falcon<br /><ul><li>9.3 x 6.7 x 3.2 inches (L/W/H)
    38. 38. 356 pieces</li></ul>LEGO 10179 Ultimate Collector's Millennium Falcon<br /><ul><li>33 x 22 x 8.3 inches (L/W/H)
    39. 39. 5,195 pieces</li></li></ul><li>> Architecting for Scale > Horizontal scaling<br />Scale-out architecture<br />Common characteristics<br />small logical units of work<br />loosely-coupled processes<br />stateless<br />event-driven design<br />optimistic concurrency<br />partitioned data<br />redundancy fault-tolerance<br />re-try-based recoverability<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />
    40. 40. > Architecting for Scale > Horizontal scaling<br />Scale-out architecture<br />To scale, add more servers<br />not bigger servers<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />
    41. 41. > Architecting for Scale > Horizontal scaling<br />Scale-out architecture<br />When problems occur<br />smaller failure impact<br />higher perceived availability<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />
    42. 42. > Architecting for Scale > Horizontal scaling<br />Scale-out architecture<br />When problems occur<br />smaller failure impact<br />higher perceived availability<br />simpler recovery<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />web<br />app server<br />data store<br />web<br />data store<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />
    43. 43. > Architecting for Scale > Horizontal scaling<br />Scale-out architecture + distributed computing<br />parallel tasks<br />Scalable performance at extreme scale<br />asynchronous processes<br />parallelization<br />smaller footprint<br />optimized resource usage<br />reduced response time<br />improved throughput<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />web<br />app server<br />data store<br />app server<br />web<br />data store<br />perceived response time<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />async tasks<br />
    44. 44. > Architecting for Scale > Horizontal scaling<br />Scale-out architecture + distributed computing<br />When problems occur<br />smaller units of work<br />decoupling shields impact<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />web<br />app server<br />data store<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />
    45. 45. > Architecting for Scale > Horizontal scaling<br />Scale-out architecture + distributed computing<br />When problems occur<br />smaller units of work<br />decoupling shields impact<br />even simpler recovery<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />web<br />app server<br />data store<br />app server<br />web<br />data store<br />app server<br />web<br />data store<br />web<br />data store<br />
    46. 46. > Architecting for Scale >Cloud Architecture Patterns<br />Live Journal (from Brad Fitzpatrick, then Founder at Live Journal, 2007)<br />Web Frontend<br />Apps & Services<br />Partitioned Data<br />Distributed<br />Cache<br />Distributed Storage<br />
    47. 47. > Architecting for Scale >Cloud Architecture Patterns<br />Flickr (from Cal Henderson, then Director of Engineering at Yahoo, 2007)<br />Web Frontend<br />Apps & Services<br />Distributed Storage<br />Distributed<br />Cache<br />Partitioned Data<br />
    48. 48. > Architecting for Scale >Cloud Architecture Patterns<br />SlideShare(from John Boutelle, CTO at Slideshare, 2008)<br />Web<br />Frontend<br />Apps &<br />Services<br />Distributed Cache<br />Partitioned Data<br />Distributed Storage<br />
    49. 49. > Architecting for Scale >Cloud Architecture Patterns<br />Twitter (from John Adams, Ops Engineer at Twitter, 2010)<br />Web<br />Frontend<br />Apps &<br />Services<br />Partitioned<br />Data<br />Queues<br />Async<br />Processes<br />Distributed<br />Cache<br />Distributed<br />Storage<br />
    50. 50. > Architecting for Scale >Cloud Architecture Patterns<br />Distributed<br />Storage<br />Facebook<br />(from Jeff Rothschild, VP Technology at Facebook, 2009)<br />2010 stats (Source: http://www.facebook.com/press/info.php?statistics)<br />People<br />+500M active users<br />50% of active users log on in any given day<br />people spend +700B minutes /month<br />Activity on Facebook<br />+900M objects that people interact with<br />+30B pieces of content shared /month<br />Global Reach<br />+70 translations available on the site<br />~70% of users outside the US<br />+300K users helped translate the site through the translations application<br />Platform<br />+1M developers from +180 countries<br />+70% of users engage with applications /month<br />+550K active applications<br />+1M websites have integrated with Facebook Platform <br />+150M people engage with Facebook on external websites /month<br />Web<br />Frontend<br />Apps &<br />Services<br />Distributed<br />Cache<br />Parallel<br />Processes<br />Partitioned<br />Data<br />Async<br />Processes<br />
    51. 51. > Architecting for Scale > Cloud Architecture Patterns<br />Windows Azure platform components<br />Apps & Services<br />Web Frontend<br />Distributed<br />Cache<br />Partitioned Data<br />Distributed Storage<br />Queues<br />Content Delivery Network<br />Load Balancer<br />IIS<br />Web Server<br />VM Role<br />Worker Role<br />Web Role<br />Caching<br />Queues<br />Access Control<br />Hosting<br />Blobs<br />Relational Database<br />Tables<br />Drives<br />Service Bus<br />Reporting & Analysis<br />Data Synchronization<br />Virtual Private Network<br />Services<br />
    52. 52. >Architecting for Scale<br />Fundamental concepts<br />Vertical scaling still works<br />
    53. 53. >Architecting for Scale<br />Fundamental concepts<br />Horizontal scaling for cloud computing<br />Small pieces, loosely coupled<br />Distributed computing best practices<br />asynchronous processes (event-driven design)<br />parallelization<br />idempotent operations (handle duplicity)<br />de-normalized, partitioned data (sharding)<br />shared nothing architecture<br />optimistic concurrency<br />fault-tolerance by redundancy and replication<br />etc.<br />
    54. 54. > Architecting for Scale >Fundamental Concepts<br />Asynchronous processes & parallelization<br />Defer work as late as possible<br />return to user as quickly as possible<br />event-driven design (instead of request-driven)<br />Cloud computing friendly<br />distributes work to more servers (divide & conquer)<br />smaller resource usage/footprint<br />smaller failure surface<br />decouples process dependencies<br />Windows Azure platform services<br />Queue Service<br />AppFabric Service Bus<br />inter-node communication<br />Worker Role<br />Web Role<br />Queues<br />Service Bus<br />Web Role<br />Web Role<br />Web Role<br />Worker Role<br />Worker Role<br />Worker Role<br />
    55. 55. > Architecting for Scale >Fundamental Concepts<br />Partitioned data<br />Shared nothing architecture<br />transaction locality (partition based on an entity that is the “atomic” target of majority of transactional processing)<br />loosened referential integrity (avoid distributed transactions across shard and entity boundaries)<br />design for dynamic redistribution and growth of data (elasticity)<br />Cloud computing friendly<br />divide & conquer<br />size growth with virtually no limits<br />smaller failure surface<br />Windows Azure platform services<br />Table Storage Service<br />SQL Azure<br />AppFabric Caching (coming soon)<br />SQL Azure DB federation (coming soon)<br />read<br />Web Role<br />Queues<br />Web Role<br />Web Role<br />Worker Role<br />Relational Database<br />Relational Database<br />Relational Database<br />Web Role<br />write<br />
    56. 56. > Architecting for Scale >Fundamental Concepts<br />Idempotent operations<br />Repeatable processes<br />allow duplicates (additive)<br />allow re-tries (overwrite)<br />reject duplicates (optimistic locking)<br />stateless design<br />Cloud computing friendly<br />resiliency<br />Windows Azure platform services<br />Queue Service<br />AppFabric Service Bus<br />Worker Role<br />Service Bus<br />Worker Role<br />Worker Role<br />
    57. 57. > Architecting for Scale >Fundamental Concepts<br />CAP (Consistency, Availability, Partition) Theorem<br />At most two of these properties for any shared-data system<br />Consistency + Availability <br /><ul><li>High data integrity
    58. 58. Single site, cluster database, LDAP, xFS file system, etc.
    59. 59. 2-phase commit, data replication, etc.</li></ul>A<br />C<br />A<br />A<br />C<br />C<br />Consistency + Partition <br /><ul><li>Distributed database, distributed locking, etc.
    60. 60. Pessimistic locking, minority partition unavailable, etc.</li></ul>P<br />P<br />P<br />Availability + Partition <br /><ul><li>High scalability
    61. 61. Distributed cache, DNS, etc.
    62. 62. Optimistic locking, expiration/leases, etc.</li></ul>“Towards Robust Distributed Systems”, Dr. Eric A. Brewer, UC Berkeley<br />
    63. 63. > Architecting for Scale >Fundamental Concepts<br />Hybrid architectures<br />Scale-out (horizontal)<br />BASE: Basically Available, Soft state, Eventually consistent<br />focus on “commit”<br />conservative (pessimistic)<br />shared nothing<br />favor extreme size<br />e.g., user requests, data collection & processing, etc.<br />Scale-up (vertical)<br />ACID: Atomicity, Consistency, Isolation, Durability<br />availability first; best effort<br />aggressive (optimistic)<br />transactional<br />favor accuracy/consistency<br />e.g., BI & analytics, financial processing, etc.<br /> Most distributed systems employ both approaches<br />
    64. 64. > What’s Next<br />Roadmap (high-level sampling; subject to change)<br />2010<br /><ul><li>commercial launch
    65. 65. increased SQL Azure DB sizes
    66. 66. IntelliTrace
    67. 67. guest OS v1.1-1.6
    68. 68. SDK v1.1-1.2
    69. 69. SDK v1.3
    70. 70. admin mode
    71. 71. full IIS
    72. 72. remote desktop
    73. 73. networking enhancements
    74. 74. service model updates
    75. 75. developer portal v2
    76. 76. access control v2</li></ul>2011<br /><ul><li>VM role
    77. 77. data synchronization service
    78. 78. virtual private network
    79. 79. service bus v2
    80. 80. distributed caching
    81. 81. pipeline & container (service hosting)
    82. 82. data reporting services
    83. 83. database federation</li></ul>2012<br /><ul><li>data analysis services
    84. 84. data cleansing service
    85. 85. Windows Azure Appliance</li></li></ul><li>Thank you!<br />David Chou<br />david.chou@microsoft.com<br />blogs.msdn.com/dachou<br />© 2010 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 />
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×