7. Distributed Database Systems 分布式数据库系统

本文深入探讨了分布式数据库系统(DDBS)的概念、特点及优势,包括数据分布、相关性和本地自治性等特性,同时也讨论了其缺点和面临的挑战,如现有数据库整合困难和复杂性问题。文章还详细分析了DDBS中的主要问题,如查询优化、并发控制和恢复机制,以及数据分布策略和联邦数据库系统的设计。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

7.1 Introduction

What is DDB?
A DDB is a collection of correlated data which are spread across a network and managed by a software called DDBMS.
相关数据的集合,相关数据分布在网络的不同节点上,并且由分布式数据库管理系统
Two kinds:

  1. Distributed physically, centralized logically (general DDB)
  2. Distributed physically, distributed logically too (FDBMS)
    We take the first as main topic in the course.

Features of DDBS

  • Distribution
  • Correlation
  • DDBMS

The advantages of DDBS

  • Local autonomy 局部自治性
  • Good availiability (because support multi copies) 可用性好
  • Good flexibility 灵活
  • Low system cost 成本低
  • parallel process

The disadvantages of DDBS

  • hard to intergrate existing databases
  • Too complex

The main problems in DDBS

  • Query Optimization (different optimization goal)
  • Concurrency control (should consider whole network)
  • Recovery mechanism (all sub-transactions must commit or abort simultaneously)

Another problem specially for DDBS

  • Data distribution

Data Distribution

  • Centralized 集中
  • Partitioned 划分
  • Replicated 全复制
  • Hybird (mix of the above)

Comparison of four strategies

在这里插入图片描述

Unit of Data Distribution

  1. According to relation (or file), that means non partition 以关系为单位
  2. According to Fragments 以裂片为单位
  • Horizontal fragmentation: tuple partition 水平分割,元组划分,例如院系划分
  • Veritical fragmentation: attribute partition 垂直分割,属性分割
  • Mixed fragmentation: both

The criteria of fragmentation 原则

  1. Completeness: every tuple or attribute must has its reflection in some fragments 完整性
  2. Reconstruction: should be able to reconstruct the original global relation 可重构性
  3. Disjointness: for horizontal fragmentation 不相交性

Problem cause by Data Distribution

  1. Multi copies’ consistency 多副本的一致性问题
  2. Distribution consistency 分布一致性
  • Redistribution 重新分布
  • Piggybacking 背回
  1. Translation of Global Queries to Fragment Queries and Selection of Physical Copies 裂片查询和物理副本选择
  2. Design of Database Fragments and Allocation of Fragments 裂片设计

Federated Database

  • In practical applications, there are strong requirements for solving the integration of multi existing, distributed and hererogeneous databases.
  • The database system in which every member is autonomic and collaborate each other based on negotiation — federated database system
    每个联邦成员都是自治的并且通过协商后互相合作 ,这样的数据库系统称为联邦式数据库
  • No global schema in federated database system, every federated member keeps its own data schema
    在联邦式数据库中没有全局模式来让每个成员保持自身的数据模式
  • The member negotiate each other to decide respective input/output schema, then, the data sharing relations between each other are established.
  • 成员通过协商决定各自的输入和输出模式

The schema structure in federated database System

在这里插入图片描述
在这里插入图片描述

7.4 Query Optimization in DDBMS

  • Optimization goal: minimize the transmission cost on network
    优化目标:减少网上传送量
  • Algebra optimization 代数优化
    • Translation of global queries to fragment queries and selection of physical copies 全局关系的查询转化为物理副本的选择
  • Query Decomposition
    • Global query plan

An example of global query optimization

在这里插入图片描述
Global query optimization may get an execution plan baseed on cost estimation, such as:

  1. send R2 to site 1, R’
  2. execute on site1:
    Select *
    From R1, R’
    WHERE R1.a = R’.b;

7.5 Recovery Mechanisim in DDBMS

  • The basic principle is the same as that in centralized DBMS
  • Distributed transactions: the key of distributed transaction management is how to assure all sub-transactions either commit together or abort together.
    分布式事务:
  • Realize the sub-transactions’ harmony with each other relies on communication, while the communication is not reliable.
  • Two phase commitment protocol 两段提交协议
  • Combination of failures 故障的组合问题

7.6 Concurrency Control in DDBMS

  • The basic principle is the same as that in centralized DBMS, demand concurrent transactions to scheduled serializably
  • Because of multi copies, need locking globally
  • Communication overhead
  • Global deadlock

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值