Learning Objectives

By the end of this chapter, you will be able to:

  • Describe the file system approach as separate sheets per counter and name its eight risks in three groups.
  • Explain the database approach as one shared store under a DBMS and group its controls by integrity, security, and concurrency.
  • Compare the two approaches on redundancy, consistency, sharing, and total cost with a Nepal retail or hotel budget in NPR on a BS 2081 date.
  • Decide when a file remains enough and what signal forces a move to a database for audit and VAT reporting.

Three sheets, two phones, one failed delivery

A mart in Butwal runs three sibling files. Counter keeps counter.xlsx, Accounts keeps ledger.xlsx, and Home Delivery keeps delivery.xlsx. Each holds the member phone. On 2081-08-22 member M-2144 Sita changes her number and tells only Delivery. Accounts still holds the old number. That afternoon Accounts sends the payment reminder to the old number. Sita never receives it. The three files also cannot answer the owner who asks for one report that joins stock and bills for 600 SKUs. The data exists. The shape prevents the answer.

The shop did not need more data. It needed one place for the data with rules around it.

Framework 1: The file system and what breaks in three groups

The file system approach stores data in separate application files per counter or branch. Today that is usually separate spreadsheets per person or per outlet. A database in contrast stores related data once in linked tables. A DBMS is the software that guards those tables and serves many users from one copy. Do not memorise eight problems as a flat list. Group them so you see the impact before the label.

A. Data shape: redundancy, inconsistency, isolation

  • Redundancy is the same fact stored many times. Member phone lives in three files. One change demands three edits, so staff skip two.
  • Inconsistency follows redundancy. One phone updated and two not means the shop holds two truths for one person. A delivery fails, then trust fails.
  • Isolation is trapped data. Sales in one format cannot join stock in another without retyping. The owner cannot run one query for stock out plus failed deliveries because the data never shared a key.

B. Program ties and weak rules: dependence and integrity

  • Program data dependence: a program is bound to one file layout. Add a field such as hsn_code and every program that reads the old layout needs rewriting.
  • Integrity problems: rules like quantity cannot be negative or bill must have a member live as code inside each app, so they are missed in some apps and enforced in others. No single gate blocks a duplicate member or a bill without a SKU.

C. Sharing risks: security, concurrency, backup

  • Poor security: control is at the file level, so copying is easy and tracing edits is hard. Anyone with the sheet can change the past.
  • Concurrent access loss: two cashiers edit the same file and one overwrites the other, so one sale disappears.
  • Fragile backup: each counter backs up its own way or not at all. Recovery is guesswork, as VAT deadlines do not wait for guesses.
Counter File Holds Sita phone M-2144 Value on 2081-08-22
Counter counter.xlsx Yes 9841-000111, old
Accounts ledger.xlsx Yes 9841-000111, old
Delivery delivery.xlsx Yes 9851-000222, new

Three copies, two values, no reliable report. Redundancy, inconsistency, and isolation in one row.

flowchart TB
  A1[Counter app] --> F1[(counter.xlsx)]
  A2[Accounts app] --> F2[(ledger.xlsx)]
  A3[Delivery app] --> F3[(delivery.xlsx)]
  B1[Counter form] --> DBMS[DBMS] --> D[(Members: one row)]

Framework 2: The database as one truth with a gatekeeper

The database approach stores all related data centrally. The DBMS enforces who reads, who writes, and what counts as valid. MySQL, PostgreSQL, Oracle, and SQL Server are common choices. A retail chain needs the tables, not the brand.

What the gatekeeper enforces, in three groups

  • Integrity as single definition: constraints are defined once and checked for every write. A primary key on member_id blocks a duplicate Sita. A foreign key blocks a bill that points to no SKU. A check blocks a negative quantity.
  • Security as role, not file: the DBMS grants access by user and by field. A cashier can post but not delete. An auditor can read but not edit. The log shows who changed what on which BS date.
  • Concurrency and recovery as built ins: the DBMS locks correctly so two cashiers do not overwrite each other, and it offers backup and restore as a tested routine rather than a hope.

Isolation disappears because tables share keys. Dependence shrinks because programs read a stable view while storage evolves underneath.

What centralisation costs

