Understanding databases without metaphor - structuring data, storing permanently, and quickly retrieving system
Database
"System for storing, managing, and providing data quickly when needed."
There are three core principles here.
1⃣ Structure of data (Structure)
Data cannot be stored in any form.
Databases store data according to a specified structure.
This structure consists of three main elements:
Database
The top space where data can exist.
A single DB can contain multiple types of data sets.
Table
A collection of data with the same attributes.
E.g., list of buildings, list of members, list of posts, etc.
Every Table has a fixed structure (Schema).
In other words, what attributes exist, what their names are, and what data types they are defined clearly.
Record
An individual unit of data stored in a Table.
Records are stored in accordance with the Schema of the Table
and have values for each attribute (Column).
In summary:
Database is storage space, Table is a data set, Record is individual data.
(Technical definition without metaphor)
2⃣ Persistence of data (Persistence)
Applications can only retain data while running.
However, web services should be able to reuse that information even after they end.
One of the key purposes of a database is to
preserve data permanently.
- It is maintained even after restarting the server
- It does not get lost over time
- Accessible with the same value at any time
This is different from memory (RAM) or temporary cache,
and is a unique role of a DB.
3⃣ Efficient data retrieval (Query)
The most practical reason for the existence of a database is
to quickly find what is needed among a lot of data.
Retrieval is done through a command called Query.
A typical form used in SQL:
SELECT *
FROM buildings
WHERE city = 'Seoul';
The meaning of this command is highly structured.
- From which Table (Buildings)
- Only data that satisfies certain conditions (city = 'Seoul')
- How to display it (SELECT *)
Internally, databases use
Indexes, search algorithms, sorting methods, etc.
to quickly return results that match the conditions
even among tens of thousands to hundreds of thousands of data.
This speed determines the quality of the DB.
4⃣ Integrity
A database is not just a storage space.
It must continuously ensure that the stored data is logically consistent and trustworthy.
Integrity is managed through the following elements.
- NOT NULL: Must have a value
- UNIQUE: Cannot be duplicated
- PRIMARY KEY: Uniquely identifies each record
- FOREIGN KEY: Ensures relationships with other tables
- CHECK constraint: Value must meet specific conditions
Thanks to these rules,
the system automatically filters out incorrect data.
A DB is not just for storage,
but also a system for managing data quality.
5⃣ Relationship
The core of a relational database (RDB) is, as the name suggests, "relationships."
Tables are connected to each other
to represent more complex structures.
Representative relationships:
1:N (One-to-Many)
E.g., Building → Rooms
Multiple Rooms belong to one Building.N:N (Many-to-Many)
E.g., Users ↔ Projects
Requires an intermediate table.1:1 (One-to-One)
E.g., User → UserProfile
Due to these relationships,
data becomes not just a simple list
but a structure with organic relationships.
6⃣ Transaction
The most essential function of a database that provides "accuracy."
A transaction refers to a logically single unit of work
where all operations must either all succeed or
all fail.
E.g., Money transfer
- Withdrawal successful
- Deposit failed → Such a situation should never be allowed systemically.
Transactions prevent such issues.
Atomicity = Either all success or all failure without partial success
7⃣ Summary - The essential functions of a DB are just three
In summary without metaphor:
1) Structuring data for storage
2) Preserving permanently
3) Managing to quickly and accurately retrieve
To achieve these three,
functions such as relationships, constraints, indexes, transactions, etc., exist.
Why is this method important?
The essence of a web service is
"receiving, storing, and displaying data."
Understanding DB conceptually means
understanding the core structure of a web service.
Explaining conceptually without metaphor
enhances the reader's ability to
mentally construct logical structures
and think systematically.
And this is
the core ability of the AI Native era.