4

Greetings to all the smart people around here!

I'd like to ask whether it is feasible or a good idea at all to deploy a Java enterprise web application to a Cloud such as Amazon EC2. More exactly, I'm looking for infrastructure options for an application that shall handle few hundred users with long but neither CPU nor memory intensive sessions. I'm considering dedicated servers, virtual private servers (VPSs) and EC2. I've noticed that there is a project called JBoss Cloud so people are working on enabling such a deployment, on the other hand it doesn't seem to be mature yet and I'm not sure that the cloud is ready for this kind of applications, which differs from the typical cloud-based applications like Twitter. Would you recommend to deploy it to the cloud? What are the pros and cons?

The application is a Java EE 5 web application whose main function is to enable users to compose their own customized Product by combining the available Parts. It uses stateless and stateful session beans and JPA for persistence of entities to a RDBMS and fetches information about Parts from the company's inventory system via a web service. Aside of external users it's used also by few internal ones, who are authenticated against the company's LDAP. The application should handle around 300-400 concurrent users building their product and should be reasonably scalable and available though these qualities are only of a medium importance at this stage.

I've proposed an architecture consisting of a firewall (FW) and load balancer supporting sticky sessions and https (in the Cloud this would be replaced with EC2's Elastic Load Balancing service and FW on the app. servers, in a physical architecture the load-balancer would be a HW), then two physical clustered application servers combined with web servers (so that if one fails, a user doesn't loose his/her long built product) and finally a database server. The DB server would need a slave backup instance that can replace the master instance if it fails. This should provide reasonable availability and fault tolerance and provide good scalability as long as a single RDBMS can keep with the load, which should be OK for quite a while because most of the operations are done in the memory using a stateful bean and only occasionally stored or retrieved from the DB and the amount of data is low too. A problematic part could be the dependency on the remote inventory system webservice but with good caching of its outputs in the application it should be OK too.

Unfortunately I've only vague idea of the system resources (memory size, number and speed of CPUs/cores) that such an "average Java EE application" for few hundred users needs. My rough and mostly unfounded estimate based on actual Amazon offerings is that 1.7GB and a single, 2-core "modern CPU" with speed around 2.5GHz (the High-CPU Medium Instance) should be sufficient for any of the two application servers (since we can handle higher load by provisioning more of them). Alternatively I would consider using the Large instance (64b, 7.5GB RAM, 2 cores at 1GHz)

So my question is whether such a deployment to the cloud is technically and financially feasible or whether dedicated/VPS servers would be a better option and whether there are some real-world experiences with something similar.

Thank you very much! /Jakub Holy

PS: I've found the JBoss EAP in a Cloud Case Study that shows that it is possible to deploy a real-world Java EE application to the EC2 cloud but unfortunately there're no details regarding topology, instance types, or anything :-(

Jakub Holý
  • 363
  • 1
  • 3
  • 14

2 Answers2

1

In the long term EC2 is rarely more cost effective than dedicated servers of your own. It's main advantage is in rapid scalability. If you have a relatively slow changing userbase then it is probably not worth it.

But the great thing is that it is easy to set something up and try it out for just a handful of $, without having to lay out a lot on hardware in advance.

There are ready made AMIs for Glassfish. My advice would be to try out 1 or 2 small instances, it'll show you clearly if VPS/Dedicated servers will be better value and give you a much better idea of your requirements.

JamesRyan
  • 8,138
  • 2
  • 24
  • 36
0

You might want to look at Terracotta.

Terracotta does distributing the JVM across EC2 cloud. So it works in making non-scalable Java applications to become scalable with little code modification. Terracotta is similar to Elastic Beanstalk but better suited for handling:

  1. Java

  2. Scaling

  3. Load balancing

  4. Database replication

  5. It is Open Source / Open Core

    Here is the link http://www.terracotta.org/

Jeremy Hajek
  • 473
  • 1
  • 4
  • 15