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 ...
- allow a revision to be selected as the default
- default to the default/current revision, and easily
allows to inspect other versions
- create a new revision, and store it as default whenever whenever a
property is changed
- (optionally allow the history to be changed - don't know yet if that's
a good idea)
- 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:
- Is there already a reusable implementation of such a system?
- If not, do you think it is implementable with reasonable effort?
- Is it possible to build such a system on top of an ordinary DB engine
(let's say postgres) without too much performance penalty?
- How would you implement it? On top of a ORM wrapper? Or as a new ORM
wrapper? or somehow completely different?
(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 ;)
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.