File Systems vs DBMS — A Historical Walkthrough

File system বনাম DBMS — ঐতিহাসিক প্রেক্ষাপট

Read: ~28 min Beginner 6 practice problems History & SQL

1. Step Back to 1965 — Before Databases Existed

Before the word database existed in any meaningful sense, every business application stored its data in plain files: punched cards, magnetic tapes, then disks full of fixed-width records. A bank had one file for accounts, another for loans, another for branches. A university had one file for students, another for courses, another for marks. Each file was opened, read, and written by exactly one program — and that program was usually written in COBOL or FORTRAN.

This was the file-processing era. It worked, it shipped products, it ran banks. But within a decade it became clear that the approach did not scale. To understand why the entire industry eventually pivoted to databases, we must first feel the pain that flat files caused.

১৯৬৫ সালের কথা ভাবুন। তখন "database" শব্দটির প্রায় কোনো অস্তিত্ব নেই। প্রতিটি ব্যবসা তার ডেটা রাখত প্লেইন ফাইলে — punched card, magnetic tape, এরপর fixed-width record-এর disk file। ব্যাংকের একটি ফাইল থাকত accounts-এর, আরেকটি loans-এর, আরেকটি branches-এর। প্রতিটি ফাইল COBOL/FORTRAN-এ লেখা একটিমাত্র প্রোগ্রাম পড়ত-লিখত। এই যুগটিকে বলা হয় file-processing era। এটি কাজ করত, কিন্তু দ্রুতই বোঝা গেল — এটি বড় হওয়ার যোগ্য নয়।

2. How a Flat-File System Actually Looked

Picture Sonali Bank in 1972, before computers became cheap. Imagine they had three flat files on disk:

accounts.dat A1001|Rahim|Dhaka|150000 A1002|Karim|Khulna|24000 A1003|Rahim|Dhaka|7800 A1004|Salma|CTG|60000 loans.dat L501|Rahim|Dhaka|500000 L502|Salma|CTG|220000 L503|Rahim|Dhanmondi|99000 branches.dat B01|Motijheel|Dhaka B02|Khulna Sadar|Khulna B03|Agrabad|CTG Figure 2.1 — তিনটি আলাদা flat file। প্রতিটি ফাইল একটি প্রোগ্রাম পড়ে-লেখে।

Each file is just text on disk. The program — say a COBOL program named PRINT-STATEMENT — had to know exactly how many bytes per field, where to seek, and how to parse. Adding a new column meant changing every program that read the file.

প্রতিটি ফাইল একটি সাধারণ টেক্সট ফাইল। কোন field কয় byte, কোন position-এ — সব hard-code করে প্রোগ্রাম লিখতে হতো। একটি field যোগ করতে গেলে যত প্রোগ্রাম এই ফাইল পড়ে, প্রতিটিই আবার লিখতে হতো।

3. The Five Cardinal Sins of Flat Files

By the early 1970s every large IT department had felt these five problems first-hand. They are the reason the database industry exists.

#ProblemWhat it actually meansবাংলায়
1Data redundancy"Rahim, Dhaka" appears in accounts.dat, loans.dat, and customers.dat — the same information stored three times.একই তথ্য একাধিক ফাইলে — একই data বারবার।
2Data inconsistencyRahim moves to Dhanmondi. The accounts file is updated, the loans file is forgotten. Two "truths" now exist.একটি ফাইলে আপডেট হয়, অন্যটিতে হয় না — দুই জায়গায় দুই উত্তর।
3Difficult querying"How many customers in Dhaka have a loan above 1 lakh?" requires writing a brand-new COBOL program for that one question.প্রতিটি নতুন প্রশ্নের জন্য নতুন প্রোগ্রাম লিখতে হয়।
4No concurrencyTwo tellers cannot safely update the same record at once — locks must be hand-coded.একসাথে দুজন লিখলে data নষ্ট হয়।
5No integrityNothing prevents a loan with no matching customer, or a negative balance.অসম্ভব ডেটা ঢোকা আটকানোর কোনো উপায় নেই।
The "Lost Update" Disaster
In 1968 a US bank lost an entire day of transactions because two batch programs wrote to the same file overnight. That single incident is widely cited as one of the events that motivated the design of modern transaction managers. The same family of bugs would silently destroy any flat-file bKash today.

১৯৬৮ সালে একটি US ব্যাংক রাতারাতি একদিনের পুরো লেনদেন হারায়, কারণ দুটি batch program একই ফাইলে লিখছিল। এই ঘটনাই আধুনিক transaction manager তৈরির অন্যতম প্রেরণা। আজকের বাংলাদেশে কোনো bKash যদি flat file ব্যবহার করত, একই ধরনের বাগ চুপচাপ টাকা গায়েব করে দিত।

