Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

Building cloud-ready, multicore-friendly applications, Part 2: Mechanics of the cloud

Orient yourself and your applications in the cloud

  • Print
  • Feedback

Page 2 of 6

Cloud application platforms, like their PAAS cousins, allow the developer to focus solely on the application deployed on the platform. Likewise, cloud application platforms offer the same or similar benefits described briefly for GAE above, such as virtualizing your application across the infrastructure, simplifying deployment, or providing special services. A key difference between some cloud application platforms and their PAAS cousins is portability across cloud infrastructures. For example, you can only deploy GAE applications on Google's services, whereas cloud application platforms like Appistry CloudIQ Platform allow for in-house private cloud deployment, as well as deployment on public cloud infrastructures. Among other differences, PAAS solutions often restrict tool choices, whereas typical cloud application platforms allow you flexibility in the choice of implementation languages, IDEs, and tools.

Ideally, you should not have to care about the underlying cloud infrastructure that runs your code. Likewise, you should not be concerned with writing application code to implement scalability, reliability, and other cloud and distributed computing features that a cloud platform could provide. Your focus should be on the business logic that brings your added value, while the cloud virtualizes your application, manages its lifecycle, and leverages your application over the underlying cloud infrastructure. Cloud platforms take your code -- which is ideally atomic, stateless (where possible), idempotent, and parallelizable -- and does the heavy distributed computing and multicore lifting, giving you benefits that are otherwise hard to achieve on your own.

Scaling out, scaling up, and scaling down gracefully

Cloud platforms horizontally scale out your application by running it across many servers, or workers. When transaction loads are high or you anticipate the need for more throughput, you can add more workers. When loads drop, workers can be shut down (offering green dividends by reducing power use) or shunted over to another application that needs the workers now.

Why should you care if you're a developer? If you have provided the cloud platform with a well-designed application, the cloud platform should be able to scale your application for you. Therefore, you don't have to write the scalability code. In most cloud platforms, your code doesn't know it's in the cloud, much less being scaled out.

What about scaling up across multiple cores to utilize all the available processing power? The same principles apply. If your code follows the principles outlined in Part 1, then the cloud platform can automatically scale the execution of your code across whatever cores are available without you having to use any special language primitives or tools. The ability to do this varies by the cloud platform.

If you run stateless, atomic code on a cloud platform your application should gain the resilience and ability to scale up and down gracefully. If you need more resources, you can add more nodes, and scale out horizontally; if your cloud platform utilizes multicore efficiently, you get to scale up across cores. If one or more nodes die, availability ensures that new work will get done, and reliability ensures that in-flight work has a chance to complete. Either way, you can scale down with a degree of grace, even in the face of hardware failures.

  • Print
  • Feedback

Resources

More from JavaWorld