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 />
>Azure Overview<br />What is Windows Azure?<br />A cloud computing platform(as-a-service)<br />on-demand application platf...
> 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 />Marketplace<br />Application<br /...
> Azure Overview >Application Platform Services<br />Application Platform Services<br />Applications<br />DataMarket<br />...
>Azure Overview<br />How this may be interesting to you<br />Not managing and interacting with server OS<br />less work fo...
>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 >Deployment<br />Deployment Options<br />Worker Role (using C# boot-strapping)<br />fabric sandbox native de...
> Java How-To > Tomcat (SDK 1.2-based)<br />Running Tomcat in Windows Azure<br />Service Instance<br />listen port(x)<br /...
> Java How-To > Jetty (SDK 1.2-based)<br />Running Jetty in Windows Azure<br />Boot-strapping code in WorkerRole.run()<br ...
> Java How-To >Jetty (SDK 1.3-based)<br />Running Jetty with admin access + fixed ports<br />Execute startup script in Ser...
> Java How-To >GlassFish (using script; SDK 1.3-based)<br />Running GlassFish<br />Execute startup script in ServiceDefini...
> Java How-To >GlassFish (SDK 1.3-based)<br />Running GlassFish in Windows Azure<br />Service Instance<br />Service Instan...
> Java How-To > Limitations<br />Current constraints<br />Platform<br />Dynamic networking<br /><your app>.cloudapp.net<br...
> Java How-To >Eclipse (announced; not yet released)<br />Windows Azure Tools for Eclipse/Java<br />Runtime<br />Multiple ...
> Java How-To > SQL Azure<br />Accessing SQL Azure from Java<br />SQL Azure Database <br />Full relational Database as a S...
> Java How-To > Windows Azure Storage<br />Accessing Windows Azure Storage from Java<br />Windows Azure SDK for Java<br />...
> Java How-To > Windows Azure AppFabric<br />Accessing Windows Azure AppFabricfrom Java<br />Usage Patterns<br />Extends r...
> Cloud Scenarios<br />Additional Cloud Interop Options<br />Cloud<br />On-premises<br />Data Synchronization<br />SQL Azu...
> Architecting for Scale<br />Size matters<br />Facebook (2009)<br />+200B pageviews /month<br />>3.9T feed actions /day<b...
> 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...
> Architecting for Scale >Cloud Architecture Patterns<br />Twitter (from John Adams, Ops Engineer at Twitter, 2010)<br />W...
> Architecting for Scale >Cloud Architecture Patterns<br />Distributed<br />Storage<br />Facebook<br />(from Jeff Rothschi...
> Architecting for Scale > Cloud Architecture Patterns<br />Windows Azure platform components<br />Apps & Services<br />We...
>Architecting for Scale<br />Fundamental concepts<br />Vertical scaling still works<br />
>Architecting for Scale<br />Fundamental concepts<br />Horizontal scaling for cloud computing<br />Small pieces, loosely c...
> Architecting for Scale >Fundamental Concepts<br />Partitioned data<br />Shared nothing architecture<br />transaction loc...
> Architecting for Scale >Fundamental Concepts<br />Asynchronous processes & parallelization<br />Defer work as late as po...
Upcoming SlideShare
Loading in...5
×

Java on Windows Azure

4,687

Published on

Deck delivered at Javagruppen Arskonference 2011 in Denmark

Published in: Technology
1 Comment
4 Likes
Statistics
Notes
No Downloads
Views
Total Views
4,687
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
84
Comments
1
Likes
4
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
  • Source: http://danga.com/words/2007_06_usenix/usenix.pdf
  • Source: http://highscalability.com/blog/2007/11/13/flickr-architecture.html
  • Source: http://www.slideshare.net/jboutelle/scalable-web-architectures-w-ruby-and-amazon-s3
  • Source: http://www.slideshare.net/netik/billions-of-hits-scaling-twitterSource: http://highscalability.com/blog/2009/6/27/scaling-twitter-making-twitter-10000-percent-faster.html
  • Source: http://highscalability.com/blog/2009/10/12/high-performance-at-massive-scale-lessons-learned-at-faceboo-1.html
  • Picture source: http://pdp.protopak.net/Belltheous90/DeathStarII.gif
  • Java on Windows Azure

    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 />
    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 >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 />
    5. 5. > Azure Overview > Application Platform Services<br />Application Platform Services<br />Marketplace<br />Application<br />Marketplace<br />Information Marketplace<br />Frameworks<br />Workflow Hosting<br />Distributed Cache<br />Services Hosting<br />Security<br />Claims-Based Identity<br />Federated Identities<br />Secure Token Service<br />Declarative Policies<br />Integration<br />Messasging<br />Registry<br />Service Bus<br />Data<br />Transact-SQL<br />Data Synchronization<br />Relational Database<br />ADO.NET, ODBC, PHP<br />Compute<br />C / C++<br />Win32<br />VHD<br />Storage<br />Dynamic Tabular Data<br />Blobs<br />Message Queues<br />Distributed File System<br />Content Distribution<br />On-Premises Bridging<br />Networking<br />
    6. 6. > Azure Overview >Application Platform Services<br />Application Platform Services<br />Applications<br />DataMarket<br />Marketplace<br />Composite App<br />Caching<br />Frameworks<br />Access Control<br />Security<br />Integration<br />Connect<br />(BizTalk)<br />Service Bus<br />Integration<br />Relational Database<br />Reporting<br />DataSync<br />Data<br />VM Role<br />Web Role<br />Worker Role<br />Compute<br />Storage<br />Table Storage<br />Blob Storage<br />Queue<br />Drive<br />Content Delivery Network<br />Connect<br />Networking<br />
    7. 7. >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 />
    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 />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 >Deployment<br />Deployment Options<br />Worker Role (using C# boot-strapping)<br />fabric sandbox native deployment<br />automated, need additional code<br />Worker Role (using scripts)<br />script-based installation and execution<br />automated, need scripts<br />VM Role<br />host your own pre-configured Windows Server 2008 R2 Enterprise x64 VM image<br />automated, full control<br />available shortly (in beta)<br />
    10. 10. > Java How-To > Tomcat (SDK 1.2-based)<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 (SDK 1.2-based)<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}binjava.exe"", jreHome);     proc.StartInfo.Arguments = String.Format("-Djetty.port={0} -Djetty.home="{1}" -jar "{1}start.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 >Jetty (SDK 1.3-based)<br />Running Jetty with admin access + fixed ports<br />Execute startup script in ServiceDefinition.csdef<br />Service end point(s) in ServiceDefinition.csdef<br /><Startup><TaskcommandLine=“runme.cmd"executionContext=“elevated"TaskType=“background"> </Task></Startup> <br /><Endpoints><InputEndpointname="HttpIn"protocol=“http"port="80"localPort="80"/></Endpoints> <br />
    13. 13. > Java How-To >GlassFish (using script; SDK 1.3-based)<br />Running GlassFish<br />Execute startup script in ServiceDefinition.csdef<br />Service end point(s) in ServiceDefinition.csdef<br /><Startup><TaskcommandLine=“Run.cmd"executionContext=“limited"TaskType=“background"> </Task></Startup> <br /><Endpoints><InputEndpointname="Http_Listener_1"protocol=“tcp"port="80"localPort="8080" /><InputEndpointname="Http_Listener_2"protocol=“tcp"port="8181"localPort="8181"/><InputEndpointname=“Admin_Listener"protocol=“tcp"port=“4848"localPort=“4848"/><InputEndpointname=“JMX_Connector_Port"protocol=“tcp"port=“8686"localPort=“8686"/> <InputEndpointname=“Remote_Debug_Port"protocol=“tcp"port=“9009"localPort=“9009"/></Endpoints> <br />
    14. 14. > Java How-To >GlassFish (SDK 1.3-based)<br />Running GlassFish in Windows Azure<br />Service Instance<br />Service Instance<br />Worker Role<br />Sub-Process<br />GlassFish<br />script<br />Startup<br />Command<br />SQL Database<br /> JVM<br />http://instance:8080<br />http://instance:8080<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 />
    15. 15. > 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 />can declare up to 5 specific ports be opened, or port ranges; cannot open arbitrary ports<br />Non-persistent local file system<br />allocate local storage directory<br />read-only: Windows directory, machine configuration files, service configuration files<br />Stateless application model<br />round-robin traffic distribution used dynamic load balancer; no sticky sessions<br />Java<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 />
    16. 16. > Java How-To >Eclipse (announced; not yet released)<br />Windows Azure Tools for Eclipse/Java<br />Runtime<br />Multiple Java app servers<br />Any Windows-based JRE<br />Supports<br />Windows Azure Storage<br />Windows Azure Drive<br />Windows Azure AppFabric<br />SQL Azure<br />One-click cloud deployment<br />Integrated diagnostics, monitoring, and logging<br />
    17. 17. > Java How-To > SQL Azure<br />Accessing SQL Azure from Java<br />SQL Azure Database <br />Full relational Database as a Service<br />Supports TDS & OData<br />Direct connectivity to SQL Azure<br />Connect with JDBC/ODBC using the latest driver<br />Eclipse tooling support<br />Interoperability using REST<br />Easily wrap SQL Azure with WCF Data Services<br />Restlet extension for OData (Java)<br />Committed to OSS support and app compatibility<br />
    18. 18. > Java How-To > Windows Azure Storage<br />Accessing Windows Azure Storage from Java<br />Windows Azure SDK for Java<br />Enables Java developers to develop against Windows Azure Storage & Service Management infrastructure using familiar & consistent programming model<br />Features<br />Set of Java classes for Windows Azure Blobs, Tables & Queues (for CRUD operations) & Service Management<br />Helper Classes for HTTP transport, AuthN/AuthZ, REST & Error Management<br />Manageability, Instrumentation & Logging(log4j)<br />Open Source Project site: <br />Developed by our Partner Soyatec<br />www.windowsazure4j.org <br />Your Java application<br />REST<br />Compute<br />Storage<br />Manage<br />
    19. 19. > Java How-To > Windows Azure AppFabric<br />Accessing Windows Azure AppFabricfrom Java<br />Usage Patterns<br />Extends reach of applications securely through the cloud<br />Securely integrates partners outside of org boundaries<br />Extends reach of on-premises web services layer<br />Enables leveraging cloud quickly without having to rewrite apps<br />App Fabric SDK for Java Developers<br />Open source software development kit (SDK) <br />a set of libraries, tools, Prescriptive guidance<br />sample applications <br />Open Source Project site: <br />Developed by our partner Persistent Systems Limited<br />www.jdotnetservices.com<br />
    20. 20. > Cloud Scenarios<br />Additional Cloud Interop Options<br />Cloud<br />On-premises<br />Data Synchronization<br />SQL Azure Data Sync<br />Application-layer <br />Connectivity & Messaging <br />AppFabric Service Bus<br />Security & <br />Federated IdentityAppFabricAccess Control<br />Secure Network Connectivity<br />Virtual Network Connect<br />
    21. 21. > 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 />Source: multiple articles, High Scalability<br />http://highscalability.com/<br />
    22. 22. > 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 />
    23. 23. > 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 />
    24. 24. > 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 />
    25. 25. > 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 />
    26. 26. > 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)
    27. 27. 356 pieces</li></ul>LEGO 10179 Ultimate Collector's Millennium Falcon<br /><ul><li>33 x 22 x 8.3 inches (L/W/H)
    28. 28. 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 />
    29. 29. > 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 />
    30. 30. > 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 />
    31. 31. > 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 />
    32. 32. > 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 />
    33. 33. > 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 />
    34. 34. > 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 />
    35. 35. > 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 />
    36. 36. > 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 />
    37. 37. > 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 />
    38. 38. > 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 />
    39. 39. > 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 />
    40. 40. > 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 />Composite App<br />Blobs<br />Relational Database<br />Tables<br />Drives<br />Service Bus<br />Reporting<br />DataSync<br />Virtual Network<br />Connect<br />Services<br />
    41. 41. >Architecting for Scale<br />Fundamental concepts<br />Vertical scaling still works<br />
    42. 42. >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 />
    43. 43. > 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 />
    44. 44. > 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 />
    45. 45. > 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 />
    46. 46. > 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
    47. 47. Single site, cluster database, LDAP, xFS file system, etc.
    48. 48. 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.
    49. 49. Pessimistic locking, minority partition unavailable, etc.</li></ul>P<br />P<br />P<br />Availability + Partition <br /><ul><li>High scalability
    50. 50. Distributed cache, DNS, etc.
    51. 51. Optimistic locking, expiration/leases, etc.</li></ul>Source: “Towards Robust Distributed Systems”, Dr. Eric A. Brewer, UC Berkeley<br />
    52. 52. > 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 />
    53. 53. > Wrap-Up<br />Lastly…<br />Windows Azure is an open & interoperable cloud platform<br />Microsoft is committed to Java, and we are on a journey – please give us your feedback & participate in open source projects <br />Diverse Choice of Development Tools for Java Developers<br />Eclipse Tools for Windows Azure – Write Modern Cloud Application<br />Tomcat Solutions Accelerator <br />Admin Access & VM Role<br />Windows Azure Platform SDKs for Java Developers<br />Windows Azure SDK (Storage, Diagnostics & Service Management)<br />App Fabric SDK (Service Bus & Access Control Services)<br />Restletextension for OData (Java)<br />For more information:<br />http://windowsazure.com/interop<br />http://www.interoperabilitybridges.com<br />
    54. 54. 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.

    ×