fbpx
维基百科

多版本并发控制

多版本并发控制(Multiversion concurrency control, MCCMVCC),是数据库管理系统常用的一种并发控制,也用于程序设计语言实现事务内存[1]

MVCC意图解决读写锁造成的多个、长时间的读操作饿死写操作问题。每个事务读到的数据项都是一个历史快照,并依赖于实现的隔离级别。写操作不覆盖已有数据项,而是创建一个新的版本,直至所在操作提交时才变为可见。快照隔离使得事务看到它启动时的数据状态。

算法 编辑

MVCC使用时间戳 (TS), 或“自动增量的事务ID”实现“事务一致性”。MVCC可以确保每个事务(T)通常不必“读等待”数据库对象(P)。这通过对象有多个版本,每个版本有创建时间戳废止时间戳 (WTS)做到的。

事务Ti读取对象(P)时,只有比事务Ti的时间戳早,但是时间上最接近事务Ti的对象版本可见,且该版本应该没有被废止。

事务Ti写入对象P时,如果还有事务Tk要写入同一对象,则(Ti)必须早于(Tk),即 (Ti) < (Tk),才能成功。[2]

MVCC可以无锁英语Non-lock concurrency control实现。

历史 编辑

MVCC在1981年的一篇论文"Concurrency Control in Distributed Database Systems"[3]被充分论述,并成为经典描述。一般认为原创工作始于1978年David P. Reed英语David P. Reed的博士学位论文[4]

数据库实现 编辑

现在,多数数据库系统已经使用MVCC。

