Relational Databases
Relational databases organize data into tables with predefined schemas, establishing relationships between these tables through keys, enabling efficient data re...
Relational databases는 서로 관련된 data points를 저장하고 액세스를 제공하는 데이터베이스 유형입니다. 이는 직관적이고 간단한 방식으로 데이터를 테이블로 표현하는 relational model을 기반으로 합니다. Relational [database](/ko/terms/relational-database)는 하나 이상의 테이블(또는 'relations')로 데이터를 구성하며, 각 행을 고유하게 식별하는 key가 있는 column과 row로 구성됩니다. 각 테이블 column은 특정 종류의 데이터(예: 'name', 'age', 'address')를 포함하며, 각 row는 각 column에 대한 값을 가진 record를 나타냅니다. 테이블 간의 관계는 다른 테이블의 primary key(고유 식별자)를 참조하는 한 테이블의 column인 foreign key를 사용하여 설정됩니다. 이 구조는 Structured Query Language (SQL)를 사용하여 효율적인 데이터 쿼리 및 조작을 가능하게 합니다. 주요 장점으로는 데이터 무결성(primary key, foreign key, data type과 같은 제약 조건을 통해 강제됨), 데이터 일관성, join을 통한 쉬운 데이터 검색, 복잡한 트랜잭션 지원(ACID properties: Atomicity, Consistency, Isolation, Durability)이 있습니다. 예로는 MySQL, PostgreSQL, Oracle Database, SQL Server가 있습니다.
graph LR
Center["Relational Databases"]:::main
Pre_data_structures["data-structures"]:::pre --> Center
click Pre_data_structures "/terms/data-structures"
Pre_logic["logic"]:::pre --> Center
click Pre_logic "/terms/logic"
Center --> Child_sql["sql"]:::child
click Child_sql "/terms/sql"
Center --> Child_postgresql["postgresql"]:::child
click Child_postgresql "/terms/postgresql"
Rel_nosql["nosql"]:::related -.-> Center
click Rel_nosql "/terms/nosql"
Rel_data_warehouse["data-warehouse"]:::related -.-> Center
click Rel_data_warehouse "/terms/data-warehouse"
Rel_relational_database["relational-database"]:::related -.-> Center
click Rel_relational_database "/terms/relational-database"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 5살도 이해할 수 있게 설명
도서관의 카드 목록을 생각해 보세요. 각 카드(row)에는 책에 대한 정보(제목, 저자 등)가 있고, 카드는 특정 저자가 쓴 모든 책이나 특정 주제에 대한 모든 책을 쉽게 찾을 수 있도록 구성되어 있습니다(관계).
🤓 Expert Deep Dive
The relational model, introduced by E.F. Codd, provides a theoretical foundation based on set theory and first-order predicate logic. Data is represented in normalized tables to reduce redundancy and improve data integrity. Normalization forms (1NF, 2NF, 3NF, BCNF) guide the design process. Relational [database](/ko/terms/relational-database) management systems (RDBMS) implement SQL as the standard language for data definition, manipulation, and control. Query optimization is a critical component, where the RDBMS's query optimizer determines the most efficient execution plan for SQL queries, often involving techniques like indexing (B-trees, hash indexes), join algorithms (nested loop, hash join, merge join), and query rewriting. Transaction management ensures ACID properties through mechanisms like locking, logging (write-ahead logging), and concurrency control protocols (e.g., two-phase locking). Distributed relational databases introduce complexities in maintaining consistency and availability across multiple nodes, often employing techniques like two-phase commit (2PC).