views:

51

answers:

3

Let say we are developing a new client/server Java web application. We finally released 1.0 version and sold to few clients. Clients deployed our project on their own at their servers. After some time we found a few bugs and we would like to update our application.

Is there any framework / technology / pattern / library / server that can help in developing app that can update itself automatically including such steps:

  • copying new project release
  • undeploying old release
  • deploying new release
  • updating db

At the moment we have vpn to our clients and we are doing all above steps manually. Is it possible to synchronize our clients version with our repositiory?

+1  A: 

The technology you are talking about is an installer. And application installer frameworks exist.

However, when you application stores important state in a database or whatever, automating the migration of the data is tricky and risky ... and next to impossible to do in the context of a generic installer product. The same is true if your application can be customized by your customers. (There is always a chance that the customization will break your automated migration code.)

Now, if the steps that you currently perform manually are straightforward, and don't need to be adapted for different customer sites, then automation may be possible. But you need to make sure that you have a bomb-proof mechanism for backing up the customer's current installation and data and (if necessary) restoring it when your automated upgrade procedure fails.

Stephen C
In our case data integration is not a problem after update. We have two repositiories (java and sql) and sql patchers which are generated using liquibase and tested by our team.But I'm wondering is it possible to develop app that could:1) check (lets say every hour) via http if on our (producer) server is update avaible2) download new version of app3) download sql patch4) undeploy old app5) deploy new app6) run sql patch7) run app again
kospiotr
Another issue is that the installation has to take place at an opportune time for the clients.
Romain Hippeau
We could assume that users that are using our app are only informed that new app is avaible, but only admin or someone who has privileges can hit button "update app".
kospiotr
@kospiotr - *"is it possible?"* Of course it is possible! The more important question is whether it is a good idea. And for example, what are the consequences to you / your company if your fancy update system permanently destroys a lot of some customer's data??
Stephen C
A: 

JavaWebstart can help to deploy the client, but if the database also needs an upgrade, I don't think it can be done safely unless all clients are closed.

Maurice Perry
+1  A: 

For the DB part, you can use liquibase. Liquibase is a maven plugin/lib to manage database migrations (upgrading your database to more recent versions). One way to do this with liquibase is to deploy a special servlet that will inquire a schema-table that contains the current db version.

If you can perform a remote deploy (eg: via tomcat admin interface or any other), you can always set up a custom script that performs the deploy for you. You can then offer this script to the client so they can apply the updates following their own schedule.

I don't recommend immediately rolling out updates to clients whenever they are available simply because they (and you) may not want to update them immediately.

Miguel Ping