FoundationLesson 1 of 2 in IntroductionFree preview

DBMS vs File System

A DBMS (Database Management System) is software that stores data and controls every access to it. MySQL, PostgreSQL and Oracle are examples. Before DBMSs, programs kept data in plain files, and each program read and wrote its own files.

That caused real problems:

Problem with filesHow a DBMS helps
Redundancy: the same data copied in many filesOne shared, normalized copy
Inconsistency: copies drift apartUpdate once, constraints enforce rules
No easy queryingA query language (SQL)
Concurrent access corrupts dataLocking and transactions
A crash leaves half-done updatesAtomicity and recovery
Weak securityUsers, roles and permissions

Example: a bank stores a customer's address in both savings.txt and loans.txt. The customer moves, and only one file is updated. Now the bank has two addresses for one person. That is inconsistency, and redundancy caused it.

A DBMS is not free. It costs money, needs trained people and adds overhead. For a tiny single-user app, a file can be the better choice.

In interviews: "Why use a DBMS instead of files?" List redundancy, inconsistency, concurrency, atomicity and security, with one example each.

Practice

Solve 3 of 4 to complete this lesson.

0/4 solved

Solve 3 more to complete this lesson, or move on and come back later.

Skip to next: Three Schema Architecture