views:

102

answers:

1

I have a large monolithic webapp, and whenever I make changes to a particular section of the webapp I am forced to deploy the entire app.

I would like to break this down into smaller chunks based on functionality (e.g. In a Banking website - I want to seperate out informational stuff from the online banking functionality, so if I make a change to the online banking functionality, i just deploy that part)

The challenge here is the existence of certain common elements across the webapp, like a common class that is shared across the application.

Any thoughts on the different ways in which the webapp partitioning could be done? Thanks.

+1  A: 

This isn't tomcat specific but in general if you are splitting up a web application you'll want some way to share different state across the distributed pieces. You can do this with a database or memcached store for the session information, but make sure that each application can read the common session data (some frameworks will use a key to encrypt the session data and will need to all have the same key to read it). I don't think most cookie stores for session information will hash in a way that the cookie won't persist correctly between applications.

Breaking down by function makes the most sense. See where you can separate your backend code. If you have nice restful type urls, you can probably look at your URLS to help determine good partitions.

Also, if you have a large static section that you are updating separately, perhaps that should be served up by something other than tomcat.

For common classes, you could place class implementations in a jar in your tomcat/lib folder. They would be available to the entire server. They wouldn't be able to be tailored very well to your web context (unless you passed the context to them) and you would have to restart the whole server to update the jar file to get tomcat to reload it.

Perhaps you can work something out with interfaces that gets you more independence in each partition allowing them to compile independently in some way. Perhaps some Remote Method invocation would also help you move common functions to a single .jar or .war.

danivovich
Thanks Danivo. Sorry for not being clear in my question, session was just an example of a shared entity. I am looking for any component that is shared, e.g. a class that is used by the entire app.
rubyer