This weekend I wanted to experiment with a cloud solution for Java. In the past I tried out Google App Engine, but although easy and fast, it forces you to use the Google API and has some limitations.
This time, the criteria for the platform was running nearly anything in a web container. And I think I found the perfect match…
Jelastic is the next generation of Java hosting platforms which can run and scale ANY Java application with no code changes required. – Easy to Create – Easy to Deploy – Easy to Scale – Easy to Manage
Jelastic promises a lot: platform independence and run, scale any Java application with no code changes. That sounds too good to be true, but after reading this article, you too will be convinced this is no lie.
After registering on their website, you will immediately receive your login credentials and you can get started. At this moment they offer two datacenters worldwide: one in North America, and another for Europe. I choose Europe as my main hoster.
The most important part is next: creating and configuring a cloud environment for your project. As you can see on the picture, they offer both PaaS and IaaS . All necessary infrastructure is present in form of load balancers, SSL-termination and proper hardware. On top of that, you can determine the platform of your choice: many combinations are possible, you can choose between Tomcat, JBoss and Glassfish and one of many both SQL and NoSQL databases.
To finalize your environment you can tweak the horizontal and vertical scaling settings by increasing the cloudlets on each server (vertical) and the amount of servers (horizontal).
Since Jelastic is still in beta, the price tag for your extreme setup will be $0 at the moment. I can live with that, so choose a name for your environment and create it!
Depending on your configuration, creating your environment can take from a few seconds to a few minutes.
With your environment set up, you can start by deploying the sample web application to your environment, it’s a simple ‘Hello world’ application. When looking back, you just configured your own scalable cloud application that’s available on the web in only a few minutes…
Now you’re done, you can do virtually anything with your server and database. On the main dashboard, it’s as simple as uploading your war and deploying it.
I created a simple web application that works around one entity, all using common frameworks and technologies. You can fork it at https://github.com/dvsander/Jelastic-RDTest.
I configured my environment with a MySQL database. Accessing it is extremely easy: the first time you visit the Database Webview, you receive a mail with phpMyAdmin credentials and the URL. After a few seconds I had root access to my MySQL instance and I created a database, a simple table and a user with enough rights to query it:
CREATE TABLE IF NOT EXISTS `Book` ( `id` int(11) NOT NULL auto_increment, `isbn` text NOT NULL, `title` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
My sample Maven2 project uses Hibernate as persistence provider, so all it takes it modifying the hibernate.cfg.xml :
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.url">jdbc:mysql://<HOST>.jelastic.com/<DBNAME></property> <property name="connection.username"><USERNAME></property> <property name="connection.password"><PASSWORD></property> <property name="current_session_context_class">thread</property> <property name="show_sql">true</property> <mapping /> </session-factory> </hibernate-configuration>
Deploy the application to your environment and you got yourself a multi-layered web application in Java hosted in the cloud. Impressive isn’t it?
It’s very easy to get an application running on Jelastic.
Their motto of keeping everything easy, from development up to deployment, is no lie.
In code, there isn’t any reference to the platform and no specific limitations or API.
Jelastic is definitely something to watch out for. When they go live offering both free/low prices for starters and a decent SLA and competitive prices for business partners, I expect this to be a big player in Java cloud solutions.
At the moment I haven’t got bad experiences from using it. Should I in the future encounter some, I will edit this post.
Are you interested in cloud solutions? What services have you tried out?
You can respond to Sander on his blog or in the comments below.