The other day I thought about writing a web application that manages material data. It seems straight forward: set up a database, store material name and a bit of meta data, properties + values + units, set up a CRUD interface, and be done.

As always, reality is a poor approximation to my mental model, and things are more complicated: the properties of the materials need to be versioned.

No big deal, just a linear revision number with the associated values. But so far I haven't found a clean way to deal with versioned properties in object mappers like DBIx::Class or Rose::DB::Object.

Ideally the object that represents a versioned object (or an object with versioned properties) should ...

  1. allow a revision to be selected as the default
  2. default to the default/current revision, and easily allows to inspect other versions
  3. create a new revision, and store it as default whenever whenever a property is changed
  4. (optionally allow the history to be changed - don't know yet if that's a good idea)
  5. optionally track revision control meta data (who changed the revisions, and when?). Tracking changes to which revision is considered default isn't necessary.

Most search queries against the database would only query the current revision, but some would also query all available revisions.

The more I think about the proble, the more I'm sure that such a version aware db wrapper is desirable in many situations, but I haven't found anything useful on cpan and freshmeat.

Now I seek my fellow monk's wisdom and ideas:

(For a while I thought about building it the other way round - storing the data with git, and build a database engine on top of that, but I discarded it as being to much work).

At the moment speed isn't all that important, but it should still be scalable - no O(nē) lookups if possible ;)


In reply to ORM with version control? by moritz

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.