Dear monks,

I would like to hear your comments/critiques about my design of a perl program that will deploy updates for a database-driven web application. I can change everything excep the design of the web app itself.

About the web app.
It's the typical LAMP (Linux, Apache, MySQL, Perl) application. It's composed of CGI's running under mod_perl, lot's of perl modules and a database. All of the components change quite frequently: the software (sw) and the database (db). A change in the db typically involves a change in some pieces of sw. There are also sw fixes that are independent from sw-db changes. Some customers pay for sw-db updates others pay just for sw-fixes.

About the update mechanism.
There will be about 1,000 clients using this mechasim on a monthly basis. Each client has it's own installation of the web app in a dedicated server. They have to apply the monthly updates sequentially, meaning that they shouldn't apply the October update if the September update hasn't been applied.

I am thinking in implementing it in a way that it could be executed in the command line (similar to how you execute yum or apt-get), as a cron process or even with a web interface (in the future).

About the montly releases.
Each release is composed of three tar files:

  1. Changes in the sw related to db changes (sw-db.tar),
  2. sw bug fixes not relaed to db (sw-fixes.tar), and
  3. changes in the db: updates, deletions, insertions (db.tar)

The content of the sw-db.tar and sw-fixes.tar is just a group of .pm and .pl files that will be deployed in certain directories.

The content of the db.tar is an xml file with a section for DB table. Each table section in the xml file has an <update>, a <delete> and an <insert> section.

The process.

  1. Check in a config file the latest update applied , i.e. the config file might say something like "the last update was the July release."
  2. Based on the latest applied update, download via http, all the necessary monthly-packages. For example if the last applied update was the July release and the latest released update is the October one, it will have to download the August, September and October releases.

    Depending on the IP address of the client, the update server might not provide db and sw-db packages.

    Some clients are not able to connect their servers to the internet so the mechanism should allow for other means of distribution of packages, ie. bringing the files in a CD or something like that.

  3. For each downloaded relase package (e.g. aug, sep, oct) do the following:
    1. Deploy sw-fixes.tar and sw-db.tar updates by just un-tar-ing them.
    2. Deploy db.tar by unpacking the xml file, parsing it with SAX and apply the db changes. It's very important to avoid overrding any customization made on some fields of the db.
    3. Update config file stating that the monthly release has been applied.

The program should be able to stop at any give step and continue.

Thanks in advance,
-Andrés


In reply to Designing a monthly software and database update for a web app by amonroy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.