fun with referential integrity

Ulf Wiger <>
Thu Mar 13 19:02:49 CET 2003


On Thu, 13 Mar 2003, Chris Pressey wrote:

>My overall impression is that a really good data model
>avoids cyclical dependencies, but a really robust RDBM
>package would deal with the case when the data model turns
>out to be not so good (for whatever reason :)

Exactly. Also data models may well be good in the beginning,
but then evolve into something not so good.

>Anectodal: when I was toying with "records with active
>values", all was well for simple acyclical cases (change
>the width of a rectangle, the perimeter is automatically
>updated, OK) but for more sophisticated examples (one field
>imperial & the other metric & automatically updating each
>other - cyclic) I had to add a visited list.  I don't know
>if there's a strong parallel between that and a typical
>database layout, but it seemed worth mentioning.

One complicating factor with mnesia is the support for
nested transactions. Another is the fact that you have to
rely on the process dictionary to keep track of state
between operations within a transaction. Essentially, mnesia
itself keeps a 'visited' list of objects that have been
modified or deleted inside each transaction; they are
invisible to the outside world or parent transaction until
commited.

/Uffe
-- 
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson AB, Connectivity and Control Nodes




More information about the erlang-questions mailing list