Let us reproduce sin #1 — redundancy and inconsistency — in plain SQL. Below we model the same flat-file world but inside SQLite, so we can see the duplication clearly:

redundancy.sql
-- Rahim's address is stored in BOTH files — and they disagree!
SELECT 'accounts' AS file, customer_name, customer_addr
FROM accounts_flat
WHERE customer_name = 'Rahim'
UNION ALL
SELECT 'loans', customer_name, customer_addr
FROM loans_flat
WHERE customer_name = 'Rahim';

4. The Birth of the DBMS — IMS, IDS & CODASYL

The first attempt at a real database was born out of necessity. In 1966, NASA's Apollo program had to track over two million parts going to the Moon. No flat-file system could handle the cross-references. IBM and North American Aviation built IMS (Information Management System), the first commercial DBMS, on a hierarchical (tree-shaped) data model.

Around the same time, Charles Bachman at General Electric built IDS (Integrated Data Store), which formalised the network model — a graph of records connected by pointers. The CODASYL committee turned IDS into a standard. Bachman won the 1973 Turing Award for it.

প্রথম DBMS তৈরি হয় প্রয়োজনের তাড়নায়। ১৯৬৬ সালে NASA-র Apollo মিশনে চাঁদে ২০ লক্ষ যন্ত্রাংশ track করতে হচ্ছিল — flat file পারছিল না। তখন IBM তৈরি করে IMS (hierarchical model)। কাছাকাছি সময়ে Charles Bachman তৈরি করেন IDS (network model)। ১৯৭৩ সালে Bachman পান Turing Award।
1966IMS (NASA) 1969IDS · CODASYL 1970Codd's paper 1974System R · SQL 1979Oracle v2 1986SQL standardised Figure 2.2 — DBMS-এর সংক্ষিপ্ত ইতিহাস (১৯৬৬–১৯৮৬)।

Both IMS and IDS were a huge step forward — but they had a problem of their own. To query them, the programmer had to navigate the records: "find this customer node, follow its pointer to the first loan, then to the next loan, then to the branch…" The data model was tied to physical pointers. Change the structure, and every program broke.

5. 1970 — Edgar Codd's 12-Page Revolution

In June 1970, an IBM researcher named Edgar F. Codd published a paper titled "A Relational Model of Data for Large Shared Data Banks" in Communications of the ACM. It is roughly twelve pages long and is one of the most consequential papers in the history of computing.

Codd proposed something audacious: forget pointers. Forget physical structure. Represent data as relations — flat tables of rows and columns — and let the user describe what they want, not how to fetch it. The DBMS would figure out the "how."

Codd's Big Idea (one sentence)
Data should be organised into tables, and queries should be expressed in a high-level language based on mathematical set theory and logic — independent of how the data is physically stored.

ডেটাকে টেবিলে সাজাও, query কে গাণিতিক set theory ও logic-এর ভিত্তিতে high-level ভাষায় লেখো — ভিতরে কীভাবে রাখা আছে সেটা গোপন থাক।
১৯৭০ সালে IBM-এর গবেষক Edgar F. Codd মাত্র ১২ পৃষ্ঠার একটি গবেষণাপত্র প্রকাশ করেন। তিনি বললেন — pointer ভুলে যাও, physical structure ভুলে যাও। ডেটা থাকুক relation অর্থাৎ row-column টেবিলে। ব্যবহারকারী বলবে কী চাই, কীভাবে আনতে হবে সেটা DBMS ঠিক করবে। এটিই আজকের SQL-এর জন্ম-প্রস্তাব।

IBM's own management ignored Codd at first — they had bet the company on IMS. So Codd lobbied through users, lectures, and competitive pressure. In 1973 IBM finally funded a research prototype called System R, which produced the first SQL implementation. A young Larry Ellison read the System R papers and, in 1979, shipped the world's first commercial relational DBMS — Oracle v2 (there was no v1, for marketing reasons). The relational era had begun.

Below is what Codd's vision looks like today — the same bank data, but in a single normalised relational schema. Notice that "Rahim's address" is now stored exactly once.

codd_vision.sql
-- Find every Dhanmondi customer and their total liabilities
SELECT c.name,
       c.address,
       SUM(l.amount) AS total_loan
FROM customer c
JOIN loan l ON l.cust_id = c.cust_id
WHERE c.address LIKE '%Dhaka%'
GROUP BY c.cust_id;

