← Back to team overview

launchpad-dev team mailing list archive

Re: Proposed schema changes to support generic jobs on the Soyuz build farm

 

On Fri, 06 Nov 2009 10:25:01 Muharem Hrnjadovic wrote:
> Aaron Bentley wrote:
> > Julian Edwards wrote:
> >>> Does job_type indicate whether it is a BuildPackageJob,
> >>> BuildPackageRecipeJob or BuildTranslationsJob?  Or would it be a
> >>> subtype?
> >>
> >> Yes, it would contain an enum which lists all job types possible for
> >> the build
> >> farm.
> >
> > Gotcha.  That's slightly different from the way BranchJobs and
> > BranchMergeProposalJobs work.  For them, the job_type indicates a
> > subtype, e.g. UpdatePreviewDiff.  All BranchMergeProposalJobs use the
> > same table, whether they are UpdatePreviewDiffJobs or
> > MergeProposalCreatedJobs.  They just store different data in the
> > json_data column.
> 
> Interesting .. and how is that 'json_data' column working out for you so
> far?

Pretty well actually.

The concern that was raised initially was that we'd try to select across data 
that was in the json blob, but we never have.  The general idea is that if we 
need to select across it, then we'll update the table, but that hasn't 
happened yet.

This has allowed us to create more jobs without lots of new tables.
 
> > Our original proposal was closer to yours, but we ended up with this
> > design because of concerns about creating a new table for every new
> > job type.
> 
> Interesting trade-off. I don't envisage waves of new job types
> (necessitating new db tables) breaking over us all the time but I may be
> wrong :)

Once you have the facility to easily add new jobs, you'll see more 
possibilities.

Tim



References