본문 바로가기

computer science

(6)
Concurrency Control Uncontrolled Sharing Problems Lost update problem T1가 작업한 A 내용이 없어짐 Uncommitted dependency problem T1이 존재하지 않는 값을 읽어가 작업한 셈이 됨 Inconsistent analysis problem T1이 inconsistent한 상태의 데이터 아이템 값으로 작업해 틀린 결과값을 계산함 Lock-Based Protocols Locks shared lock (S): 그 데이터 아이템을 read하기 위해 획득해야 하는 lock exclusive lock (X): 그 데이터 아이템을 write하기 위해 획득해야 하는 lock lock-compatibility matrix (ex) A에 T1이 shared lock 걸은 상태에서 ..
Transaction Transactions Transaction 트랜잭션 = a unit of program execution that accesses and possibly updates various data items 트랜잭션의 두 가지 메인 이슈: failures (hardware failures, system crashes) concurrent execution of multiple transactions Transaction properties (ACID) : 데이터 무결성을 확보하기 위해 보장해야 하는 트랜잭션의 네 가지 속성 1. Atomicity "All or none". 트랜잭션의 연산 결과는 모두 완전히 데이터베이스에 반영되거나, 아예 반영되지 않는다. 트랜잭션 전체 실행이 완료되지 못하면 트랜잭션 실행..
Relational DBMS Storage Management & Indexing Storage hierarchy Magnetic hard disk 각 platter의 전면부와 후면부에 데이터 저장하므로, (platter 개수) * 2 개 면에 데이터를 저장 각 면의 head로 데이터를 읽거나 씀 각 head는 arm을 통해 arm assembly에 연결되어 있음 각 track마다 cylinder 가짐 한 platter에는 50K ~ 100K 개 track 한 sector의 물리적 단위는 주로 512 bytes Access time seek time: 2~20 ms rotational delay: 4~11 ms data transfer rate: 50~200M / sec Sector vs. Block sector = physical..
Relational Algebra (관계대수) Relational operators relational operators는 relation에 대해 닫혀 있음 (input도 relation, 연산 결과 output도 relation) 6 basic operators select: σ project: Π union: ∪ set difference: – cartesian product: × rename: ρ additional operators set intersection join, natural join assignment (+ outer join, generalized projection, aggregate functions) Select operation p: selection predicate. AND, OR, NOT 등으로 여러 term 연결해..
Basics of Relational Model Background Relational Model a data model describes data (relation, relation schema, tuples, attributes, domains, keys) describes constraints relation model은 predicate logic과 set theory를 기반으로 함 Predicate Logic (술어 논리) 컴퓨터가 이해하기 위한 표현 방식 사람을 위한 표현 방식인 propositonal logic, sentential logic과 구분됨 first argument: a subject second argument: its possessive (ex) "학번이 S1인 학생의 이름은 홍길동이다" 라는 현실세계의 정보를 술어논리 표..
Database Introduction Database Databse의 정의 : a collection of persistent, interrelated, and integrated data that is used by the application systems of some given enterprise : a collection of data that is managed by DBMS File System으로 Database 관리 DBMS가 없을 때 DB를 관리하는 방법. 단점: 데이터 일관성 유지 및 데이터 액세스에 어려움 3 Levels of Data Abstraction physical level: describes how data are actually stored logical level: describes what data st..