Act I · 1968 — 1979

The hospital runs on six separate files

This is a working file-based system. Read records, edit them, add and delete rows. Everything you do stays trapped in the file you did it in.

Department files

Hospital file dashboard

Six departments, six independent copies of the same patients.

/hospital/files/reception_patients.txt

Reception file

Front desk registrations and walk-ins

IDNamePhoneVisit Date
101John Mathew999999999912 Mar 2026
102Aisha Khan981234567012 Mar 2026
103Rahul Verma987650001113 Mar 2026
104Meera Nair970001234513 Mar 2026
105Sanjay Patil961112233414 Mar 2026
Each department owns a private copy of the file. Edit, delete or add a row here and switch departments — nothing you did travelled with you.
Problem 01
Data redundancy

The same patient, stored six times

Every department typed John in separately. Storage multiplies and so does risk.

Patient 101 · John Mathew

Scan every department file for this person

reception_patients.txt

Patient ID: 101

Name: John Mathew

Phone: 9999999999

doctor_notes.txt

Patient ID: 101

Name: John Mathew

Phone: 9999999999

lab_reports.txt

Patient ID: 101

Name: John Mathew

Phone: 9999999999

pharmacy_issue.txt

Patient ID: 101

Name: John Mathew

Phone: 9999999999

billing_ledger.txt

Patient ID: 101

Name: John Mathew

Phone: 9999999999

admin_master.txt

Patient ID: 101

Name: John Mathew

Phone: 9999999999

Problem 02
Data inconsistency

Update one file and the truth splits in two

Change John's phone number at Reception, then look at everyone else.

John changed his phone number

He tells the receptionist. Only the receptionist.

Reception

9999999999

Doctor

9999999999

Laboratory

9999999999

Pharmacy

9999999999

Billing

9999999999

Administration

9999999999

Problem 03
Data isolation

One patient's history lives in six unrelated places

There is no global search. Open each file yourself and count the clicks.

Build John's complete medical history

There is no single search box. Open each file one at a time.

reception_patients.txt

Contents locked — file not opened yet.

doctor_notes.txt

Contents locked — file not opened yet.

lab_reports.txt

Contents locked — file not opened yet.

pharmacy_issue.txt

Contents locked — file not opened yet.

billing_ledger.txt

Contents locked — file not opened yet.

admin_master.txt

Contents locked — file not opened yet.

0/6
Files opened by hand
0s
Staff time spent
0
Cross-file queries possible
Problem 04
Difficult data access

A new question means a new manual procedure

Find every patient who visited Cardiology — by scanning files one by one.

Question: “Which patients visited Cardiology?”

No query language exists. Scan each file line by line.

0/6
Files scanned manually
0m 0s
Estimated clerk time
0.4ms
Same question in SQL later

Answer assembled so far

Nothing yet.
Problem 05
Concurrent access

Two people save the same file — one edit vanishes

No locks, no transactions. The last writer silently wins.

Two staff members open patient.txt at the same time

Save one, then the other. Watch what survives.

Reception · editing address

Doctor · editing phone

patient.txt on disk

Address: 14 Rose Lane, Pune

Phone: 9999999999

Problem 06
Poor security

If you can open the folder, you can read everything

Log in as an intern and open confidential clinical files.

Log in as any staff member

The hospital shares one folder on one machine.

Problem 07
No backup or recovery

One delete, twelve thousand patients gone

Delete patient.txt and try to get it back.

One accidental delete

patient.txt holds 12,480 patient records.

patient.txt · 4.2 MB

12,480 records · no copy anywhere

Problem 08
No relationships

Patients, appointments and doctors know nothing about each other

You have to perform the join in your head, file by file.

“Who is John's doctor on 26 March?”

Three files, no foreign keys. You are the join engine.

patients.txt

████ | ██████

████ | ██████

████ | ██████

████ | ██████

appointments.txt

████ | ██████

████ | ██████

████ | ██████

████ | ██████

doctors.txt

████ | ██████

████ | ██████

████ | ██████

████ | ██████

There had to be
a better solution.

In 1970, Edgar Codd proposed storing every fact exactly once, in related tables, behind one engine that guards it. Watch the same hospital run on it.

Rebuild on a database