12. 데이터베이스 응용 기술
01 객체지향 데이터베이스
1. 객체지향 데이터 모델
객체지향 개념에 기반을 둔 데이터 모델 - 객체, 객체 식별자, 속성과 메서드, 클래스, 클래스 계층 및 상속, 복합 객체 등을 지원
객체와 객체 식별자
객체: 현실 세계에 존재하는 개체를 추상적으로 표현한 것
객체 식별자: 시스템 전체에서 유일하게 식별될 수 있음, 특정 객체에 접근하기 위한 유일한 수단
속성과 메서드
속성: 관계 데이터 모델의 속성과 같은 의미
- 관계 데이터 모델: 단일 값만 가질 수 있음
- 객체 지향 데이터 모델: 값을 여러 개 가질 수 있음
사용자가 정의한 클래스뿐 아니라 해당 클래스의 하위 클래스도 도메인으로 정의 가능
메서드: 객체에 수행할 수 있는 연산
- 속성 값을 검색, 추가, 삭제, 수정
- 메시지: 특정 객체의 속성, 메서드에 접근하기 위해 사용=객체에 접근하기 위한 공용 인터페이스 역할
클래스
속성과 메서드를 공유하는 유사한 성질의 객체를 하나로 그룹화한 것
객체: 클래스의 구성원
클래스 계층과 상속
클래스를 단계적으로 세분화 → 클래스 계층 형성
IS-A 관계 (상위클래스-하위클래스)
상속: 상위클래스의 속성과 메서드를 자신의 모든 하위 클래스에 물려주는 개념
단일 상속: 하위클래스가 하나의 상위클래스로부터 상속 받음
다중 상속: 하위클래스가 여러 개의 상위클래스로부터 속성과 메서드를 상속받음
복합 객체
시스템에서 기본으로 제공하지 않는 사용자 정의 클래스를 도메인으로 하는 속성을 가진 객체
속성 값: 해당 클래스에 속하는 객체 인스턴스의 객체 식별자 → 다른 객체를 참조
Is-Part-Of 관계 (전체와 부분으로 이루어진 포함 관계)
2. 객체지향 질의 모델
질의 대상: 클래스, 질의 결과: 클래스에 속하는 객체 집합
단일 오퍼랜드 질의: 클래스 하나 또는 클래스 하나와 해당 클래스의 하위 클래스 전체를 대상으로 하는 질의
다중 오퍼랜드 질의: 여러 클래스를 대상으로 하는 질의
02 객체관계 데이터베이스
객체지향 개념과 관계 데이터 모델의 개념을 통합
객체지향 데이터베이스와 차이
- 관계 데이터베이스에 기반을 두고 사용자가 더 풍부한 데이터 타입을 추가할 수 있도록 함
03 분산 데이터베이스 시스템
중앙 집중식 데이터베이스 시스템: 데이터베이스 시스템을 물리적으로 한 장소에 설치하여 운영
분산 데이터베이스 시스템: 물리적으로 분산된 데이터베이스 시스템을 네트워크로 연결해, 사용자가 논리적으로 하나의 중앙 집중식 데이터베이스 시스템처럼 사용할 수 있도록 한 것
1. 분산 데이터베이스 시스템의 구성
- 분산 처리기: 물리적으로 분산되어 지역별로 필요한 데이터를 처리할 수 있는 지역 컴퓨터
- 지역에서 운영하는 데이터베이스를 자체적으로 관리할 수 있는 데이터베이스 관리 시스템(DBMS)를 가지고 있음
- 분산 데이터베이스: 물리적으로 분산된 지역 데이터베이스
- 통신 네트워크: 지역의 분산 처리기가 네트워크를 통해 자원 공유
- 효율적으로 설계해야 함
2. 분산 데이터베이스 시스템의 주요 목표
분산 데이터 독립성: 데이터베이스가 분산되어 있음을 사용자가 인식하지 못하게 하는 것
분산 투명성 보장: 위치 투명성, 중복 투명성, 단편화 투명성, 병행 투명성, 장애 투명성
위치 투명성
데이터베이스가 지역적으로 분산되어 있어도 사용자가 데이터의 실제 저장 위치를 알 필요 없이 데이터베이스의 논리적인 이름만으로 데이터에 접근할 수 있다
- 다른 지역에 있는 데이터에 접근하려는 요청
- 다른 지역에 있는 데이터를 가져와 처리
- 데이터 접근 요청을 하는 트랜잭션을 데이터가 있는 지역으로 보내 처리한 후, 결과 데이터만 가져옴
중복 투명성
동일한 데이터가 여러 지역에 중복 저장되더라도 사용자가 중복을 인식하지 못하고, 하나의 데이터베이스 시스템에 저장된 것처럼 사용
- 데이터 중복 저장의 장점
- 신뢰성과 가용성이 높아짐
- 여러 지역에서 병렬 처리 → 데이터 처리 성능 향상
- 데이터 처리 요청이 여러 지역에 분산 → 처리 부담을 줄일 수 있다
- 데이터 중복 저장의 단점
- 저장 공간을 많이 사용
- 데이터 변경 시에 중복 저장된 데이터를 모두 변경 → 비용 증가, 데이터 불일치 발생 가능
- 데이터 중복 저장 방법
- 완전 중복: 동일한 데이터를 둘 이상의 지역에 있는 분산 데이터베이스에 저장
- 부분 중복: 일부 데이터만 중복하여 저장
중복되는 데이터가 전혀 없는 경우=분할 데이터베이스
단편화 투명성
단편화: 하나의 릴레이션을 더 작은 조각(단편)으로 나누고, 각 조각을 별개의 릴레이션으로 처리하는 것
저장 공간을 적게 사용, 관리할 데이터 수가 줄어든다
단편화 조건
- 완전성: 전체 릴레이션의 모든 데이터가 한 조각에는 꼭 속해야 함
- 회복성: 단편화된 조각들로부터 원래의 전체 릴레이션을 회복할 수 있어야 한다
- 분리성: 모든 조각을 중복되지 않게 분리해야 한다
단편화 방법
- 수평적 단편화
투플(행) 단위로 나눈다
- 수직적 단편화
속성(열) 단위로 나눈다
- 혼합 단편화
수평, 수직적 단편화 모두 사용
단편화 투명성: 사용자가 데이터가 단편화된 것을 인식할 수 없게 한다
병행 투명성
분산 데이터베이스와 관련된 트랜잭션들이 동시에 수행되더라도 결과는 항상 일관성 유지
장애 투명성
특정 지역 시스템에 문제가 발생하더라도 전체 시스템이 작업을 계속 수행할 수 있는 것
3. 분산 데이터베이스의 구조
- 전역 개념 스키마
- 분산 데이터베이스에 저장할 모든 데이터 구조와 제약조건을 정의
- 데이터 분산은 고려x
- 단편화 스키마
- 전역 개념 스키마를 분할하는 방법인 단편화를 정의
- 전역 개념 스키마와 각 조각 스키마의 대응 관계도 정의
- 할당 스키마
- 단편화 → 분할된 각 조각 스키마의 인스턴스는 실제로 하나 이상의 물리적으로 저장됨
- 할당 스키마=각 조각 스키마의 인스턴스를 물리적으로 저장해야 되는 지역을 정의
- 지역 스키마
- 지역별로 저장하고 있는 데이터 구조와 제약조건을 정의
4. 분산 데이터베이스의 질의 처리
중앙 집중식 데이터베이스 시스템: 최선의 질의 처리 전략 선택 기준=디스크에 접근하는 횟수
분산 데이터베이스 시스템: 디스크 접근 횟수 + 네트워크에서 데이터를 전송하는 비용, 여러 지역에서 병렬 처리함으로써 얻는 성능상의 이점
5. 분산 데이터베이스 시스템의 장단점
장점
- 신뢰성과 가용성 증대
- 지역 자치성과 효율성 증대
- 확장성 증대
단점
- 설계 및 구축 비용
- 관리가 복잡, 관리 비용
- 추가 통신 비용/처리 비용 (데이터 처리 요청→분산 데이터베이스를 이용)
04 멀티미디어 데이터베이스 시스템
1. 멀티미디어 데이터의 특성
- 텍스트: 문자로 구성된 데이터
- 그래픽: 수학 공식을 기반으로 제작된 벡터 이미지 데이터
- 이미지: 정적 이미지나 사진과 같이 픽셀 단위로 표현되는 비트맵 이미지
- 비디오: 동영상, 애니메이션
- 오디오: 음성, 소리, 음악
특성
- 대용량 데이터
- 압축해서 저장, 일반 데이터와는 다른 구조로 저장 공간을 관리
- 검색 방법이 복잡한 데이터
- 설명 기반 검색: 멀티미디어 데이터의 특성을 나타내는 키워드, 설명을 활용
- 내용 기반 검색: 멀티미디어 데이터의 실제 내용을 이용, 데이터가 포함한 내용에 대한 정보를 추출해서 데이터베이스에 저장 + 이 정보를 이용해 질의를 처리하는 질의처리기법이 필요
- 구조가 복잡한 데이터
- 원시 데이터: 기본 타입의 데이터
- 등록 데이터: 멀티미디어 데이터의 특성과 필요한 정보를 별도로 추출한 데이터
- 서술 데이터: 멀티미디어 데이터를 검색할 때 사용되는 것
2. 멀티미디어 데이터베이스의 발전 과정
관계 데이터베이스에서의 멀티미디어 데이터 처리
관계 데이터베이스에 멀티미디어 데이터를 위한 새로운 데이터 타입을 추가하여 멀티미디어 데이터를 저장하고 처리하는 방법
장점: 관계 데이터베이스를 그대로 이용할 수 있다
단점: 멀티미디어 데이터를 단순히 저장/검색하는 기능만 제공
객체지향 데이터베이스에서의 멀티미디어 데이터 처리
다양한 관계 표현, 데이터 추상화와 캡슐화, 상속 등 다양한 기능 제공
한계: 멀티미디어 데이터의 복잡하고 다양한 모델링 요구 사항을 완벽히 만족x
3. 멀티미디어 데이터베이스 관리 시스템의 구성
멀티미디어 데이터: 대용량, 시공간적 연속성
- 파일 시스템 이용
- 응용 프로그램에 필요한 멀티미디어 데이터를 파일로 저장
- 데이터를 응용 프로그램에서 직접 관리 → 개발이 어려움
- 데이터의 동시 공유, 회복, 보안 등의 기능x
- 관계 데이터베이스 관리 시스템 이용
- 텍스트-관계 데이터베이스, 이미지/비디오-파일에 저장
- 지리 정보 시스템에서 많이 사용
- 파일에 저장된 데이터에 대한 처리 요청을 프로그래밍 언어로 작성, 관계 데이터베이스에 저장된 데이터-SQL로 작성
- 데이터 처리 요청을 위해 두 가지 방법을 모두 지원해야 한다
- 파일에 저장되는 경우 고급 기능 제공x
- 확장된 관계 데이터베이스 관리 시스템 이용
- 기존 관계 데이터베이스 관리 시스템 확장 - 이진 대형 객체(BLOB)라는 새로운 데이터 타입 추가
- 이 특성을 완벽히 지원하기 어려움, 멀티미디어 데이터의 특성을 반영한 처리 요청을 SQL로 표현하기 쉽지 않다
- 객체지향 데이터베이스 관리 시스템 이용
- 멀티미디어 데이터 처리를 위한 여러 기능 제공
- 기존 관계 데이터베이스 관리 시스템의 동시성 제어, 질의 최적화, 회복 기능 등의 고급 기능 제공x
4. 멀티미디어 데이터의 질의
멀티미디어 데이터의 질의 유형
- 텍스트 질의: 사용자가 제시한 키워드를 포함하는 문서를 검 색
- 이미지 질의: 사용자가 제시한 키워드와 관련 있는 이미지를 검색하는 내용 검색, 사용자가 제시한 이미지와 유사한 이미지를 검색하는 유사도 검색 질의
- 비디오 질의: 장면을 대상으로 하는 검색 질의
- 공간 질의: 주어진 범위 조건에 맞는 특정 위치 검색
멀티미디어 데이터의 질의 처리
- 매칭 기법: 수학 함수로 저장된 데이터와 질의 조건으로 주어진 데이터 간의 유사도를 계산, 유사도가 높은 데이터를 검색
- 랭킹 기법: 검색 결과를 질의 조건과의 관련 정도에 따라 정렬, 관련성이 높은 결과부터 제공
- 필터링 기법: 질의 조건과 관련성이 적은 데이터를 단계적으로 제거하여 검색 범위를 줄여가면서 검색
- 인덱스 기법: 인덱스 구조를 이용해 검색
05 기타 데이터베이스 응용 기술
1. 웹 데이터베이스
웹 서비스의 특성 + 데이터베이스 시스템의 데이터 관리 기능을 통합
미들웨어-웹 서비스와 데이터베이스 시스템을 연결, 데이터베이스 통로
2. 데이터 웨어하우스
데이터베이스 시스템에서 의사 결정에 필요한 데이터를 미리 추출하여, 이를 원하는 형태로 변환하고 통합한 읽기 전용의 데이터 저장소
데이터베이스 시스템 하나 또는 여러 개를 대상으로
데이터 웨어하우스의 특징
- 주제 지향적(subject-oriented)
- 일반 데이터베이스: 업무 처리 중심의 데이터
- 데이터 웨어하우스: 의사 결정이 필요한 주제를 중심으로 데이터 구성
- 통합된 내용
- 여러 데이터베이스에서 필요한 데이터를 추출하여 의사 결정에 필요한 분석 및 비교 작업
- 데이터가 항상 일관된 상태를 유지하도록 여러 데이터베이스에서 추출한 데이터를 통합하여 저장
- 시간에 따라 변하는 내용
- 올바른 의사 결정을 위해 현재와 과거 데이터를 함께 유지
- 스냅샷-웨어하우스가 저장하고 있는 각 시점의 데이터
- 데이터 간의 시간적 관계나 동향을 분석하여 의사 결정에 반영할 수 있도록 하기 위해
- 비소멸성
- 검색 작업만 수행되는 읽기 전용의 데이터 유지
'CS > DataBase' 카테고리의 다른 글
[데이터베이스 개론] 13. 데이터 과학과 빅데이터 (0) | 2022.12.11 |
---|---|
[데이터베이스 개론] 11. 보안과 권한 관리 (0) | 2022.12.02 |
[데이터베이스 개론] 10. 회복과 병행제어 (0) | 2022.12.02 |
[데이터베이스 개론] 9. 정규화 (0) | 2022.12.01 |
[데이터베이스 개론] 6. 관계 데이터 연산 (0) | 2022.10.02 |