Menu

Earn Premium with Referrals

Invite your friends and earn Premium rewards through our referral program.

See how it works and start inviting friends.

Introduction to DBMS
DBMS

Introduction to DBMS

Start your DBMS journey with a clear roadmap of what to study and why it matters for interviews.

Introduction to DBMS

Database Management Systems (DBMS) form a core part of any technical interview. Whether you’re aiming for a software dev role or a data engineering position, you cannot escape questions on ACID properties, Normalization, or Indexing.


Learning Objectives

After completing this chapter, you will be able to:

  • Understand why we need a DBMS over file systems.
  • Differentiate between schema and instance.
  • Explain the three-schema architecture.
  • Understand data independence and its types.
  • Describe the core functions of a DBMS.
  • Identify different types of databases.
  • Prepare for the deeper chapters ahead.

What is a DBMS?

A Database Management System (DBMS) is software that manages databases. It provides a systematic way to store, retrieve, update, and secure data while handling concurrent access, crash recovery, and data integrity automatically.

Think of a DBMS as a smart librarian who not only stores books but also keeps a catalog, ensures no two members take the same book copy, recovers the catalog if pages tear, and lets you search by title, author, or genre instantly.


Why Not Just Use Files?

Before DBMS, data was stored in flat files. Here’s why that breaks at scale:

ProblemFile SystemDBMS Solution
RedundancySame data stored in multiple filesCentralized storage with controlled duplication
InconsistencyUpdating one file leaves others staleSingle source of truth with constraints
Concurrent accessFile-level locking (one user blocks all)Row-level locking, MVCC
Crash recoveryManual — corrupted files lose dataAutomatic logs, checkpoints, undo/redo
SecurityOS-level file permissions onlyUser roles, views, encryption
Query capabilityNone — grep through files manuallySQL with joins, filters, aggregations

Core Functions of a DBMS

FunctionWhat it does
Data Storage ManagementHandles physical storage on disk — pages, blocks, files
Data ManipulationINSERT, UPDATE, DELETE, SELECT via SQL
Data SecurityAuthentication, authorization, encryption, views
Data IntegrityConstraints (PK, FK, CHECK, UNIQUE, NOT NULL)
Transaction ManagementACID properties for reliable operations
Concurrency ControlMultiple users simultaneously without corruption
Backup and RecoveryLogs, checkpoints, undo/redo for crash safety
Data IndependenceChanges in storage don’t affect applications

Types of Databases

By Data Model

TypeDescriptionExamples
RelationalTables with rows and columnsMySQL, PostgreSQL, Oracle
DocumentJSON-like documentsMongoDB, CouchDB
Key-ValueSimple key-value pairsRedis, DynamoDB
Column-FamilyColumns instead of rowsCassandra, HBase
GraphNodes and edgesNeo4j, ArangoDB

By Usage

TypeDescription
OLTP (Operational)High-volume daily transactions (banking, e-commerce)
OLAP (Analytical)Complex queries for reporting and analysis
Data WarehouseCentral repository for historical data from multiple sources

Database Lifecycle

Requirement Analysis → Conceptual Design (ER Model)
    → Logical Design (Relational Model) → Normalization
    → Physical Design (Indexes, Partitions) → SQL Implementation
    → Testing → Deployment → Maintenance

Each stage is essential. Skipping design leads to costly rework later.


What This Section Covers

This introduction section gives you the big picture:

  1. Fundamental Intuition: Why DBMS? (DBMS vs. File System)
  2. Core Concepts: Abstraction, independence, architecture
  3. The Vocabulary: Schema, instance, metadata
  4. DBMS vs RDBMS: What makes a DBMS “relational”

Learning Strategy

  • Concepts First: Don’t memorize definitions. Understand the problem each concept solves.
  • Interview Focus: Pay close attention to the HorizontalTab sections — they contain real-world interview questions.
  • Progressive Depth: Start with 1-tier vs 3-tier architecture and move to B+ Trees and lock protocols.

Let’s begin by understanding why we stopped using simple text files to store data and switched to DBMS.


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, and no query capability (finding a transaction requires scanning the entire file). A DBMS solves all of this.

Q: What happens to the schema when data is inserted?

A: Nothing. The schema is the structure — it remains unchanged. Only the instance (the actual data) changes. When you INSERT a row, the instance grows but the schema definition stays the same.

Q: Is every DBMS an RDBMS?

A: No. An RDBMS 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 (customer records, orders). 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

  • A DBMS is software that manages databases with security, concurrency, and recovery.
  • File systems fail at scale due to redundancy, inconsistency, and lack of concurrency.
  • A DBMS provides data independence — changes at one level don’t affect higher levels.
  • Schema is the blueprint; instance is the actual data.
  • Different database types exist for different use cases (relational, document, graph).
  • The database lifecycle ensures systematic development from requirements to maintenance.

My Private Notes

Notes are auto-saved locally to this device.