> From: Anthony W. Youngman 
> Please - define "referential integrity". In a MV 
> database, for the most part, orphan records don't 
> happen because MV *does* enforce integrity. It just 
> does it completely differently - it stores related 
> attributes together so they can't get orphaned, rather 
> than scattering them across multiple tables. As has 
> been pointed out before, it's easy to make a mistake 
> when defining your relational database. Those sort of 
> mistakes just don't tend to happen with an MV database.

Sure they do.  A fundamental difference between MV and relational
is as follows:

- In a relational DBMS, a DBA defines RI at the database level.
The DBMS enforces the rules.
- In MV, a programmer defines RI at the application level.  BASIC
code enforces the rules.  This is why MV shops generally don't
have DBA's, they just have programmers.

That relates to a second fundamental difference:
- In the RDBMS, the schema definitions contain the primary view
of the data for both updates and reports.
- In MV, the schema (dict items) is generally only used for
reporting views, and application code is used much more
extensively than in a relational app to create new views.  In
fact, an MV app doesn't really need schema at all - unless you
build around it with something like SB+, but then it's still up
to the application to use the defs properly for updates, not the
DBMS.

The MV programmer is just as capable of missing an update as the
RDBMS DBA.  RI errors in an RDBMS are less likely because schemas
don't change as often as they do in MV, and most/all updates run
through a consistent schema definition.  Unfortunately the way
most MV people code, there are many points in the application
where data is read and written, and the only rules applied to
updates are the rules that the programmer remembers when he/she
is in code.  So it is more likely in an MV application that there
will be RI errors.  However this is also a source of versatility
which we enjoy.

All that said, in MV we can add triggers.  The BASIC code used
for triggers is equivalent to the RI added to schema, and the MV
DBMS should process trigger updates as faithfully as the RDBMS.
I could be wrong but I don't think most MV developers use
triggers too much, so we can't rely on this as the argument to
say MV really does RI at the DBMS level.

No, three cheers for the Pick model and all that, but it doesn't
enforce integrity.  That's the job of the application developer,
and after that the DBMS just follows the rules it's given.

Tony Gravagno
Nebula Research and Development
TG@ remove.pleaseNebula-RnD.com
remove.pleaseNebula-RnD.com/blog
Visit PickWiki.com! Contribute!

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to