A single gate is also a single point of failure. Design, hardware plus backup, and a restore owner must be priced against monthly rework.

Framework 3: Side by side on the same shop facts

Aspect File system of three sheets Database under a DBMS
Redundancy High. One phone three times Controlled. One phone one row
Consistency Poor. Two values for M-2144 High. One edit reaches all views
Sharing and reporting Hard. Join needs retyping Easy. One SQL joins bills and stock
Integrity rules Per app, often missed Central, enforced each time
Security File copy, weak trace User and field level, logged
Concurrency Overwrite risk at counter Locked by DBMS
Backup and recovery Manual, uneven Built in and tested
Cost and skill Low today Higher upfront, cheaper per report

When a file is still enough

One user, few records, low risk, and no shared editing. A price list of 40 items on one laptop is fine as a sheet. A mart with 5,000 members, shared edits, and a filing duty for VAT is not. A 20 room lodge that must prove occupancy and VAT by guest is not.

Self-check

Nepal worked example: the cost of two phones for one member on BS 2081-08-23 (NPR)

A three outlet mini mart in Rupandehi has 4,600 active members. The owner prices both approaches on 2081-08-23.

File system cost today: zero licence. Monthly pain: two staff spend three days each on reconciliation at Rs 1,800 a day. That is 2 times 3 times 1,800 = Rs 10,800 a month. Annual = Rs 129,600. Add one VAT correction risk: a quarterly report built from three sheets misses Rs 2,200 of output VAT because a Rs 16,923 service bill was in the wrong sheet and omitted. With 13 percent VAT the shortfall is Rs 2,200, plus a late fee of about Rs 2,500, total Rs 4,700 in one quarter. Annualise that as a plausible exposure of about Rs 10,000.

Database cost: design plus migration Rs 55,000, a small server Rs 75,000, UPS Rs 15,000, backup disk Rs 10,000. Build = Rs 155,000 in year one. DBMS is PostgreSQL community edition at zero licence. Annual support Rs 48,000 at Rs 4,000 a month, plus disk and power about Rs 10,000. Annual run = Rs 58,000 from year two.

Proof of fix: members holds one row per ID with unique on member_id and phone. Sita M-2144 has one phone 9851-000222. A second insert of 9841-000111 fails. Delivery reads that one field.

Payback: waste Rs 129,600 versus run Rs 58,000 saves Rs 71,600 a year after build. Build Rs 155,000 recovers in about 26 months before penalties. The question is whether the shop can afford three truths.

Summary

  • File system copies a fact per counter, so redundancy creates inconsistency and isolation plus weak integrity and risky sharing.
  • Database stores one fact once under a DBMS that enforces keys, roles, locking, and backup. Counters read one row with different permissions.
  • Price reconciliation and penalty exposure against build and run fee. Waste shows before any fine.

Next: database models, DBMS, business advantages.

Key Takeaways

  • One member, one row, keyed by member ID. That one rule cures most drift.
  • Isolation is not a data shortage. It is a key shortage. Shared keys let bills join stock without retyping.
  • A cheap file can be expensive at filing time. The VAT report reads the same store that the counter writes or it reads a different store that drifts.

Discussion Questions

  1. A new supplier needs a new field. Why does the file system force edits across counters while the database can add a column once.
  2. Who should hold delete permission on the members table and what approval plus log entry should precede a delete.
  3. A manager argues that cloud sheets solve concurrency. What still fails on integrity and backup if there is no keyed table beneath the sheets.

Exercises

Short answer

  1. Define redundancy and inconsistency with the Sita M-2144 case of two phones on 2081-08-22.
  2. What is program data dependence and why does adding a field break file based counter programs.
  3. What is a DBMS and which of its controls solves which of the three sharing risks.

Long answer

  1. Explain eight limits of the file system in three groups: data shape, program ties and weak rules, and sharing risks. Illustrate each with the Butwal three file case.
  2. Compare the file system and the database approach on redundancy, consistency, sharing, integrity, security, concurrency, backup, and cost, and show the Rs 71,600 annual saving after the Rs 155,000 build using the BS 2081-08-23 mart figures. State the signal that tells a retail shop that sheets are no longer enough for VAT duties.