4 Jul 2010 16:30
[Trac-dev] Refactoring the Trac data model - relational approach
Terje S. <tracdev <at> hacker.no>
2010-07-04 14:30:17 GMT
2010-07-04 14:30:17 GMT
Hello list,
I've been observing since I deployed .11 for a small team last year.
I think the normalization topic raised by Felix in the look beyond 0.12
thread is an important area to focus on; I ran into so many issues with
this, I seriously considered abandoning half way. The problem manifests as
difficulty to change the core systems; anything *slightly* outside the
feature scope requires a lot of work to complete, even if the change is
trivial in principle.
Christian replies to Felix:
> I'm not sure if I understand what you mean by "denormalized database".
> Are you refering to the duplication of data in ticket related tables, as
> discussed in #1890, or to the fact we don't use yet surrogate
> keys except for the new repository table? Or the fact that relationships
> between tables rely on "implicit" foreign keys (e.g. ticket -> milestone)?
I have no trouble relating to the original statement, it refers to all of
the above and more; the general state of the data model, if you like. We
are using the database to store rather complex information, but without
the benefits of constraints(relations), triggers, views, checks or locking
(to say nothing of procedures and other modern features). In the words of
Joe Celko, Trac is in the magnetic tape mindset, using the database as if
it was a serial I/O device. Consider the Association pattern in context:
.- - - - - - - - - - - - - -.
.< : "Resource Storage System" :
: '- - -+- - - - - - - - - - -' ____
: V V |
(Continue reading)
So by now,
SQLite supports all the major requiremens, plus can be tweaked
with use of attach, memory databases etc if it should prove neccessary.
Supporting older SQLite will require to rewrite the most important
foreign keys as triggers for those versions.
On a sidenote, I would argue for a general reccommendation of postgres
for the future versions. It is a much better fit for the multi-user,
database-centric solution required to support the multiproject,
distributed and such capabilities.
> Also because the reports system depends on humans being able to write
> simple queries, it is very nice to have a more human-friendly schema.
>> That said I like your idea about bringing Trac's database to a (more)
>> relational structure. Even if I'm not remotely trained to do i/o related
>> programming with Python, I wouldn't mind lending a helping hand for testing.
>
> That's great news, thank you for offering :)
Yeah, since I'm a Mercurial fellow I'll have to see how to interface
with Git, once you branch at Github, but this should be doable.
[...]
> Can anyone demonstrate prior art of a project that successfully acheived such
> a feat with an incremental approach?
>
> Rewrite is the only cost-effective way, in terms of reaching the stated
> final goals of the project. If you are not doing the rewrite, you must
> change the goals (or knowingly spend your time with very low ROI).
>
> I dispute your case that this functionality is realistically present today at
> all. Please show 20 different lists, each containing a combo of 5 or more
> plugins from trac-hacks or elsewhere, that will work as flawlessly as you
> describe in a move from 0.11 to 0.12 in a production environment today
:D War and Hate is was keeps going the machinery of man. As such,
RSS Feed