Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Database Design Question

Re: Database Design Question

From: Jamie Schrumpf <hatterasNOSPAM_at_hotbot.com>
Date: 22 Dec 1999 22:25:24 GMT
Message-ID: <83rj4k$kfk$5@oak.prod.itd.earthlink.net>

In article <83ov1t$f7g$1_at_nnrp1.deja.com>, sriniv79_at_hotmail.com says...
>
>I am currently working on an RDBMS (Oracle) based web work-flow
>application.
>
>The workflow rules are very simple. When a record is created, it is
>initially unapproved, the data is called Temporary. When a Manager
>approves, it becomes approved, and called Production data.
>
>I designed the database with two tables - the first table (Main Table)
>contains all business data. Each record in this table has a unique
>primary key. The second table (State Table) just maintains the state of
>the record, with a ForeignKey pointing to the record in the Main Table.
>For each row in the Main Table, absence of a corresponding row in State
>Table, or a row with state not equal to 'Approved' indicates that the
>record is not in Production State. A Left Outer Join will give me all
>data, while a simple Join gives me only Production Data.
>
>My customer has a different model in his mind. He says, I must create
>two identical tables, call one Temporary, and other Production. When the
>Manager approves a record in temporary, I copy the record over
>physically using a Trigger.
>
>My intuition says, my customer is not right. Or is he right? I am not
>able to provide enough rationale. The only valid reason I could come up
>with so far, is scalability. If he has a third state, he needs to have a
>third table and so on.. I feel that there are many issues like the risk
>of maintaining two sets of data, problems during rollbacks etc. with
>this two table model.
>
>I will be interested in listening your valued opinion.
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

You've already violated the first rule of development: never, ever ask for feedback on internals. Ask 'em what they want it to do, and how they'd like it to look, but NOT how to make it run.

If they really knew anything about it they wouldn't have hired you.

On the other hand, why two tables at all? Why not just the Main table with an "approved" flag in it?

Do you need to maintain the history of the data, or just the current values? --



Jamie Schrumpf Received on Wed Dec 22 1999 - 16:25:24 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US