Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 ·...

29
Database Overview Evolution of Database System

Transcript of Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 ·...

Page 1: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

Database Overview Evolution of Database System

Page 2: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

Evolution of Database

1960s 1970s 1980s 1990s 2000+

File-based

Hierarchical

Network

Relational Object-oriented

Web-based

Entity-Relationship

NoSQL NewSQL

2 Database Design

Database 발전

Page 3: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

Database: Historical Roots (기원)

Manual File System To keep track of data data 추적을 위해 제작

Used tagged file folders in a filing cabinet 캐비넷의 file folder에 tag을 다는 방식

Organized according to expected use • e.g. file per customer 사용목적에 따라 조직화

Easy to create, but hard to data 생성은 수월하나

• locate data data 검색,

• aggregate/summarize data 요약 및 종합 하기는 어려움

Computerized File System file system의 전산화

To accommodate the data growth and information need 필요한 정보와 data의증가로 인한 수용 공간 확보 대두

Manual file system structures were duplicated in the computer 원래의 file system 구조를 차용하여 컴퓨터에 적용

Data Processing (DP) specialists wrote customized programs to • write, delete, update data (i.e. management) • extract and present data in various formats (i.e. report)

3 Database Design

Page 4: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

File System: Example

Database Systems: Design, Implementation, & Management: Rob & Coronel

4 Database Design

Page 5: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

File System: Weakness Weakness

“Islands of data” in scattered file systems 분산된 파일시스템.

Problems Duplication 중복

• Same data may be stored in multiple files Inconsistency 불일치

• Same data may be stored with different values/formats Rigidity 경직성

• Requires customized programming to implement any changes • Cannot do ad-hoc queries 즉석질의 불가

Implications

Waste 낭비 of space Data inaccuracies 오류

High overhead 간접비용 of data manipulation and maintenance

5 Database Design

Page 6: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

File System: Problem Case

CUSTOMER file AGENT file SALES file

A_Name (15 char)

Carol Johnson

A_Name (20 char)

Carol T. Johnson

AGENT (20 char)

Carol J. Smith

• Inconsistent field name, field size • inconsistent data values • data duplication

6 Database Design

Page 7: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

Database System vs. File System

Database Systems: Design, Implementation, & Management: Rob & Coronel

7 Database Design

Page 8: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

Hierarchical Data Model 계층적 데이터 모델

Hierarchical Model To manage large amount of data for complex manufacturing projects

• Information Management System developed by Rockwell & IBM

→ Files connected in Parent-Child (1:M) relationships • 1 Parent - Multiple Children

Database Systems: Design, Implementation, & Management: Rob & Coronel

8 Database Design

Page 9: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

Hierarchical Data Model 계층적 데이터 모델

Strengths Conceptual Simplicity 개념적 단순성

• Groups of data could be related to each other • Related data could be viewed together

Centralization of data • Reduced redundancy 중복 and promoted consistency 일관성

Weaknesses

Limited representation of data relationships • Did not allow Many-to-Many (M:N) relations

Structural Dependence 구조 의존

• Data access requires physical storage path Complex Implementation 복잡한 구현

• Required in-depth knowledge of physical data storage Lack of Standards 표준 부족

• Limited portability

9 Database Design

Page 10: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

Network Data Model 네트워크 데이터 모델

Network Model → Extension of Hierarchical Model 계층모델의 확장형

• Composed of Owner-Member (Parent-Child) sets

→ To represent Many-to-Many (M:N) relationships • Multiple Parents – Multiple Children

Database Systems: Design, Implementation, & Management: Rob & Coronel

10 Database Design

Page 11: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

Relational Data Model 관계형 데이터 모델

Problems with legacy database systems Required excessive effort to maintain • Data manipulation (programs) too dependent on physical file structure Hard to manipulate by end-users • No capacity for ad-hoc query (must rely on DB programmers).

Relational Model E. F. Codd’s proposal

• Separated the notion of physical representation (machine-view) from logical representation (human-view) → Eliminated pointers and used tables to represent data

• Considered ingenious but computationally impractical in 1970 Dominant database model of today

• Separation of design from implementation → Flexible • Ad-hoc queries → Structured Query Language (SQL)

11 Database Design

Page 12: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

Relational Database: Example

Tables (i.e. Relations) Provide a logical “human-level” view of the data

and associations among groups of data → Organize data into rows 행 (records/tuples) and columns 열 (attributes) → Are related via shared attribute(s)

Customer_ID Customer_Account Agent_ID1224 4556 231225 4558 25

Agent_ID Last_Name First_Name Phone23 Sturm David 334-567825 Long Kyle 556-3421

Customer_ID Last_Name First_Name Phone Account_Balance1224 Vira Dyne 678-9987 1223.951225 Davies Tricia 556-3342 234.25

12 Database Design

Page 13: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

Entity Relationship Model Peter Chen’s Landmark Paper (1976)

“The Relationship Model: Toward a Unified View of Data”

Graphical representation of entities and their relationships

Based on Entity, Attributes & Relationships Entity → e.g. EMPLOYEE

• Thing about which data are to be collected and stored Attributes → e.g. SSN, last name, first name

• Characteristics of the entity

Relationships → i.e. 1:M, M:N, 1:1

• Associations between entities

Complements the relational data model concepts • Helps to visualize structure and content of data groups • Entity Relationship Diagram (ERD)

→ Tool for conceptual data modeling → Formalizes a way to describe relationships between groups of data

13 Database Design

Page 14: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

E-R Diagram: Chen Model

Entity 개체

represented by a rectangle with its name in capital letters.

