Wednesday, September 12, 2007

JavaZone 2007: Farewell to the application server

"We have turned the app server inside out"

Despite some technical difficulties (both a malfunctioning PC and a projector; Murphy still lives), Johannes confidently took the stage and outlined his talk: Where he works WebSphere was the chosen app server, however his department discovered that the act of deploying apps was grinding development to a halt.

Johannes is lead software architect for BBS, an IT company owned by Norwegian banks. His approach seems like a pretty revolutionary way to do things, and to talk banking people into doing it this way must be kinda difficult.

Johannes introduced the concept of continuous deployment: continuously deploying and testing applications. He described the technical environment they used for this: Standard Java, Maven for build and deploy and Jetty, which is light-weight and integrates nicely with Maven.

The application model is really simple: They zip up all the code and the external jars and ship it over to a server. It's completely self-contained. They have their own Main class, which means its really easy to start from an IDE or wherever.

They didn't dare to upgrade their WebSphere install, since this caused all kinds of old apps to stop working.

Is Jetty ready for deployment? Johannes quoted NetCraft numbers which showed that Jetty is almost as much used as Tomcat.

Bureaucracy regarding open source software. They use pre-approved licenses which have been vetted by the company lawyers. This made introducing Jetty a lot easier.

After ad-libbing his talk for 20 minutes, the demo was suddenly up and running! And there was much rejoicing.

He showed how they use one bash script ( which would pull down and install an app on a server. As I understand apps are fetched from the Maven artifact repository.

When installing apps, they simply change a 'curr' (ent) symlink and restart the app. This is an approach taken from Capistrano in the Rails world.

An app has exactly one configuration file: this says which port to run the server on and which database to use. All other configuration elements are stored in the database.

Debugging is really easy to run in the IDE, it's just a main() method.

They use the Maven app assembly plugin for packaging zip files and generating startup scripts. The zip file then contains everything needed to run the application, except the JVM.

cron is used for simple CI. One cron-job is run every minute and checks for new versions, installs and runs it. The entire approach seems really UNIX friendly; it relies on several UNIX features and plays well with them. Johannes later noted that the symlink approach is simply not used on Windows. On Windows they also have to install the app on the root catalog so that the classpath won't be too long.

They chose Jetty over other app containers since they were familiar with it and they didn't need the more advanced features of app servers.

Check out Johannes' blog, I think he's written about these concepts there before.

These notes are taken live, so they may be rambling a bit; you'll have to humour me.

1 comment:

Johannes Brodwall said...

Thanks for a really good summary of my talk. :-)