Tuesday, December 18, 2007

OSGi and the Small Guy

After seeing a few presentations on OSGi at the Spring Experience conference. I've become inspired about how this can be useful for the small guy, not just for big enterprises.

Many of us use hosted web services to run small and personal sites. Generally, with a small site, there are a few major pieces of software that they all have in common (the parenthesis show what I currently use).
  • Web Server (Tomcat)
  • Mail Server (James)
  • Database (PostgreSQL)

If you are on a shared host, memory tends to be at a premium. For example, I use JVDS, for willCode4Beer, and only have 128MB of ram. I'm a java dev so I like running Tomcat. Running all of the services can really limit how much I can do.

Looking at OSGi, I'm considering moving to a model where everything can run off of the same virtual machine. This will also allow me to strip down the Linux install to a bare minimum.
My idea it a model like the following:



My latest searching indicates that Apache Derby can run as an OSGi module. I'm not sure if Tomcat can but, I know Jetty can (I could also write a bundle using the embedded version of Tomcat). I know that there is not an OSGi bundle for Apache James, but, I can always write it.

Anyway, there's my idea. I'm going to dedicate a little time to get it up and running. The best part is, where the various projects share libraries, I should be saving quite a bit of RAM, let alone the amount saved by running in the same VM.

Being able to deploy mailets to the James server without restarting will be nice too. Just imagine, deploying web apps and mail apps dynamically.

Scalability? Basically, its a feature of OSGi but, imagine running on top of Terracotta (the mind explodes).

Guess I have a little work ahead.

Update: I just realized, of course there is an OSGi bundle for Tomcat, it's used in Eclipse. Doh! :-)

Resources:
Tomcat Bundles
Derby Bundles
Jetty Bundles
.
.
.

Labels: , , ,

permalink
Links to this post
6 comments