Skip to main content
⚡ OpenDevDocs
Database Fundamentals
databasedatabase-fundamentalsCore ConceptBeginner

What is a Database?

Understand databases, DBMS architectures, data persistence, and how databases differ from flat file storage.

Verified: 2026-09-30
Platforms:
nodelinux
#database#dbms#sql#storage#backend

Overview

A Database is an organized, structured collection of data stored electronically in a computer system. It is managed by a Database Management System (DBMS)—a software suite that handles data storage, querying, concurrency control, security, and crash recovery.


Databases vs Flat Files

FeatureFlat Files (JSON, CSV, SQLite file)Database Management System (PostgreSQL, MySQL)
ConcurrencyFile locking prevents concurrent writesThousands of concurrent simultaneous reads and writes
IntegrityApplication code must manually enforce rulesForeign keys, unique constraints, and check rules
Query PerformanceScans entire file into memory ($O(N)$)B-Tree indexes and query planners find rows in $O(\log N)$
Crash SafetyPartial writes corrupt files on sudden power lossWrite-Ahead Logging (WAL) and ACID transactions guarantee durability
Security & RolesFile permissions apply to whole fileFine-grained column-level, table-level, and row-level access control

The Core ACID Guarantees

Enterprise DBMS engines guarantee ACID properties for data operations:

  • Atomicity: All operations within a transaction succeed together or fail completely with zero partial state left behind ("all or nothing").
  • Consistency: Data must always adhere to predefined schema constraints, foreign keys, and validation rules.
  • Isolation: Concurrent transactions execute independently without interfering with each other's intermediate state.
  • Durability: Once a transaction is committed, changes are permanently recorded to non-volatile disk storage even if the server immediately loses power.

High-Level DBMS Architecture

Application (Backend Server)
          │  SQL Query / Network Protocol
          ▼
┌───────────────────────────────────────┐
│     Database Management System        │
│ ┌───────────────────────────────────┐ │
│ │ Connection Manager & Auth         │ │
│ ├───────────────────────────────────┤ │
│ │ SQL Parser & Query Optimizer      │ │
│ ├───────────────────────────────────┤ │
│ │ Execution Engine & Lock Manager   │ │
│ ├───────────────────────────────────┤ │
│ │ Buffer Pool / In-Memory Cache     │ │
│ ├───────────────────────────────────┤ │
│ │ Storage Engine & WAL (Disk Files) │ │
│ └───────────────────────────────────┘ │
└───────────────────────────────────────┘

On this page