Database Design   «Prev 

Difference between Data Modeling and Data Flow

One of the most common mistakes people make when they begin data modeling is confusing data models with data flows. A data flow shows how data are handled within an organization, including
  1. who handles the data,
  2. where the data are stored, and
  3. what is done to the data.
In contrast, a data model depicts the internal, logical relationships between the data, without regard to who is handling the data or what is being done with it.
Data flows are often documented in data flow diagrams (DFDs). For example, Figure 4-7 shows a top-level data flow diagram for Distributed Networks. The squares with drop shadows represent the people who are handling the data. Simple rectangles with numbers in them represent processes, or things that are done with the data. A place where data are stored (a data store) appears as two parallel lines, in this example containing the words "Main database." The arrows on the lines show the direction in which data pass from one place to another. Data flow diagrams are often exploded to show more detail.
For example, Figure 4-8 contains an explosion of the "Take order" process from Figure 4-7. You can now see that the process of taking an order involves two major steps: getting customer information and getting item information.

Figure 4-7 : A top-level data flow diagram for Distributed Networks

Expand Process for further Detail

Each of the processes in Figure 4-8 can be expanded even further to show additional detail.
At this point, the diagrams are almost detailed enough so that an application designer can plan an application program.
Question: Where do the database and the ER diagram fit into all of this?
Answer: The entire ER diagram is buried inside the "Main database".
In fact, most CASE software allows you to link your ER diagram to a database's representation on a data flow diagram. Then, you can simply doubleclick on the database representation to the ER diagram into view.There are a few guidelines for keeping data flows and data models separate:
  1. A data flow shows who uses or handles data. A data model does not show which data are transformed.
  2. A data flow shows how data are gathered (the people or other sources from which they come), while a data model does not.
  3. A data flow shows operations on data (the process through which data are transformed). A data model does not.

Figure 4-8 An explosion of the Take order process from Figure 4-7

  1. A data model shows how entities are interrelated. A data flow does not.
  2. A data model shows the attributes that describe data entities.A data flow does not.
The bottom line is this: A data model contains information about the data being stored in the database (entities, attributes, and entity relationships). If data about an entity are not going to be stored in the database, then that entity should not be part of the data model. For example, although the DistributedNetworks data flow diagram shows the employee who handles most of the data, no data about employees are going to be stored in the database. Therefore, there is no employee entity in the ER diagram.

Data Flow Diagram consisting of Customer, Order, Employee, Shipment

  1. A customer places an order.
  2. An employee takes the customer order.
  3. The order is stored in the database.
  4. An employee prepares the order for shipment.
  5. The order is shipped to the customer.
  6. The ship date is recorded in the database.