Relationship 관계

represented by an active or passive verb inside the diamond that connects the related entities.

Connectivity 관계유형

i.e., types of relationship written next to each entity box.

Database Systems: Design, Implementation, & Management: Rob & Coronel

14 Database Design

Page 15: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

E-R Diagram: Crow’s Foot Model

Entity 개체

represented by a rectangle with its name in capital letters.

Relationship 관계

represented by an active or passive verb that connects the related entities.

Connectivity 관계유형

indicated by symbols next to entities. • 2 vertical lines for 1 • “crow’s foot” for M

Database Systems: Design, Implementation, & Management: Rob & Coronel

15 Database Design

Page 16: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

E-R Model: Pros & Cons Advantages

Exceptional conceptual simplicity • Easily viewed and understood representation of database • Facilitates database design and management

Integration with the relational database model • Enables better database design via conceptual modeling

Disadvantages

Incomplete model on its own • Limited representational power

→ cannot model data constraints not tied to entity relationships e.g. attribute constraints

→ cannot represent relationships between attributes within entities • No data manipulation language (e.g. SQL)

Loss of information content • Hard to include attributes in ERD

16 Database Design

Page 17: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

Object-Oriented Database 객체지향

Semantic Data Model (SDM) ► Modeled both data and their relationships in a single structure (object)

• Developed by Hammer & McLeod in 1981

Object-oriented concepts became popular in 1990s ► Modularity facilitated program reuse and construction of complex structures ► Ability to handle complex data types (e.g. multimedia data)

Object-Oriented Database Model (OODBM) ► Maintains the advantages of the ER model but adds more features ► Object = entity + relationships (between & within entity)

• consists of attributes & methods → methods are all relevant operations that can be performed on an object

► Class ⇒ Template for objects • e.g. EMPLOYEE class = (employ1 object, employ2 object, …) • organized in a class hierarchy

→ e.g. PERSON > EMPLOYEE, CUSTOMER

► Incorporates the notion of inheritance • attributes and methods of a class are inherited by its descendent classes

17 Database Design

Page 18: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

OO Database Model vs. E-R Model

Database Systems: Design, Implementation, & Management: Rob & Coronel

OODBM: - can accommodate relationships within a object - objects to be used as building blocks for autonomous structures

18 Database Design

Page 19: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

Object-Oriented Database: Pros & Cons

Advantages Semantic representation of data

• Fuller and more meaningful description of data via object Modularity, reusability, inheritance Ability to handle

• Complex data • Sophisticated information requirements

Disadvantages

Lack of standards • No standard data access method

Complex navigational data access • Class hierarchy traversal

Steep learning curve • Difficult to design and implement properly

High system overhead • Slow transactions

19 Database Design

Page 20: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

Web Database Not a database model, but a system

For storing information that can be accessed via Web That supports complex data types & relationships In a Client-Server architecture

• Server hosts database & DBMS (e.g., MySQL) • Client accesses the server for database use

Client Initiates a Connection

Server Waits & Responds

to Incoming Connections

Web Client

(e.g. Chrome)

Web Server

(e.g. Apache)

HTTP request DB Server

(e.g. MySQL)

Database

Webpage

Data request

Retrieved data

20 Database Design

Page 21: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

NoSQL/NewSQL Database NoSQL (Not Only SQL)

Non-relational: e.g., objects instead tables

For big (unstructured, distributed) data & real-time Web applications More scalable & better performance Flexible & agile development

NewSQL NoSQL + Relational

→ Consistent → Scalable → Flexible

21 Database Design

Page 22: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

MS Access Introduction

Database Design 22

Page 23: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

MS Access: Overview

MS Access A Database Management System (DBMS) • designed to create applications that organize, store, retrieve, and

manipulate large collections of data.

GUI-driven with built-in automations Based on relational database theory

Theory & Practice Need a solid understanding of database theory and principles as well as DBMS skills to develop an effective database system.

DBMS expert ≠ Database Design expert

Page 24: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

MS Access: Database Objects • Objects

– Tables store data – Forms display data

• for viewing, editing, entering – Reports summarize & present data

• forms can change data, but reports cannot.

– Queries manipulate data • combine, filter, modify, retrieve, etc.

– Macros are simplified programs that automate tasks. – Modules are Visual Basic for Application (VBA) programs.

• Object Views

– (Normal) View • the mode used to interact w/ the object & its data.

– Design view • the mode used to change the object design.

GCF LearnFree.org

Page 25: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

MS Access: User Interface

Database Design 25 GCF LearnFree.org

Page 26: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

MS Access: The Ribbon

Database Design 26

Common activities/commands organized by tabs & groups • Tabs → Groups → Commands

GCF LearnFree.org

Minimize Ribbon

Page 27: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

MS Access: Quick Access Toolbar

Database Design 27

Direct access to any command • Click Customize Quick Access Toolbar icon & select More Commands… • Right-click a command & click Add to Quick Access Toolbar

Right Click

Page 28: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

MS Access: Navigation Pane

Database Design 28

Contains every object in the database • Objects are organized into groups by type • Double-click the object name to open • Right-click to rename • Press the delete key to delete objects • Click the double arrow

to minimize/maximize the navigation pane

Page 29: Database Overview - KNUwidit.knu.ac.kr/.../gDB2/s16/lectures/2.gDB2-Overview.pdf · 2016-08-28 · Database Overview Evolution of Database System . Evolution of Database 1960s 1970s

MS Access: File Tab

Database Design 29

Shows general file commands • Recent → Recently open files • Options → Access options