参考文献 编辑

  1. ^ refs (页面存档备份,存于互联网档案馆). Clojure. Retrieved on 2013-09-18.
  2. ^ Ramakrishnan, R., & Gehrke, J. (2000). Database management systems. Osborne/McGraw-Hill.
  3. ^ Philp A. Bernstein and Nathan Goodman: 《Multiversion Concurrency Control--Theory and Algorithms》,《ACM Transactions on Database Systems》Vol.8, No.4, December 1983, pages 465-483 (PDF). [2018-11-12]. (原始内容 (PDF)于2017-08-08). 
  4. ^ Reed, David P. Naming and Synchronization in a Decentralized Computer System (PDF). MIT dissertation. September 21, 1978 [2018-11-12]. (原始内容 (PDF)于2022-01-21). 
  5. ^ ArangoDB Manual Pages: AppendOnly/MVCC. [2018-11-12]. (原始内容存档于2013-02-23). 
  6. ^ Berkeley DB Reference Guide: Degrees of Isolation. [2018-11-12]. (原始内容于2011-03-19). 
  7. ^ A new approach: Clustrix Sierra database engine (PDF). [2018-11-12]. (原始内容 (PDF)于2012-04-12). 
  8. ^ Database Transaction — CUBRID 10.0.0 documentation. cubrid-manual.readthedocs.io. [2018-11-12]. (原始内容于2017-09-07). 
  9. ^ DB2 Version 9.7 LUW Information Center, Currently committed semantics improve concurrency
  10. ^ TM1 9.5.2 Information Center, Parallel Interaction
  11. ^ etcd3 Documentation | etcd3 API | CoreOS. [2018-11-12]. (原始内容于2019-01-13). 
  12. ^ Graves, Steve. . RTC Magazine. May 1, 2010 [2018-11-12]. (原始内容存档于2010-06-01). 
  13. ^ White paper by Roman Rokytsky Firebird and Multi Version Concurrency Control (页面存档备份,存于互联网档案馆
  14. ^ Multi-Version Concurrency Control in the H2 Database Engine. [2018-11-12]. (原始内容于2006-07-09). 
  15. ^ MVCC - Ingres Community Wiki (页面存档备份,存于互联网档案馆). Community.ingres.com. Retrieved on 2013-09-18.
  16. ^ Todd, Bill. . 2000 [4 May 2006]. (原始内容存档于2006-02-26). 
  17. ^ About XtraDB, About XtraDB (页面存档备份,存于互联网档案馆
  18. ^ MariaDB/Storage Engines, PBXT
  19. ^ About PBXT, About PBXT (页面存档备份,存于互联网档案馆
  20. ^ Inside MarkLogic Server[永久失效連結]
  21. ^ Snapshot Isolation in SQL Server. [2018-11-12]. (原始内容于2017-04-04). 
  22. ^ Multiversion concurrency control in MongoDB, MongoDB CTO: How our new WiredTiger storage engine will earn its stripes (页面存档备份,存于互联网档案馆
  23. ^ MySQL 5.1 Reference Manual, Section 14.2.12: Implementation of Multi-Versioning (页面存档备份,存于互联网档案馆
  24. ^ MySQL 5.1 Reference Manual, Table 14.1. Storage Engine Features (页面存档备份,存于互联网档案馆
  25. ^ or Maria MySQL 5.1 Reference Manual, Section 14.6.1: Falcon Features (Archive) Portuguese Web Archive的存檔,存档日期2014-10-04
  26. ^ Oracle Database Concepts: Chapter 13 Data Concurrency and Consistency Multiversion Concurency Control (页面存档备份,存于互联网档案馆
  27. ^ Oracle 4. Oracle FAQ. [21 March 2013]. (原始内容于2021-01-12). 
  28. ^ Oracle Timeline. [21 March 2013]. (原始内容于2021-01-31). 
  29. ^ OrientDb Documentation. [2018-11-12]. (原始内容于2015-12-27). 
  30. ^ PostgreSQL Current Documentation, Chapter 13: Concurrency Control (页面存档备份,存于互联网档案馆
  31. ^ How does MVCC (Multi-Version Concurrency Control) work. [2018-11-12]. (原始内容于2021-02-09). 
  32. ^ (PDF). [2018-11-12]. (原始内容 (PDF)存档于2016-03-03). 
  33. ^ RDM Embedded 10.1 Reference Manual, d_trrobegin (页面存档备份,存于互联网档案馆
  34. ^ RethinkDB advanced FAQ. [2018-11-12]. (原始内容于2016-03-28). 
  35. ^ Running Transactions - Splice Machine Documentation. doc.splicemachine.com. [2018-11-12]. (原始内容于2018-05-14). 
  36. ^ Archived copy. [2015-11-06]. (原始内容存档于2014-08-11). 
  37. ^ Proposal for MVCC in ZODB. [2018-11-12]. (原始内容于2012-02-06). 

延伸阅读 编辑

  • Gerhard Weikum, Gottfried Vossen, Transactional information systems: theory, algorithms, and the practice of concurrency control and recovery, Morgan Kaufmann, 2002, ISBN 1-55860-508-8

多版本并发控制, multiversion, concurrency, control, mvcc, 是数据库管理系统常用的一种并发控制, 也用于程序设计语言实现事务内存, mvcc意图解决读写锁造成的多个, 长时间的读操作饿死写操作问题, 每个事务读到的数据项都是一个历史快照, 并依赖于实现的隔离级别, 写操作不覆盖已有数据项, 而是创建一个新的版本, 直至所在操作提交时才变为可见, 快照隔离使得事务看到它启动时的数据状态, 目录, 算法, 历史, 数据库实现, 参考文献, 延伸阅读算法, 编辑mvcc使用时间戳. 多版本并发控制 Multiversion concurrency control MCC 或 MVCC 是数据库管理系统常用的一种并发控制 也用于程序设计语言实现事务内存 1 MVCC意图解决读写锁造成的多个 长时间的读操作饿死写操作问题 每个事务读到的数据项都是一个历史快照 并依赖于实现的隔离级别 写操作不覆盖已有数据项 而是创建一个新的版本 直至所在操作提交时才变为可见 快照隔离使得事务看到它启动时的数据状态 目录 1 算法 2 历史 3 数据库实现 4 参考文献 5 延伸阅读算法 编辑MVCC使用时间戳 TS 或 自动增量的事务ID 实现 事务一致性 MVCC可以确保每个事务 T 通常不必 读等待 数据库对象 P 这通过对象有多个版本 每个版本有创建时间戳 与废止时间戳 WTS 做到的 事务Ti读取对象 P 时 只有比事务Ti的时间戳早 但是时间上最接近事务Ti的对象版本可见 且该版本应该没有被废止 事务Ti写入对象P时 如果还有事务Tk要写入同一对象 则 Ti 必须早于 Tk 即 Ti lt Tk 才能成功 2 MVCC可以无锁 英语 Non lock concurrency control 实现 历史 编辑MVCC在1981年的一篇论文 Concurrency Control in Distributed Database Systems 3 被充分论述 并成为经典描述 一般认为原创工作始于1978年David P Reed 英语 David P Reed 的博士学位论文 4 数据库实现 编辑现在 多数数据库系统已经使用MVCC Altibase ArangoDB 5 Berkeley DB 6 Cloudant Clustrix 7 Couchbase CouchDB CUBRID 8 IBM Db2 从 IBM DB2 9 7 LUW Cobra 在 CS孤立级 currently committed mode 9 IBM Cognos TM1 从版本9 5 2 10 Drizzle Druid etcd 11 EXASOL eXtremeDB 12 Firebird 13 FLAIM FoundationDB GE Smallworld Version Managed Data Store H2 Database Engine 从版本 1 0 57 2007 08 25 14 HBase HSQLDB 从版本 2 0 IBM Netezza InfiniDB Ingres 15 InterBase 所有版本 16 LMDB MariaDB MySQL fork 当用于 XtraDB InnoDB分支 17 or PBXT 18 19 MarkLogic Server 见 20 MemSQL Meronymy SPARQL Database Server Microsoft SQL Server 当使用 READ COMMITTED SNAPSHOT 从SQL Server 2005 21 MongoDB 当使用 WiredTiger 22 存储引擎 MySQL 使用 InnoDB 23 24 Falcon 25 或 Archive 存储引擎 NuoDB ObjectDB ObjectStore Oracle database 从 Oracle 4 26 27 28 Oracle nee DEC Rdb OrientDB 29 PostgreSQL 30 更新的事务如果删除 修改了数据项并提交 则老的事务将对这些提交结果可见 31 Postgres XL Rdb ELN 32 RDM Embedded 33 REAL Server Realm RethinkDB 34 SAP HANA SAP IQ sones GraphDB Splice Machine 35 Sybase SQL Anywhere Tibero 从 Tibero 3 TokuMX 36 Actian Vector Zope Object Database 37 参考文献 编辑 refs 页面存档备份 存于互联网档案馆 Clojure Retrieved on 2013 09 18 Ramakrishnan R amp Gehrke J 2000 Database management systems Osborne McGraw Hill Philp A Bernstein and Nathan Goodman Multiversion Concurrency Control Theory and Algorithms ACM Transactions on Database Systems Vol 8 No 4 December 1983 pages 465 483 PDF 2018 11 12 原始内容存档 PDF 于2017 08 08 Reed David P Naming and Synchronization in a Decentralized Computer System PDF MIT dissertation September 21 1978 2018 11 12 原始内容存档 PDF 于2022 01 21 ArangoDB Manual Pages AppendOnly MVCC 2018 11 12 原始内容存档于2013 02 23 Berkeley DB Reference Guide Degrees of Isolation 2018 11 12 原始内容存档于2011 03 19 A new approach Clustrix Sierra database engine PDF 2018 11 12 原始内容存档 PDF 于2012 04 12 Database Transaction CUBRID 10 0 0 documentation cubrid manual readthedocs io 2018 11 12 原始内容存档于2017 09 07 DB2 Version 9 7 LUW Information Center Currently committed semantics improve concurrency TM1 9 5 2 Information Center Parallel Interaction etcd3 Documentation etcd3 API CoreOS 2018 11 12 原始内容存档于2019 01 13 Graves Steve Multi Core Software To Gain Speed Eliminate Resource Contention RTC Magazine May 1 2010 2018 11 12 原始内容存档于2010 06 01 White paper by Roman Rokytsky Firebird and Multi Version Concurrency Control 页面存档备份 存于互联网档案馆 Multi Version Concurrency Control in the H2 Database Engine 2018 11 12 原始内容存档于2006 07 09 MVCC Ingres Community Wiki 页面存档备份 存于互联网档案馆 Community ingres com Retrieved on 2013 09 18 Todd Bill InterBase What Sets It Apart 2000 4 May 2006 原始内容存档于2006 02 26 About XtraDB About XtraDB 页面存档备份 存于互联网档案馆 MariaDB Storage Engines PBXT About PBXT About PBXT 页面存档备份 存于互联网档案馆 Inside MarkLogic Server 永久失效連結 Snapshot Isolation in SQL Server 2018 11 12 原始内容存档于2017 04 04 Multiversion concurrency control in MongoDB MongoDB CTO How our new WiredTiger storage engine will earn its stripes 页面存档备份 存于互联网档案馆 MySQL 5 1 Reference Manual Section 14 2 12 Implementation of Multi Versioning 页面存档备份 存于互联网档案馆 MySQL 5 1 Reference Manual Table 14 1 Storage Engine Features 页面存档备份 存于互联网档案馆 or Maria MySQL 5 1 Reference Manual Section 14 6 1 Falcon Features Archive Portuguese Web Archive的存檔 存档日期2014 10 04 Oracle Database Concepts Chapter 13 Data Concurrency and Consistency Multiversion Concurency Control 页面存档备份 存于互联网档案馆 Oracle 4 Oracle FAQ 21 March 2013 原始内容存档于2021 01 12 Oracle Timeline 21 March 2013 原始内容存档于2021 01 31 OrientDb Documentation 2018 11 12 原始内容存档于2015 12 27 PostgreSQL Current Documentation Chapter 13 Concurrency Control 页面存档备份 存于互联网档案馆 How does MVCC Multi Version Concurrency Control work 2018 11 12 原始内容存档于2021 02 09 VAX Rdb ELN Version 2 3 Relational Database Management System PDF 2018 11 12 原始内容 PDF 存档于2016 03 03 RDM Embedded 10 1 Reference Manual d trrobegin 页面存档备份 存于互联网档案馆 RethinkDB advanced FAQ 2018 11 12 原始内容存档于2016 03 28 Running Transactions Splice Machine Documentation doc splicemachine com 2018 11 12 原始内容存档于2018 05 14 Archived copy 2015 11 06 原始内容存档于2014 08 11 Proposal for MVCC in ZODB 2018 11 12 原始内容存档于2012 02 06 延伸阅读 编辑Gerhard Weikum Gottfried Vossen Transactional information systems theory algorithms and the practice of concurrency control and recovery Morgan Kaufmann 2002 ISBN 1 55860 508 8 取自 https zh wikipedia org w index php title 多版本并发控制 amp oldid 78987003, 维基百科,wiki,书籍,书籍,图书馆,

文章

,阅读,下载,免费,免费下载,mp3,视频,mp4,3gp, jpg,jpeg,gif,png,图片,音乐,歌曲,电影,书籍,游戏,游戏。