Behind every sucessful website, there is a powerful database.
EX: UPS/FedEX's websites, Amazon, Google ...
Scenario
Needs
Does not address needs : 사용자의 요구를 충족시키지 못하는 내용이나 쿼리가 있다
^\s+Customer:\s*Gildong\s+Hong\s*,\s+Rented:
Requirements
• Robust, sophisticated query language
• Clear separation between data organization (schema) and data
Data와 Data Organization(Schema) 사이의 정교한 query language가 필요하다.
Lacks data integrity(무결성), Consistency(일관성)
Requirements
• Enforce constraints (제약조건) to permit only valid information to be input.
Input으로 오직 Valid한 정보만이 허락되는 제약조건이 필요하다
Add/delete/update fields in every record
Add/delete/update new information collections
customer.txt
file to record informationRequirements
• Ability to manipulate the way data is organized.
Data 구성 방식을 조작할 수 있는 능력
• Two clerks edit rented.txt
file at the same time.
1) 철수 starts to edit rented.txt
, reads it into memory.
2) 영희 starts to edit rented.txt
.
3) 철수 adds a record.
4) 철수 saves rented.txt
to disk.
5) 영희 saves rented.txt
to disk.
What’s wrong with this scenario?
메모리가 충돌되어 원하는 결과를 얻을 수 없다.
비행기 좌석를 예매하는 상황에서, 한 자리에 여러 사용자가 예매를 하고자 한다면 충돌이 발생하고 이러한 상황을 통제할 수 있어야 한다.
Requirements
• Must support multiple readers and writers.
• Updates to data must (appear to) occur in serial order.
다중 사용자 Readers & Writers에 대한 Support가 이루어져야함
Data의 업데이트는 serial order에서 발생해야 함 -> 데이터의 업데이트가 일련의 순서대로 수행되는 것처럼 보이거나 처리되어야 한다.
Crash during update may lead to inconsistent state.
• 철수 makes 250 of 500 edits to change ‘Jane Doe’ to her preferred name ‘Jan Doe’.
• Before 철수 saves it, Windows/Linux crashes!
Requirements
• Must update on all-or-none basis (a.k.a, atomicity).
• Implemented by commit or rollback if necessary.
트랜잭션은 성공적으로 완료되거나 아무런 영향도 미치치 않는 두 가지 상태 중 하나여야 한다.
필요하다면 commit 또는 rollback이 구현되어야 한다.
물리적으로 떨어져있는 데이터
Need
Method
customer.txt
contains address of customers.rented.txt
와 merge 필요Problems
Requirements
• Uniquely identify each customer.
• Make sure we have information on customers that rent the movie.
각각의 Customer를 Unique하게 식별할 수 있어야 한다.
영화를 빌려간 Customer들의 정보를 확실히 가지고 있어야 한다.
Customers want to know how many times a movie has been rented.
Customer가 해당 영화의 rent된 횟수를 알기를 원하는 상황
rented.txt
에 대한 접근을 허용하면서 Customer 필드에 대한 접근은 허용하면 안 된다.
이를 Editor에서는 어떻게 처리 하나 ?
Clerks under 19 should not see history of R-rated rentals
19세 미만의 점원은 R-rated rentals에 대한 기록을 볼 수 없다.
rental list를 두 개를 두어야 하나 ?
Requirements
• Ability to control who has access to what information.
특정 Information에 누가 접근할 수 있는 지 Control할 수 있는 능력
Your customer list grows enormously.
rented.txt
file gets huge (terabytes, petabytes, or more of data).Customer list는 엄청나게 증가한다.
-> rented.txt
file은 여러 데이터로 계속해서 커질 것이다.
-> 편집하기에 느려진다.
-> 고객 정보에 대한 쿼리가 느려진다.
Requirements
• New data structures to improve query performance
• System automatically modifies queries to improve speed.
• Ability of system to scale to handle huge datasets
쿼리 성능 개선을 위한 새로운 자료 구조
시스템이 자동적으로 속도를 향상 시키기 위해 쿼리를 수정한다.
거대한 dataset을 핸들링할 수 있는 system의 능력
What pairs of movies are often rented together?
Do we need more copies of the Avengers movie anywhere?
Requirements
• Collect and analyze summary data (요약 데이터).
• Use computer to mine for interesting trends and predict future trends (흥미로운 트렌드를 캐거나 예측)
• Support access to data by sophisticated programs.
Program must implement
• Security (보안)
• Concurrency control (동시성 제어)
• Support for schema reorganization (스키마 재구성)
• Data structures for performance improvement (성능 향상을 위한 데이터 구조): e.g. indexes (색인)
Observation
• Many applications need these services with high performance.
Solution
• Build and sell a software system to provide services, which is what?!
Reference
Database System Concepts | Abraham Silberschatz
데이터베이스 시스템 7th edition