6. File System vs DBMS — Side by Side

📂 File System (সেকেলে)

  • Data scattered, often duplicated.
  • Each program hard-codes byte offsets.
  • No rules — anything can be written.
  • Concurrent access? Hand-build locks.
  • Crash mid-write → corrupt records.
  • Every new question = a new program.

🗄️ DBMS (আধুনিক)

  • Single source of truth via foreign keys.
  • Schema is declarative — metadata lives with data.
  • Constraints (CHECK, UNIQUE, FK) enforce integrity.
  • Transactions handle concurrency & crashes.
  • WAL / journal guarantees durability.
  • Any new question = one SQL query.
File system ছিল কাঁচা টিনের চাল — রোদ-বৃষ্টি একাই সামলাও। DBMS হলো RCC বিল্ডিং — ভিত্তি, ছাদ, drainage সব built-in।

7. Why This History Matters in 2026

You may think: "Why am I learning about IMS and System R when I will use PostgreSQL or MySQL?" Three reasons:

  • Almost every "new" idea in 2026 is a re-invention. Document databases (MongoDB) borrow from the hierarchical model. Graph databases (Neo4j) revive the network model. Knowing the history lets you see what is actually new vs what is rebranded.
  • Modern banking systems still use IMS. Yes, in 2026, billions of dollars flow through IMS every day at major US banks. Some legacy systems in Bangladesh's older banks still keep COBOL files alive on mainframes.
  • Codd's relational vision is the foundation of every SQL query you will ever write. When your JOIN works "magically," that magic is Codd.
"IMS-এর কথা পড়ে কী লাভ?" — এই প্রশ্নের উত্তর: (১) প্রতিটি "নতুন" idea আসলে পুরোনো-র re-invention। MongoDB = hierarchical, Neo4j = network। (২) আজও বিশ্বের অনেক বড় ব্যাংক IMS চালায়। (৩) আপনার লেখা প্রতিটি JOIN-এর পেছনে Codd-এর গণিত।
Quotable insight from Codd
"Future users of large data banks must be protected from having to know how the data is organised in the machine." — E. F. Codd, 1970. This single sentence is the philosophy of every modern database.

"ভবিষ্যতের ব্যবহারকারীদের কখনো জানতে হবে না, ডেটা মেশিনে কীভাবে সাজানো আছে।" — Codd, ১৯৭০।

8. Glossary (শব্দকোষ)

TermMeaningবাংলায়
Flat fileA plain text or fixed-width file with no internal indexes or constraints.Index/constraint বিহীন একটি সাধারণ টেক্সট ফাইল।
RedundancyStoring the same fact in more than one place.একই data একাধিক জায়গায় রাখা।
InconsistencyTwo stored copies disagree.একই তথ্যের দুই কপির মধ্যে অমিল।
IMSIBM's hierarchical DBMS, born from NASA Apollo.NASA-এর জন্য তৈরি IBM-এর hierarchical DBMS।
CODASYL / IDSThe network-model standard from the late 1960s.১৯৬০-এর শেষের network-model মান।
System RIBM's first relational research prototype, birthplace of SQL.IBM-এর প্রথম relational প্রোটোটাইপ; SQL-এর জন্মস্থান।
RelationCodd's word for a table — a set of tuples.Codd-এর ভাষায় "table"।
Declarative queryYou say what you want; the DBMS picks how.আপনি কী চান বলেন, কীভাবে আনতে হবে DBMS ঠিক করে।

9. Practice Problems

Try each problem yourself, then click Show Answer. Several answers contain runnable SQL.

