From the outside, a database feels like a single black box. Inside, it divides into three distinct areas: the people who use it, the layer that translates their requests into machine operations, and the layer that actually manages data on disk. Each area has its own logic and its own failure modes.
Key facts
- Users split into DBAs, end users, and application programmers.
- The query processor converts high-level statements into low-level operations.
- The storage manager handles disk, files, and the data dictionary.
- DDL, DML, and query processors each handle a different type of statement.
- The query evaluation engine executes the translated operations.
The three kinds of users
Database administrators (DBAs) own the schema. They use Data Definition Language (DDL) to define tables, types, and constraints, routing their commands through the DDL processor. End users interact through a query interface, submitting requests that travel through the query processor. Application programmers write code embedding Data Manipulation Language (DML) statements, which go through the DML processor. The DBMS routes each statement type to its appropriate handler.
How the query processor works
This section breaks down when you need to intervene. The DDL processor compiles schema statements from DBAs and stores definitions in the data dictionary. The query processor handles statements from end users, converting them into low-level form. The DML processor manages statements from application programmers, translating them for execution. All three feed into the query evaluation engine, which runs the actual operations. The embedded DML pre-compiler handles application code, converting embedded statements to procedure calls in the host language.
Inside the storage manager
This module bridges low-level data and application programs. The data dictionary stores metadata—definitions, constraints, and system facts. The authorization and integrity manager controls access and enforces rules. The command processor executes compiled statements, while the query optimizer finds the cheapest execution path. The transaction manager keeps the database consistent across concurrent operations. The scheduler orders tasks to prevent conflicts, and the buffer manager moves data between disk and memory. The recovery manager tracks changes for rollback and backup.
Who should care
| Audience | What matters to them |
|---|---|
| Students | Labeling problems correctly; matching symptoms to components |
| Junior developers | Understanding why queries go through multiple layers |
| Interview candidates | DDL vs DML vs query processor distinctions |
| Application developers | DML processor, transaction manager, and buffer manager behavior |
| DBAs | DDL processor, data dictionary, and authorization manager |
A worked example
When an end user runs a SELECT, the interactive query component identifies the statement and converts it to low-level form. The query compiler prepares it for execution. The query evaluation engine pulls pages from disk through the storage manager, and the buffer manager moves the data into memory. A result set returns to the user. When a DBA created the table, the path was different: DDL statements went through the DDL processor, and definitions landed in the data dictionary.
What to watch next
The transaction manager, recovery manager, and buffer manager sit between the query evaluation engine and physical storage. They determine behavior during concurrent operations, system crashes, and memory caching. These are where real-world reliability problems appear.
Key takeaways
- A DBMS divides into users, a query processor, and a storage manager.
- DDL, DML, and query processors handle different statement types from different audiences.
- The data dictionary stores metadata about schema, constraints, and authorization rules.
- The query evaluation engine executes the low-level operations produced by the compilers.
- The storage manager's transaction and recovery managers handle concurrency and fault tolerance.
Frequently asked questions
What are the main components of a database system?
Users (DBAs, end users, application programmers), the query processor (DDL, DML, and query processors), and the storage manager with its data dictionary and related managers.
What does the storage manager do?
It provides the interface between data on disk and application programs, manages the data dictionary, optimizes queries, handles transactions, and controls data movement between memory and storage.
What is the data dictionary?
A metadata store that records the schema, constraints, authorization rules, and other system-level facts about the database.
What is the query evaluation engine?
The component that executes the low-level operations translated by the DDL, DML, and query compilers.
Why split DDL, DML, and queries into separate processors?
Each serves a different audience and different operations. DBAs need schema control, end users need query results, and programmers need data access in code. Separate processors keep the system modular and optimizable.