A data flow diagram (DFD) is a graphical representation of data flow through a system. It’s employed to understand how data is processed, stored, and communicated within a system. Moreover, DFD is used to support the analysis of how the data flows in existing or proposed systems from one page or module to another (using a flowchart). It’s also called a bubble chart.
In this tutorial, we’ll learn the basics of DFD, its purpose, components, levels, and how to create a DFD.
2. Data Flow Diagrams
DFDs represent the flow of data in a system or process. They help identify the flow of data and potential bottlenecks in the system. They also help to communicate the structure of a system to non-technical stakeholders and provide a visual representation of the system’s architecture.
2.1. Components of a Data Flow Diagram
A DFD consists of four main components:
- External Entity: this is also called source, sink, or terminator. External entities are the sources or destinations of data entering or leaving the system. They can be users, systems, or organizations that provide or retrieve data from the system. An external entity is represented by a rectangle in the DFD.
- Data Flow: data flows indicate the data movement between external entities, processes, and the data store. They’re represented as arrows in the DFD with a short text label.
- Process: processes mean data transformation from one form to another. Processes are represented as circles in the DFD.
- Data Store: data stores indicate a location where data is stored and managed. Data is stored and retrieved by different processes in the DFD. Data stores are represented by rectangles with one or both of its smaller sides missing or simply two horizontal lines in the DFD.
2.2. Levels of DFDs
DFDs can present from simple overviews to complex, granular representations of a system or process, starting with level 0. The following is a breakdown of the different levels of DFDs:
- Context Diagram (Level 0): a general overview of a system is usually represented with a high-level DFD called a context diagram or Level 0 DFD. These diagrams are designed to be simple and straightforward overviews of a process or system, making them easily comprehensible to a broad audience. It only contains one process node (“Process 0”) that generalizes the entire system’s functionality.
- Decomposition (Level 1): DFDs at Level 1 are still broad overviews of a system or process but are more detailed than Level 0 diagrams. A level 1 diagram provides additional detail and highlights the primary functions of a system. They break down the system’s single process node into subprocesses, providing more insight into the underlying processes.
- Deeper Dives (Level 2): the next level of DFDs provides even more detailed information by breaking down each Level 1 process into granular subprocesses. This level provides a deeper understanding of the system or process. It helps identify inefficiencies and areas for improvement.
- Increasing Complexity (Level 3): DFDs with Levels 3 and higher are uncommon because they require enormous detail, which can defeat the purpose of creating a DFD. However, these diagrams can be helpful in complex systems or processes that require a detailed understanding of how data flows through the system.
3. Creating a Data Flow Diagram
DFDs can be created using specialized software such as Visio, online tools such as Draw.io or Lucidchart, or manual drawing. The process of creating a DFD involves several steps:
- Identify the external entities: Identify the sources and destinations of data in the system.
- Determine the flow of data: Identify the data flow between the entities and create a data flow diagram.
- Define the processes: Identify the data transformations and create a process for each transformation. Each process should have at least one input and output.
- Add data stores: Identify the locations where data is stored and add data stores to the DFD. Each data store should have at least one data flow input and one output. A data store cannot be associated with external entities directly. Instead, it must go through at least one process.
Let’s consider an example of a simple account management system. This system has an external entity: the user interacting with it. The user can either log in or register. The account management system validates user information and updates the records.
A simple context and level 1 diagram for the account management system would look like the following image:
In this example, the external entities are represented as rectangles. The data flows are represented as arrows, and the processes are represented as circles. The data store is represented as a rectangle with one smaller side open. The context diagram gives a high-level overview of the system.
A user provides his/her user name to the system, and the system either returns an error or a message for successful registration. The level diagram breaks down the context diagram and includes three processes that check the user name and password, create an error message, or complete the registration. Process 1 retrieves data from the data store “D1-Accounts”, and process 2 adds the data in the form of user name and password.
In this article, we explored the DFD as a tool for understanding data flow within a system. They help to identify potential bottlenecks and communicate the structure of a system to stakeholders. Heterogeneous elements are employed to graphically represent the flow of data and its processing within the system.
DFDs can vary in complexity, starting with level 0 as the most basic and progressing to higher levels with more detailed information. While the higher-level DFDs can be helpful, they may only sometimes be necessary, and it’s essential to balance the level of detail with the overall purpose of the diagram.
By understanding the components of a DFD and the steps involved in creating it, we can deeply study the architecture of any system.