Agreed on admins on production systems should be able to upgrade without 
starting the server.  Mvn deploydb makes use of of the file I mentioned, 
DatabaseCreator.   CloudStack's schema upgrades are mostly in sql files not in 
java code.  Anyone can take a look at them.  The problem is in data migration 
that requires logic.  Can't remember which frameworks I looked at before 
writing this but I do remember none handled data migration well.  Cloudstack's 
upgrade process is supposed to puts as much as possible in the sql files and 
only put upgrades that require branching decisions in Java.  I hope that's 
followed all of the time but may not be true.  

Prior to 4.1, CS had one way to create an initial db and another way to upgrade 
and that did cause some problems with people forgetting to add schemas to the 
upgrade scripts.  We've changed that in 4.1 such that a new schema starts off 
with a base and goes through upgrades to establish a new schema.  Should be 
better on that front post 4.1.

I can say for most of Citrix customers, their problems with upgrade hasn't been 
the database.  Not sure about community.

--Alex

> -----Original Message-----
> From: Darren Shepherd [mailto:darren.s.sheph...@gmail.com]
> Sent: Wednesday, August 28, 2013 9:20 AM
> To: dev@cloudstack.apache.org
> Cc: dev@cloudstack.apache.org
> Subject: Re: database upgrades
> 
> Having the ability to do DB migrations on startup isn't bad.  Frankly it's 
> nice
> when you don't care, like dev/test.  You should just be able to additionally 
> do
> it as a step before.  I know this is technically possible as the mvn deploydb
> does this somehow.
> 
> The larger problem is that 1) it is a custom framework 2) has SQL in compiled
> code.
> 
> Most DBAs I've known really don't care for fancy migration frameworks.  But
> they do serve a good purpose.  So as long as it's a well known, well
> documented, and transparent framework, they tend to accept it.
> Transparent meaning they have some way to know what SQL will be
> executed before they kick off the program.
> 
> Again, I'll probably look into this more in the future.  Right now just 
> gathering
> info.
> 
> Darren
> 
> On Aug 28, 2013, at 7:20 AM, Alex Huang <alex.hu...@citrix.com> wrote:
> 
> > There's DatabaseCreator.java which upgrades the database.  That's how
> we're creating the database.  We can pretty much replace the checker with
> something that only checks the version rather than upgrades the database
> from the xml file.
> >
> > --Alex
> >
> >> -----Original Message-----
> >> From: Darren Shepherd [mailto:darren.s.sheph...@gmail.com]
> >> Sent: Tuesday, August 27, 2013 4:48 PM
> >> To: dev@cloudstack.apache.org
> >> Subject: database upgrades
> >>
> >> It seems like on startup of the management server
> >> DatabaseUpgradeChecker runs and upgrades the database performing
> DDL
> >> and DML.  Is there a way to upgrade the database that doesn't include
> >> starting the management server?
> >>
> >> Darren

Reply via email to