14.2 InnoDB and the ACID Model

The ACID model is a set of database design principles that emphasize aspects of reliability that are important for business data and mission-critical applications. MySQL includes components such as the InnoDB storage engine that adhere closely to the ACID model, so that data is not corrupted and results are not distorted by exceptional conditions such as software crashes and hardware malfunctions. When you rely on ACID-compliant features, you do not need to reinvent the wheel of consistency checking and crash recovery mechanisms. In cases where you have additional software safeguards, ultra-reliable hardware, or an application that can tolerate a small amount of data loss or inconsistency, you can adjust MySQL settings to trade some of the ACID reliability for greater performance or throughput.
ACID模型是一組數據庫設計原則,強調可靠性方面,這對業務數據和任務關鍵型應用程序非常重要。MySQL包括與ACID模型緊密結合的InnoDB存儲引擎等組件,這樣數據就不會損壞,也不會因爲軟件崩潰和硬件故障等特殊條件而導致結果不一致,當您依賴於符合ACID的特性時,您不需要重新創建一致性檢查和崩潰恢復機制的輪子,在你有額外的軟件保障的情況下,超可靠的硬件或者能夠容忍少量數據丟失或不一致的應用程序,您可以調整MySQL設置來交換一些ACID可靠性,以獲得更高的性能或吞吐量。
The following sections discuss how MySQL features, in particular the InnoDB storage engine, interact with the categories of the ACID model:
下面詳細討論mysql特性,特別是innodb存儲引擎與ACID模式類別的交互

  • A: atomicity.
  • 原子性
  • C: consistency.
  • 一致性
  • I:: isolation.
  • 隔離性
  • D: durability.
  • 永久性

Atomicity

The atomicity aspect of the ACID model mainly involves InnoDB transactions. Related MySQL features include:
ACID的模型方面主要涉及InnoDB事務的原子性,相關的mysql功能包括

  • Autocommit setting.
  • 自動提交設置
  • COMMIT statement.
  • COMMIT語句
  • ROLLBACK statement.
  • ROLLBACK語句
  • Operational data from the INFORMATION_SCHEMA tables.
  • 來自INFORMATION_SCHEMA表的操作數據。

Consistency

The consistency aspect of the ACID model mainly involves internal InnoDB processing to protect data from crashes. Related MySQL features include:
ACID模型的一致性方面主要涉及InnoDB內部處理保護數據崩潰。相關的mysql功能包括

* InnoDB doublewrite buffer.
* InnoDB crash recovery.

Isolation

The isolation aspect of the ACID model mainly involves InnoDB transactions, in particular the isolation level that applies to each transaction. Related MySQL features include:
ACID的隔離模式方面主要涉及InnoDB事務,特別是適用於每個事務的隔離級別,相關的mysql功能包括

  • Autocommit setting.
  • Autocommit設置
  • SET ISOLATION LEVEL statement.
  • SET ISOLATION LEVEL 語句
  • The low-level details of InnoDB locking. During performance tuning, you see these details throughINFORMATION_SCHEMA tables.
  • InnoDB locking的底層細節。,在性能調優上,你可以通過INFORMATION_SCHEMA表看到詳細的信息

Durability

The durability aspect of the ACID model involves MySQL software features interacting with your particular hardware configuration. Because of the many possibilities depending on the capabilities of your CPU, network, and storage devices, this aspect is the most complicated to provide concrete guidelines for. (And those guidelines might take the form of buy“new hardware”.) Related MySQL features include:
ACID模型的持久性方面涉及到與特定硬件配置交互的MySQL軟件特性。由於依賴於CPU、網絡和存儲設備的能力有很多可能性,因此提供具體的指導方針是最複雜的。(這些指導方針可能採取購買“新硬件”的形式。)有關MySQL功能包括:

  • InnoDB doublewrite buffer, turned on and off by the innodb_doublewrite configuration option.
  • InnoDB doublewrite buffer,打開或者關閉 innodb_doublewrite 配置項
  • Configuration option innodb_flush_log_at_trx_commit.
  • 配置 innodb_flush_log_at_trx_commit選項
  • Configuration option sync_binlog.
  • 配置 sync_binlog選項
  • Configuration option innodb_file_per_table.
  • 配置innodb_file_per_table選項
  • Write buffer in a storage device, such as a disk drive, SSD, or RAID array.
  • 在存儲設備 (如磁盤驅動器、SSD 或 RAID 陣列) 中寫入緩衝區
  • Battery-backed cache in a storage device.
  • 存儲設備中的電池備份緩存
  • The operating system used to run MySQL, in particular its support for the fsync() system call.
  • 操作系統運行使用MySQL,特別對於fsync()系統調用的支持。
  • Uninterruptible power supply (UPS) protecting the electrical power to all computer servers and storage devices that run MySQL servers and store MySQL data.
  • 不間斷電源(UPS)保護電力到所有計算機服務器和運行mysql服務器以及存儲MySQL數據的存儲設備。
  • Your backup strategy, such as frequency and types of backups, and backup retention periods.
  • 您的備份策略,如備份的頻率和類型,以及備份保留期。
  • For distributed or hosted data applications, the particular characteristics of the data centers where the hardware for the MySQL servers is located, and network connections between the data centers.
  • 對於分佈式或託管數據應用程序,數據中心的特殊特性和MySQL服務器的硬件位於何處以及數據中心之間的網絡連接。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章