Skip to content

Data flow diagram

Where data comes from, which process changes it and where it is stored.

What it explains and when it is useful

A data flow diagram (DFD) shows how data moves: from external entities, through processes that transform it, into and out of data stores. Level 0 (context) shows the whole system as one process; Level 1 opens it up.

When to use it: Data-heavy solutions: anything that collects, transforms, stores and reports data. Useful for showing that every output can be produced from stored data.

Worked example

Illustrative: PracticePal is a fictional project used throughout this guide.

Level 0: context diagram

Level 0 (context) data flow diagram for PracticePal: one process, PracticePal, exchanging data with the external entities Student, Head of music, Clock and School email serverStudentHead of musicSchool emailserverClock0PracticePallogin details, booking requests,check-ins, cancellationsweek grid, confirmations,reasons for rejectiondates to block,report requestusage report (CSV)offer emailstime (every5 minutes)
PracticePal as a single process with its external entities.

Scroll sideways to see the whole diagram.

Level 1

Level 1 data flow diagram for PracticePal: processes 1 Log in, 2 Make booking, 3 Record check-in, 4 Release no-shows, 5 Offer freed slot, 6 Block rooms and 7 Produce usage report; data stores D1 Students, D2 Rooms and blocks, D3 Bookings and D4 Waiting listStudentHead ofmusicClockSchool emailserver1Log in2Make booking3Record check-in6Block rooms7Usage report4Release no-shows5Offer freed slotD1StudentsD2Rooms and blocksD3BookingsD4Waiting listemail, passwordpassword hashroom, slot,loudconfirmationor reasonneighbours,blocksnew bookingexisting bookingsjoin requestcheck-instatus = checked indatesrequestusage CSVnewblockcancelbookingsbookingsuncheckedbookings / no-showtimefreed slotnext student /mark offeredofferTwo-headed arrows: the process reads the store and then updates it. Hop (⌒) = two flows cross without connecting.
PracticePal's main processes and data stores.

Scroll sideways to see the whole diagram.

Function composition / data transformation diagram

Alternative. In a functional style, the usage report is a pipeline of pure functions; the diagram shows data changing shape at each step.

Function composition diagram for a functional version of the weekly usage report: the list of bookings flows through filter, map, group and map stages, and each pure function's output is the next one's input, ending in CSV rowsbookingslist of Bookingin_week(w)filterminutes()map → (room, mins, status)by_room()group → {room: [...]}usage_pct()map → (room, %, no-shows)to_csv()list of strreport = to_csv(usage_pct(by_room(map(minutes, filter(in_week(w), bookings)))))No stage changes shared data, so each can be unit-tested on its own with small lists.
The weekly usage report as composed functions.

Scroll sideways to see the whole diagram.

Notation and legend

Symbol or partMeaning
Square (thick border)External entity: a source or destination of data outside the system
Rounded box with numberProcess that transforms data
Open-ended box (D1…)Data store
Labelled arrowData flow, named by the data it carries
⌒Two flows crossing without connecting

Design decisions it communicates

A diagram earns marks when you explain the decisions it shows. In PracticePal's documentation these would each be one sentence:

  • Every data store is both written and read by some process; nothing is stored without a purpose.
  • The clock is an external entity, because no-shows are triggered by time, not by a user.
  • Offer emails leave the system, which is why the email server appears.

Common mistakes

  • Drawing decisions or loops (that is a flowchart).
  • Unlabelled flows.
  • Data flowing directly between two stores or two entities without a process.
  • Processes named as nouns instead of verbs.
Often confused with: Flowchart. A DFD has no start, end, decisions or order; a flowchart has all four. If your diagram has a diamond, it is not a DFD.

Checklist for your own version

Ticks are saved in this browser only, so you can use the list while you draft.