AlgoPlusAlgoPlus
Learn/Databases
Lesson

DBMS Architecture

The three-schema (ANSI-SPARC) architecture separates user views, the logical design, and physical storage — buying data independence.

8 min read Watch it move Build it

A DBMS is organised into three layers so different people can work without tripping over each other. This is the three-schema (ANSI-SPARC) architecture. The point of the split is *separation of concerns*: how the data is used, how it is designed, and how it is stored are three different jobs, and each should be able to change without disturbing the others.

The three levels, top to bottom

  1. 1External level (views) — what a particular user or app sees: a slice of the data reshaped for them, hiding the rest. One database serves many such views.
  2. 2Conceptual (logical) level — the single complete logical design: every table, field, relationship, and rule, described *without* saying how it is physically stored.
  3. 3Internal (physical) level — how the data is actually held on disk: file layout, record format, compression, and which indexes exist.
A worked example
A payroll clerk's external view shows only (name, salary). The conceptual schema is the full Employee(emp_id, name, salary, ssn, dept_id, ...) table plus its relationships. The internal schema decides that Employee is a heap file with a B-tree index on emp_id. Three descriptions of one database.

The payoff — two kinds of data independence

Because the levels are mapped to each other rather than fused, you get two freedoms. Logical data independence: change the conceptual design — add a field, split a table — without breaking the external views or the apps using them. Physical data independence: change how data is stored — add an index, reorganise files, swap disks — without altering the logical design or any view.

Which independence is easier?
Physical data independence is the one databases achieve most fully — adding an index or changing file layout is invisible above the internal level. Logical data independence is harder, because external views are defined directly on top of the conceptual schema.
OperationTimeSpace
External level · tailored slicesmany viewsper user/app
Conceptual level · tables, rulesone schemawhole design
Internal level · on diskstoragefiles, indexes
Check yourself
You add a non-clustered index to speed up a query. Which kind of data independence lets you do this without changing any application?