200417 Introduction to databases : Transaction

🚩 2020/04/17
📖课件 ch17 & 18
graph database


CH17

Transaction

Transaction concept

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

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

ACID Properties

在这里插入图片描述

Transaction State

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

Schedules

在这里插入图片描述

Schedule 1

在这里插入图片描述

Schedule 2

在这里插入图片描述

Schedule 3

在这里插入图片描述

Schedule 4

在这里插入图片描述

Serializability

在这里插入图片描述

Simplified view of transactions

在这里插入图片描述

Conflicting Instructions

在这里插入图片描述

Conflict Serializability

在这里插入图片描述

conflict serializable example

在这里插入图片描述

NOT conflict serializable example

在这里插入图片描述

View Serializability

(prof skip)

Testing for Serializability

在这里插入图片描述

vertices 顶点/交点
precedence 优先

Test for Conflict Serializability

在这里插入图片描述

Test for View Serializability

(skip)

Recoverable Schedules

在这里插入图片描述

Cascading Rollbacks

在这里插入图片描述

Concurrency Control

在这里插入图片描述

Weak Levels of Consistency

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

Levels of Consistency in SQL-92

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


CH18

Concurrency Control

Lock-Based Protocols

Protocols 礼仪/规章制度

You can have multiple share locks at the same time, but you can ONLY have ONE exclusive lock.

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

Schedule With Lock Grants

在这里插入图片描述

Deadlock

在这里插入图片描述

The Two-Phase Locking Protocol

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

Deadlock

在这里插入图片描述

Deadlock Handling

Deadlock prevention protocols ensure that the system will never enter into a deadlock state. Some prevention strategies:

  • Require that each transaction locks all its data items before it begins execution (pre-declaration).
  • Impose partial ordering of all data items and require that a transaction can lock data items only in the order specified by the partial order (graph-based protocol).

在这里插入图片描述

Deadlock Detection

在这里插入图片描述

Deadlock Recovery

在这里插入图片描述

Multiple Granularity

在这里插入图片描述

Example of Granularity Hierarchy

在这里插入图片描述

Intention Lock Modes

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

Insert/Delete Operations and Predicate Reads

在这里插入图片描述

Phantom Phenomenon

Phantom Phenomenon Example

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

Handling Phantoms

在这里插入图片描述

Index Locking To Prevent Phantoms

在这里插入图片描述

Timestamp-Based Protocols

在这里插入图片描述

Validation-Based Protocols

在这里插入图片描述

NoSQL Databases

Introduction

在这里插入图片描述

在这里插入图片描述

One Taxonomy

Taxonomy 分类
在这里插入图片描述

CAP Theorem

CAP Theorem

在这里插入图片描述

Consistency Models

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

  • tradeoff in the CAP theorem
    So in a replicated database, I can get consistancy through locking, but I can’t function of this partition caz I can’t lock enough copies. And so that’s where the partition tolerance comes in. For availability, I need multiple copies. For consistency, I need to lock all the copies, which means I can’t tolerate partitions. So I can have consistency and availability, but not partition tolerance. If I have partition tolerance, by definition I can’t lock all the copies, which means I can’t have consistency. I can get partition tolerance and consistency, but not availabilty.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值