Database Fundamentals
Every software application you use — from a simple todo app to a banking system spanning thousands of servers — needs to store and retrieve data. The way data is stored determines how fast, how reliably, and how securely the application works.
Database Fundamentals is about understanding the why before the how.
This chapter builds the foundation for every DBMS concept you will study later.
Learning Objectives
After completing this chapter, you will be able to:
- Define data, information, and knowledge.
- Explain the difference between a database and a DBMS.
- List the advantages of a DBMS over a file system.
- Understand the different types of databases.
- Describe the database lifecycle.
- Identify the core functions of a DBMS.
- Recognize the role of metadata and data dictionaries.
What is Data?
Data is raw, unprocessed facts.
Data has no meaning by itself.
Examples:
- 42
- Rahul
- 2003-05-12
- ₹5000
These are just numbers, names, and values.
There is no context.
Data is the raw material for information.
What is Information?
Information is data with context and meaning.
When data is processed, organized, or structured, it becomes information.
Example
| Data | Context | Information |
|---|---|---|
| 42 | Age of a Student | Student is 42 years old |
| Rahul | Name of a Customer | Customer name is Rahul |
| 2003-05-12 | Date of Birth | Date of Birth is 12 May 2003 |
| ₹5000 | Bank Account Balance | Account Balance is ₹5000 |
Information is useful for decision-making.
What is a Database?
A Database is an organized collection of structured data stored electronically.
Think of a library.
A library stores books in an organized way so you can find any book quickly.
Similarly, a database stores records in an organized way so you can find any record quickly.
Examples of Databases:
- A university database storing student records
- A bank database storing transaction history
- A hospital database storing patient information
- An e-commerce database storing product catalogs
What is a DBMS?
A Database Management System (DBMS) is software that manages databases.
It provides a way to:
- Store data
- Retrieve data
- Update data
- Delete data
- Secure data
- Maintain data integrity
Without a DBMS, developers would have to manually manage files, handle concurrent access, enforce security, and recover from crashes.
The DBMS does all of this automatically.
DBMS vs File System
Before DBMS, data was stored in simple files.
| Aspect | File System | DBMS |
|---|---|---|
| Data Redundancy | High (same data in multiple files) | Low (centralized storage) |
| Data Inconsistency | Common (updates miss some files) | Rare (one source of truth) |
| Concurrent Access | Limited (file-level locking) | Full (row-level locking, MVCC) |
| Security | Basic (OS file permissions) | Granular (user roles, views) |
| Crash Recovery | Manual | Automatic (logs, checkpoints) |
| Query Capability | None (manual search) | Powerful (SQL, joins, filters) |
Core Functions of a DBMS
A DBMS performs these essential functions:
1. Data Storage Management
The DBMS handles how data is physically stored on disk — managing pages, blocks, files, and storage allocation. The user never needs to know the exact file paths.
2. Data Manipulation
Users can insert, update, delete, and retrieve data using query languages like SQL.
3. Data Security
The DBMS controls who can access what data through authentication, authorization, encryption, and views.
4. Data Integrity
Constraints like PRIMARY KEY, FOREIGN KEY, CHECK, NOT NULL, and UNIQUE ensure the data remains accurate and consistent.
5. Transaction Management
The DBMS ensures that multiple operations are executed as a single atomic unit, and that concurrent transactions don’t interfere.
6. Concurrency Control
Multiple users can read and write simultaneously without corrupting data.
7. Backup and Recovery
The DBMS automatically protects against data loss using logs, checkpoints, and recovery algorithms.
8. Data Independence
Changes in physical storage (like moving from HDD to SSD) do not affect how applications access data.
Types of Databases
By Data Model
| Type | Description | Examples |
|---|---|---|
| Relational | Data in tables with rows and columns | MySQL, PostgreSQL, Oracle |
| Document | Data in JSON-like documents | MongoDB, CouchDB |
| Key-Value | Simple key-value pairs | Redis, DynamoDB |
| Column-Family | Data in columns instead of rows | Cassandra, HBase |
| Graph | Data as nodes and edges | Neo4j, ArangoDB |
By Usage
| Type | Description |
|---|---|
| Operational (OLTP) | Handles daily transactions (banking, e-commerce) |
| Analytical (OLAP) | Handles complex queries for reporting and analysis |
| Data Warehouse | Central repository for historical data from multiple sources |
Database Lifecycle
Every database goes through a lifecycle.
Requirement Analysis
↓
Conceptual Design (ER Model)
↓
Logical Design (Relational Model)
↓
Normalization
↓
Physical Design (Indexes, Partitions)
↓
Implementation (SQL)
↓
Testing
↓
Deployment
↓
Maintenance & Optimization
1. Requirement Analysis
Understand what data needs to be stored. Talk to users, identify entities, relationships, and business rules.
2. Conceptual Design
Create an Entity-Relationship (ER) diagram showing entities, attributes, and relationships. This is technology-independent.
3. Logical Design
Convert the ER diagram into relational tables. Define keys, constraints, and normalization rules.
4. Normalization
Eliminate redundancy and ensure data integrity by applying normal forms (1NF through BCNF and beyond).
5. Physical Design
Decide how data will actually be stored — indexes, partitions, clustering, file organizations, and storage parameters.
6. Implementation
Write SQL statements to create tables, views, indexes, and populate data.
7. Testing
Verify the database meets requirements. Test for performance, security, concurrency, and data integrity.
8. Deployment
Move the database to production servers. Set up backups, monitoring, and replication.
9. Maintenance
Continuously monitor performance, optimize queries, rebuild indexes, update statistics, and apply schema changes as requirements evolve.
Metadata and Data Dictionary
Metadata is “data about data.”
It describes the structure of the database.
Examples of metadata:
- Table names
- Column names
- Data types
- Constraints
- Indexes
- Views
- User permissions
Data Dictionary (or System Catalog) is where metadata is stored.
When you run DESCRIBE table; or query INFORMATION_SCHEMA, you are reading from the data dictionary.
Why Companies Invest in Databases
Consider Flipkart during a Big Billion Day sale.
- Millions of users browse products simultaneously.
- Thousands of orders are placed every second.
- Inventory must be updated in real-time.
- Payments must be processed reliably.
- No data should be lost if a server crashes.
A file system cannot handle this.
A well-designed database system can.
This is why every major company invests heavily in database infrastructure, database administrators, and database engineers.
Interview Deep Dive
Q: Why can’t we use text files for a banking application?
A: Text files have no concurrency control (two users writing can corrupt data), no crash recovery (a crash mid-transfer loses your money), no security beyond OS permissions (anyone with file access sees all data), and no query capability (finding a specific transaction requires scanning the entire file). A DBMS solves all of this.
Q: What is the difference between data and information?
A: Data is raw, unprocessed facts like “42” or “Rahul”. Information is data with context — “42” becomes “Age is 42”. Information is data that has been processed, organized, and given meaning to support decision-making.
Q: Is every DBMS an RDBMS?
A: No. An RDBMS (Relational DBMS) is a specific type of DBMS that stores data in tables with rows and columns and enforces relationships through keys. All RDBMS are DBMS, but not all DBMS are RDBMS. MongoDB is a DBMS (document-based), not an RDBMS.
Q: What is the difference between a data dictionary and a database?
A: A database stores user data (like customer records). A data dictionary stores metadata — information about the database structure itself (table names, column types, constraints). The data dictionary is stored inside the database as system tables.
Key Takeaways
- Data is raw facts; information is processed data with meaning.
- A database is an organized collection of data.
- A DBMS is software that manages databases.
- DBMS solves redundancy, inconsistency, concurrency, security, and recovery problems.
- Databases go through a lifecycle from requirements to maintenance.
- Metadata describes the structure of data.
- Different types of databases exist for different use cases.
Premium Content
Unlock Database Fundamentals and all premium lessons with a subscription.
From ₹199.99/year — See plans