প্রতিটি প্রশ্ন আগে নিজে চেষ্টা করুন, তারপর Show Answer চাপুন।
  1. Name three of the five problems with flat-file processing and give a one-line example of each.
    Flat-file processing-এর পাঁচটি সমস্যার মধ্যে তিনটি বলুন এবং এক লাইনে উদাহরণ দিন।
    ✨ Show Answer (উত্তর দেখুন)

    Sample answer: (1) Redundancy — Rahim's address stored in both accounts.dat and loans.dat. (2) Inconsistency — Rahim moves; only accounts.dat is updated. (3) No integrity — a loan is recorded for a non-existent customer.

    (১) Redundancy — Rahim-এর address দুই ফাইলেই; (২) Inconsistency — এক ফাইলে আপডেট, অন্যটি পুরোনো; (৩) Integrity-এর অভাব — যে customer নেই তার নামে loan ঢুকে যায়।

  2. Build the same flat-file customer redundancy problem in SQL and prove the address conflict using a single query.
    SQL-এ একই redundancy-সমস্যা বানিয়ে একটিমাত্র query দিয়ে প্রমাণ করুন যে address-এ অমিল আছে।
    ✨ Show Answer (উত্তর দেখুন)
    ans2.sql
    SELECT a.cust,
           a.addr AS addr_in_acct,
           l.addr AS addr_in_loans
    FROM acct a
    JOIN loans l ON a.cust = l.cust
    WHERE a.addr <> l.addr;
  3. Who created the relational model, and in what year? In one sentence, what was its key insight?
    Relational model কে এবং কোন সালে তৈরি করেন? এক বাক্যে এর মূল ধারণাটি লিখুন।
    ✨ Show Answer (উত্তর দেখুন)

    Answer: Edgar F. Codd, in 1970. Insight: data should be modelled as flat tables (relations) and queried by a high-level declarative language, hiding all physical storage details from the user.

    Edgar F. Codd, ১৯৭০ সালে। মূল ধারণা: ডেটাকে flat টেবিলে রাখো এবং declarative ভাষায় query করো — physical storage-এর বিস্তারিত ব্যবহারকারী থেকে গোপন থাকুক।

  4. Using a normalised schema, list every customer and the total of (account balances + loans). Use the runnable block.
    Normalised schema ব্যবহার করে প্রতিটি customer-এর (account balance + loan)-এর যোগফল বের করুন।
    ✨ Show Answer (উত্তর দেখুন)
    ans4.sql
    SELECT c.name,
           COALESCE((SELECT SUM(balance) FROM account WHERE cid=c.cid),0) +
           COALESCE((SELECT SUM(amount)  FROM loan    WHERE cid=c.cid),0) AS total_exposure
    FROM customer c
    ORDER BY total_exposure DESC;
  5. Explain the difference between hierarchical, network, and relational models in three sentences.
    Hierarchical, network এবং relational model-এর পার্থক্য তিন বাক্যে।
    ✨ Show Answer (উত্তর দেখুন)

    Answer: Hierarchical (IMS) arranges records as a tree — strict parent-to-child links. Network (CODASYL/IDS) generalises this to a graph where any record can point to any other through manually maintained pointers. Relational (Codd) abandons pointers entirely; everything is a flat table joined by matching values, leaving the DBMS to choose the access path.

    Hierarchical (IMS): ডেটা একটি গাছের মতো — parent-child শৃঙ্খলা কঠিন। Network (CODASYL): যেকোনো record যেকোনো record-কে pointer-এ ছুঁতে পারে। Relational (Codd): pointer নেই, সব table — JOIN-এ মিল-যাচাই, পথ DBMS-ই বেছে নেয়।

  6. Show what happens when a flat-file program tries to insert a duplicate primary-key record into a relational table.
    যদি একটি flat-file প্রোগ্রাম relational table-এ duplicate primary key insert করতে চায়, কী হবে দেখান।
    ✨ Show Answer (উত্তর দেখুন)
    ans6.sql
    -- DBMS will reject this — that's the whole point
    INSERT INTO student VALUES (101, 'Different Person');
    
    SELECT * FROM student;

    Flat file হলে দ্বিতীয় rolled = 101 চুপচাপ ঢুকে যেত। DBMS-এ PRIMARY KEY constraint তা আটকায়।

Summary — Module 02

From punched cards in 1965 to relational databases in 1979, the industry traded redundant, fragile, program-coupled flat files for a model that is declarative, integrity-checked, and concurrent. The hierarchical IMS solved some problems; the CODASYL network model solved a few more; but it took Codd's 1970 paper and IBM's System R prototype to give us the relational model and SQL — the language we will spend the rest of this course mastering.

১৯৬৫-এর punched card থেকে ১৯৭৯-এর relational DBMS পর্যন্ত — পথটি ছিল redundant, ভঙ্গুর, প্রোগ্রাম-নির্ভর flat file ছেড়ে এমন একটি model-এ যাওয়া যা declarative, integrity-চেক করা, এবং concurrent। IMS কিছু সমস্যা সমাধান করল, CODASYL আরও কিছু — কিন্তু আসল বিপ্লব এনেছিল Codd-এর ১৯৭০-এর গবেষণা এবং IBM-এর System R। এই কোর্সের বাকি অংশে আমরা সেই relational model আর SQL-ই গভীরভাবে শিখব।

Next Module → Database System Architecture — 3-tier ও ANSI/SPARC মডেল, যা প্রতিটি DBMS-এর ভেতরের নকশা।