Differentiate between file system and database system with an example.
Differentiate between file system and database system with an example.
Differentiate between file system and database system with an example.
Best answer
Answer: In a file system each application keeps its own files and must handle storage, searching and checking itself, which leads to redundancy and inconsistency; in a database system all data is stored once in an integrated database managed by a DBMS, which gives querying, integrity, security, concurrent access and recovery.
| Point | File system | Database system (DBMS) |
|---|---|---|
| Storage | Data kept in separate files owned by each application | Data kept in one integrated database (tables) managed by the DBMS |
| Redundancy and consistency | Same data repeated in many files; copies can disagree (inconsistency) | Redundancy is controlled, so data stays consistent |
| Data access | A new program must be written for every new query | Any query can be written in SQL |
| Data independence | File format is built into programs; changing it means changing programs | Programs are insulated from storage details (data independence) |
| Integrity | Rules (e.g. marks ≤ 100) are coded inside each program | Constraints (primary key, foreign key, CHECK) are declared once and enforced by the DBMS |
| Concurrent access | Simultaneous updates can overwrite each other | Concurrency control and transactions (ACID) handle many users safely |
| Security | Only file-level permissions | Users, roles and privileges on tables, columns and views |
| Backup and recovery | Manual; a crash can leave files half-updated | Automatic recovery to a consistent state using logs |
| Cost and size | Cheap and simple for small, single-user data | Needs DBMS software and skilled staff; best for large shared data |
Example: student records in a college
Log in or create a free account to answer this question.