Feeds

Java on the Windows Azure Cloud

Pros and cons

High performance access to file storage

Many people are surprised to hear that running Java on Windows Azure is even possible, but there are already large Java-based financial services and scheduling applications running in production.

Microsoft has committed to making Java a “first class citizen on Windows Azure”. In this article I explore the motivations behind Java on Windows Azure and weighs up the pros and cons.

Why choose Windows Azure?

Java has been a popular platform for Enterprise development for over ten years. Many organisations have large investments in Java code with applications representing hundreds of man years of development.

Java applications can be difficult and expensive to host, needing dedicated servers and data centre resources. Cloud computing can help to simplify and consolidate IT infrastructure and there are large potential cost savings in moving to the Cloud.

With the demise of Sun Microsystems, Windows Server and SQL Server have become a common choice of hosting platform. Windows Azure and SQL Azure can be a natural next step.

Java web applications

Typically Java web applications are implemented using servlets and/or Java Server Pages running in a servlet container such as Tomcat, JBOSS or Jetty.

Microsoft provides a number of solution accelerators to help install these web stacks, including the Windows Azure Tomcat Solution Accelerator and the Windows Azure Jetty Solution Accelerator.

[AzureRunMe] is also a popular choice because it provide a more general purpose, customisable and extensible framework. It works with a variety of technologies and application frameworks.

Cloud based web applications should ideally be stateless, but Java applications often use shared session state. One approach is to use the Atomus TomcatAzureSessionManager which persists session information to Windows Azure table storage.

Sticky sessions are not supported on Windows Azure (they inhibit horizontal scale out) but there are some workarounds, including Ryan Dunn’s [Windows Azure Sticky HTTP Session Router]. Optionally, IIS Application Request Routing can be used as a reverse proxy in front of your web application to provide additional security.

Relational databases

Java applications are encouraged to be database agnostic, so moving to Microsoft’s SQL Azure database-as-a-service offering can be as straightforward as changing a JDBC driver. The Microsoft JDBC Driver now officially supports SQL Azure. Most SQL Server databases can be moved to SQL Azure with tools such as the SQL Azure Migration Wizard. I’ve also seen successful conversions from MySQL.

Storage

Windows Azure Storage includes blobs, tables and queues. All are available programmatically using the Windows Azure SDK for Java.

Blobs are often a cheap and scalable alternative to file storage for documents, and can easily be incorporated into the Windows Azure CDN.

Tables can be a cheaper and more scalable alternative to relational databases for tabular data.

Queues are a useful way to distribute work to worker roles.

Tooling

It is technically possible to develop Azure applications on Mac OS X or Linux, but it’s still easier to use a Windows machine for build and packaging. The Windows Azure management portal requires Silverlight and seems to work best in Internet Explorer.

Microsoft and Soyatec have provided the Windows Azure Tools for Eclipse.

If you are familiar with PowerShell, then the Windows Azure Platform PowerShell Cmdlets are useful management and administration tools.

If you prefer a GUI, then I recommend the Cerebrata tools.

What are the cons?

At the time of writing, the maximum size of a SQL Azure database is 50 GB – Not a huge amount for an enterprise application.

You're only allowed five external TCP ports per VM in your service definition. [This has recently changed to 25 - see Microsoft's announcement.] Many Java stacks use ports liberally for everything from JMX, JCA, clustering etc.

You can’t use the Windows Azure AppFabric Cache service yet – there is no suitable API for Java.

You need to be careful about IP address configuration in your application stack and understand the way that the Windows firewall works.

It’s still hard to get support from Java vendors who question whether Windows Azure is the same as Windows Server.

Embracing the cloud

Moving your Java application to the cloud is just the first step. To really benefit from cloud economics you need to make use of cloud features and cloud architecture. A small amount of rework in your application can often allow better scale out and better use of smaller, cheaper Virtual Machines.

The Windows Azure APIs and libraries allow you to access cheaper and more scalable storage (blobs, tables and queues) as well as features such as the Windows Azure Content Distribution Network (CDN). The Windows Azure AbbFabric provides cloud based middleware services that make it easier to build hybrid cloud / on-premises solutions.

Summary

Microsoft is clearly committed to interoperability on the Windows Azure Platform, and support for Java in particular. Java on Windows Azure not only works, but can form part of a cost effective strategy for Java applications.

Rob Blackwell is R&D Director at Two10degrees, a UK based Microsoft Partner specialising in Windows Azure architecture and software development.

High performance access to file storage

More from The Register

next story
Android engineer: We DIDN'T copy Apple OR follow Samsung's orders
Veep testifies for Samsung during Apple patent trial
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Windows 8.1, which you probably haven't upgraded to yet, ALREADY OBSOLETE
Pre-Update versions of new Windows version will no longer support patches
Batten down the hatches, Ubuntu 14.04 LTS due in TWO DAYS
Admins dab straining server brows in advance of Trusty Tahr's long-term support landing
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Windows XP still has 27 per cent market share on its deathbed
Windows 7 making some gains on XP Death Day
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
Microsoft TIER SMEAR changes app prices whether devs ask or not
Some go up, some go down, Redmond goes silent
Red Hat to ship RHEL 7 release candidate with a taste of container tech
Grab 'near-final' version of next Enterprise Linux next week
prev story

Whitepapers

Securing web applications made simple and scalable
In this whitepaper learn how automated security testing can provide a simple and scalable way to protect your web applications.
Five 3D headsets to be won!
We were so impressed by the Durovis Dive headset we’ve asked the company to give some away to Reg readers.
HP ArcSight ESM solution helps Finansbank
Based on their experience using HP ArcSight Enterprise Security Manager for IT security operations, Finansbank moved to HP ArcSight ESM for fraud management.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Mobile application security study
Download this report to see the alarming realities regarding the sheer number of applications vulnerable to attack, as well as the most common and easily addressable vulnerability errors.