A data flow diagram (DFD) maps how data moves through a system, showing inputs, outputs, storage, and the processes that transform them. You read it by following the arrows from external sources through processes to data stores, and this article walks through a concrete example so you can draw and interpret one yourself.
Formula
The calculator above is not a DFD, but it shares the same logic: you feed in raw data (time and distance), a process divides one by the other, and you get a derived result. The pace formula is:
pace (min/km) = finish time (min) ÷ distance (km)
speed (km/h) = distance (km) ÷ (finish time (min) ÷ 60)
Variables: t = finish time in minutes, d = distance in kilometers. Pace is minutes per kilometer, speed is kilometers per hour. This is the kind of transformation a DFD would draw as a process bubble: raw inputs on the left, computed outputs on the right.
Worked Example
Using the defaults: t = 50 minutes, d = 10 km.
- Pace = 50 ÷ 10 = 5.00 min/km
- Speed = 10 ÷ (50 ÷ 60) = 10 ÷ 0.8333 = 12.00 km/h
The calculator shows 5.00 min/km and 12.00 km/h, matching the hand calculation.
What a Data Flow Diagram Actually Shows
A DFD is a graphical way to show where data comes from, where it goes, and what happens to it in between. It deliberately hides control logic, decision points, and the order of operations. You will not see loops, if-then branches, or a timeline. What you see instead are four symbols:
- External entity (a rectangle): a person, department, or outside system that sends or receives data. It sits on the boundary of the system.
- Process (a circle or rounded rectangle): an activity that transforms incoming data into outgoing data. It has a number and a name, like “1.0 Validate order”.
- Data store (an open-ended rectangle or two parallel lines): a place where data rests, like a database, file, or table.
- Data flow (an arrow): a packet of data moving from one symbol to another. The arrow is always labeled with the name of the data, never with the control signal.
There are two common notation styles: Yourdon/DeMarco (circles for processes, open rectangles for stores) and Gane/Sarson (rounded rectangles for processes, closed rectangles for stores). Both mean the same thing; pick one and stay consistent.
Example: Online Order System (Level 0)
Consider a simple e-commerce checkout. The context diagram (Level 0) shows the whole system as one process, surrounded by external entities: Customer, Payment Gateway, and Warehouse. Arrows show “order details” going in from Customer, “payment request” going to the Gateway, “payment confirmation” coming back, and “shipping order” going out to the Warehouse.
Now zoom into the system (Level 1). The single process splits into three numbered bubbles:
- 1.0 Validate order — takes “order details” from Customer, checks item availability, and outputs “valid order” to the Order database.
- 2.0 Process payment — reads “valid order” from the Order store, sends “payment request” to the Gateway, and writes “payment status” back to the same store.
- 3.0 Fulfill order — reads “paid order” from the store and sends “shipping order” to the Warehouse.
Notice that the data store sits between processes: 1.0 writes, 2.0 reads and writes, 3.0 reads. That is a typical pattern. Also note that the Customer appears in the Level 1 diagram as well, because they still interact directly with the system (sending order details and receiving confirmation).
How to Read the Diagram in 4 Steps
- Find the external entities. They are the sources and sinks of all data. If an arrow starts or ends at a rectangle, that is your boundary.
- Follow one arrow at a time. Trace a single data packet from its origin to its destination, noting every process it passes through. That path is the data’s lifecycle.
- Check the process numbers. In a leveled DFD, process 1.0 at Level 1 will be decomposed into 1.1, 1.2, etc. at Level 2. If you see a process with no children, you have reached the lowest level.
- Look for stores that are written but never read, or read but never written. That is usually an error: a store with only incoming arrows means data is saved but never used; only outgoing arrows means the system reads data that never gets created.
Common Mistakes and How to Avoid Them
- Drawing control flows. An arrow labeled “send email” is a data flow if the email content is the data. An arrow labeled “if payment fails” is a control flow and does not belong on a DFD.
- Connecting two data stores directly. Data cannot move between stores without a process. If you need to copy or transform data, draw a process between them.
- Connecting an external entity directly to a data store. An external entity cannot read a database directly in a DFD; it must go through a process. This rule enforces that all access is mediated by system logic.
- Forgetting to label arrows. Every arrow must have a noun phrase describing the data, not the action. “Customer info” is correct; “get customer” is not.
- Mixing levels. A Level 1 diagram should not show processes that belong to Level 2. Keep each level at the same granularity.
Leveling: Why One Diagram Is Not Enough
A single DFD can become unreadable beyond about seven or eight processes. The solution is leveling. The context diagram (Level 0) shows the entire system as one bubble. Level 1 breaks that bubble into major processes. Level 2 breaks each Level 1 process into sub-processes, and so on. Each level is consistent with the one above it: the inputs and outputs of a parent process must match the combined inputs and outputs of its children. This is called balancing. If a parent process has an incoming flow called “order”, the child diagram must have that same flow entering one of its sub-processes.
DFD vs. Flowchart vs. Use Case
People often confuse DFDs with flowcharts. A flowchart shows the sequence of steps and decision points; a DFD shows data movement, not sequence. A use case describes interactions between actors and the system from a user’s perspective; a DFD shows the internal data mechanics. In practice, you might use all three: a use case to capture requirements, a DFD to model data flows, and a flowchart to model a specific algorithm within one process.
When to Use a DFD and When Not To
Use a DFD when you need to communicate how data moves through a system, especially during requirements analysis or when redesigning a database. It is excellent for spotting missing data stores, duplicate processes, or unnecessary data copies. Do not use a DFD for real-time control systems, event-driven workflows, or user interface design. Those need state machines, sequence diagrams, or wireframes. Also, a DFD does not show data volume, frequency, or security levels; you will need supplementary diagrams or annotations for those.
Frequently Asked Questions
What is the difference between a context diagram and a DFD?
A context diagram is the highest-level DFD (Level 0). It shows the entire system as a single process, with all external entities and the data flows between them and the system. It gives a bird’s-eye view. A DFD at Level 1 or below breaks that single process into multiple sub-processes, revealing the internal data movement.
Can a data flow go directly from an external entity to a data store?
No. In standard DFD notation, an external entity must communicate with a data store through a process. This rule ensures that all data access is controlled by system logic. If you see such a direct connection, it usually means the diagram is missing a process that validates, transforms, or mediates the data.
How do I number processes in a leveled DFD?
Processes are numbered hierarchically. The context diagram has process 0. Level 1 processes are 1, 2, 3, etc. Level 2 sub-processes of process 1 are 1.1, 1.2, 1.3, and so on. The numbering helps you navigate between levels and ensures each process has a unique identifier.
What does a data store look like in a DFD?
In Yourdon/DeMarco notation, a data store is an open-ended rectangle (a rectangle with no right side). In Gane/Sarson notation, it is a closed rectangle with a label like “D1 Orders”. Both represent a place where data is held, such as a database table, a file, or a queue.
Is a DFD the same as a data dictionary?
No. A DFD shows the flow of data graphically, but it does not define the content of each flow or store. A data dictionary is a separate document that lists every data flow, data store, and process with their definitions, types, and allowed values. The two are complementary: the DFD shows structure, the dictionary shows detail.
How many levels should a DFD have?
Enough to make each process simple and understandable, but not so many that you get lost. Most systems need two or three levels. If a process at the lowest level still has complex logic, you should stop and describe that logic with a flowchart or pseudocode instead of continuing to decompose.
Related
Formula used
in t | Finish time | min | 50 | 0 in d | Distance | km | 10 | 0 | 100000 out pace | Average pace | min/km | t / d | 2 out speed | Average speed | km/h | d / (t / 60) | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Repurposed Old Motorola Phone for Homelab?
- Unbox ASMR Codes: What They Are & How to Use5.00 min/km
- How to Evaluate AI Vendors for Data Security, Privacy & Compliance
- Best Ergonomic Mouse: Top Picks & Buying Guide
- Captions in Google Slides: How to Add & Format Them
- Use Mac Type in Japanese? Full Guide