일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- 티스토리챌린지
- i-type
- 서비스 프리미티브
- 비주기신호
- tcp 세그먼트
- leetcode
- 99클럽
- mariadb
- 항해99
- 우분투db
- 플로이드워셜
- git merge
- 오류제어
- xv6
- 토큰 버스
- IEEE 802
- 코딩테스트준비
- 개발자취업
- 데이터 전송
- 오블완
- 프레임 구조
- 오류검출
- 그리디 알고리즘
- 스레드
- tcp 프로토콜
- reducible
- 주기신호
- well known 포트
- til
- 순서번호
- Today
- Total
Unfazed❗️🎯
Database intro (+File system vs DBMS) 본문
DB = collection of data
DBMS(Database Management System) = collection of software that allow us to define, construct, manipulate databases +provides a number of desirable funcationalities(data independence, data sharing, recovery, security, etc.)
DBS(Databse System) = DB +DBMS
Advantages of DBMS (Atomicity(원자성), Consistancy(일관성), Isolation(독립성), Durability(지속성) =>ACID!)
1.Data abstraction
2.Easy accessing data (database language support, user interfaces)
3.Controlled data redundancy & inconsistency
4.Integrity constraint(IC) enforcement
=> with file systems, ICs integrity constraints(e.g. account balance > 0) become buried in program code rather than being stated explicitly
=> with DBMS, easy to enforce ICs as well as add/update/delete ICs
5. Atomicity of updates (all or nothing property)
ex) transfer of funds from one account to another should either be completed or not happen at all
6.Concurrent access by multiple users
=>uncontrolled concurrent accesses can lead to inconsistencies
ex) two people reading a balance and updating it by withdrawing money at the same time => dbms will provide consitancy
7.Data Security
8.Data backup and recovery
9.Isolation 독립적으로 user1은 select, user2는 insert 할 수 있게함.
Databases vs file systems
1. Access
File Systems: provide block-level or file-level access. Operations like open, close, read, write, and lseek in UNIX give you byte-level control over files, but no built-in support for structured data or complex queries.
Databases: Provide row-level or even field-level access. Allow complex querying, filtering, and aggregation using SQL or other query languages.
2. Concurrency control
File Systems: Concurrency is typically managed at the file or block level. Concurrent writes to the same file might lead to conflicts or data corruption without careful handling.
Databases: DBMSs come with built-in concurrency control mechanisms, ensuring that multiple users can safely read and write to the database concurrently without causing data inconsistency.
3.Data Integrity
File Systems: The responsibility of maintaining data consistency and integrity falls entirely on the user or application. There's no built-in support for ensuring data integrity.
Databases: Offer mechanisms like primary keys, foreign keys, constraints, and transactions to ensure data integrity.
4.Backup and Recovery
File Systems: Backup typically involves copying files to another location. Recovery from failure might mean losing some recent changes unless you've implemented a custom logging mechanism.
Databases: Many DBMSs have built-in backup and recovery mechanisms, including support for point-in-time recovery, log-based recovery, etc.
5.Data Redundancy
File Systems: Different applications might maintain their own versions of data, leading to redundancy and potential inconsistency.
Databases: A central DBMS ensures a single, consistent source of truth.
6.Data Retrieval
File Systems: Retrieving specific pieces of data can require custom code to parse and filter files.
Databases: Allow for structured querying, indexing, and fast retrieval of data based on various criteria.
7.Security
File Systems: Security is usually at the file or directory level (e.g., UNIX permissions).
Databases: DBMSs offer fine-grained access control at the table, row, or column level. They also provide mechanisms for audit logging, encryption, etc.
8.Scalability
File Systems: Horizontal scalability can be a challenge, especially for distributed file systems.
Databases: Modern DBMSs, especially distributed databases, are designed for horizontal scalability and can handle massive amounts of data.