Skip to content
BENIBIX Learn

Physical Data Model

Data🧭 FoundationsData Modeling

Also known as Physical Model

The data plan for one real database. It has exact column types and indexes.

Think of it like

It is like the builder's plan. It says which bricks, which pipes and how thick each wall is.

Example

The library builds Loan in PostgreSQL. Dates are DATE, IDs are BIGINT, and member ID gets an index.

Why it matters

This is the level that runs. Types, indexes and sizes set the speed and cost of every query.

Definition

A physical data model is the plan written for one real database. It turns each field into a column with an exact type, such as INT or VARCHAR(100). It adds indexes, partitions and other choices that make reads fast. You can run it as code to create the tables. A change of database means a new physical model.

Example code

sql
CREATE TABLE loan (
  loan_id   BIGINT PRIMARY KEY,
  member_id BIGINT NOT NULL REFERENCES member,
  book_id   BIGINT NOT NULL REFERENCES book,
  due_date  DATE NOT NULL
);
The library's Loan as a real table, with exact types and keys.

Common mistake

Starting here. Without the first two levels, the tables follow one database's habits. They should follow the business.

Key takeaways

  1. 1
    Exact types. Each column gets a real type.
  2. 2
    Built for speed. Indexes and partitions are chosen.
  3. 3
    Runs as code. It creates the real tables.

Compare

Learn it properly