zoukankan      html  css  js  c++  java
  • When does locking or MVCC occur? Where do I need to specify which one the database should use?

    MVCC一种多版本数据记录方式 读旧版本数据 写新版本数据 实现数据库事务的隔离级别 

    数据库事务的特性及其保障方式:

    原子性:使用 undo log ,从而达到回滚

    持久性:使用 redo log,从而达到故障后恢复

    隔离性:使用锁以及MVCC(read-committed and repeatable read),运用的优化思想有读写分离,读读并行,读写并行

    一致性:通过回滚,以及恢复,和在并发环境下的隔离做到一致性。

    MVCC applies to isolation levels read-committed and repeatable read (default).

    You don't need to specify anything for both of these features to work together. 

    Row Level Locking

    Locking is for when multiple writers are trying to update the same rows. Only one writer can update a row at a time, and the first one to update the row locks it until they commit the change. Other writers have to wait until the first writer commits. But at least with row-level locking, they only have contention if they're updating the same row.

    A read lock can be used to prevent other users from reading a record (or page) which is being updated, so that others will not act upon soon-to-be-outdated information.

    Multiversion Concurrency Control

    1. Writers don't block readers

    2. Readers don't block anyone, and don't get blocked by anyone(but the data readers is reading maybe historical version)

  • 相关阅读:
    dede图片横向滚动
    dede各种运用[转]
    PROFIBUS-DP现场总线的结构及应用
    51单片机的中断优先级及中断嵌套
    WPF里面制作圆角文本框
    【转】什么叫51单片机最小系统
    【转】(C#)OPC客户端源码
    路漫漫其修远兮,吾要上下左右前后而求索
    二叉树创建为什么用二级指针
    无向图的邻接表创建
  • 原文地址:https://www.cnblogs.com/lnas01/p/12291688.html
Copyright © 2011-2022 走看看