プリンキピア

第8章データ管理

Sample RDBMS ApplicationsRDBMSのアプリケーション例
On the Web, there are two types of calls: asynchronous and synchronous. In the asynchronous call, the client sends a request without waiting for a response. In the synchronous call, the client sends a request and waits for a response from the service. API and HTTP calls are examples of synchronous calls. An example of a database fully managed on the Web is Oracle’s NoSQL data services.
英語のヒント
Webには、非同期と同期という、二つの種類の呼び出しがある。非同期呼び出しでは、クライアントは要求を送り、応答を待たない。同期呼び出しでは、要求を送ってから、サービスの応答を待つ。APIやHTTPの呼び出しは、同期呼び出しの例である。すべてをWeb上で管理するデータベースの例として、OracleのNoSQLデータサービスがある。

RDBMS FeaturesRDBMSの機能

RDBMS includes multiple features such as transaction management, concurrency control, data distribution, distributed transaction management, distributed and parallel processing, recovery, and security.
英語のヒント
RDBMSには、トランザクション管理、並行性制御、データの分散、分散トランザクション管理、分散・並列処理、回復、セキュリティーなど、複数の機能がある。
Transaction Managementトランザクション管理
Most database systems are multiuser. While transaction management allows concurrent access to the same data by multiple users, it may induce different types of anomalies. As a result, errors may occur in the DBMS or its environment. RDBMS must ensure that transactions support ACID (atomicity, consistency, isolation, durability) properties as explained in the following paragraphs.
英語のヒント
多くのデータベースシステムは、複数利用者に対応する。トランザクション管理は、複数の利用者が同じデータへ並行してアクセスできるようにする一方、異なる種類の異常を引き起こすこともある。その結果、DBMSやその環境に誤りが生じる場合がある。RDBMSは、以下で説明するACIDの性質、すなわち原子性、一貫性、分離性、永続性を、トランザクションが満たすようにしなければならない。
A transaction is a set of database operations induced by a single user or application that should be considered as one undividable unit of work (e.g., transfer between two bank accounts of the same customer). A transaction either succeeds or fails in its entirety.
英語のヒント
トランザクションは、一人の利用者や一つのアプリケーションによって発生し、一つの分割できない作業単位とみなすべき、データベース操作の集合である。同じ顧客の二つの銀行口座間の送金などが例である。トランザクションは、全体として成功するか、全体として失敗するかのどちらかである。
A transaction renders the database from one consistent state into another consistent state. The transaction manager supervises the execution of database transactions. A database transaction is a sequence of read/ write operations considered to be an atomic unit. The transaction manager creates a schedule with interleaved read/write operations, guarantees ACID properties, and can COMMIT a transaction upon successful execution or ROLLBACK a transaction upon unsuccessful execution. Delineating transactions within the transaction life cycle is called transaction management. Various components are involved in transaction management (i.e., scheduler, recovery manager, stored data manager, and buffer manager), and RDBMSs use a log file to register the current state of the transaction (active, committed, or aborted) and facilitate the implementation of checkpoint for rollback purposes.
英語のヒント
トランザクションは、データベースを、一つの整合した状態から別の整合した状態へ移す。トランザクション管理機構は、データベースのトランザクションの実行を監督する。データベースのトランザクションは、分割できない一単位とみなす、一連の読み書き操作である。トランザクション管理機構は、読み書き操作を織り交ぜたスケジュールを作り、ACIDの性質を保証する。正常に実行できたときにはCOMMITで確定し、正常に実行できなかったときにはROLLBACKで取り消すことができる。トランザクションのライフサイクルの中で、各トランザクションの範囲を定めることを、トランザクション管理という。トランザクション管理には、スケジューラー、回復管理機構、格納データ管理機構、バッファー管理機構など、さまざまな構成要素が関わる。RDBMSはログファイルを使って、トランザクションの現在の状態(活動中、確定済み、中止)を記録し、ロールバックのためのチェックポイントを実装しやすくする。
Concurrency Control並行性制御
The coordination of transactions that execute simultaneously on the same data so that they do not cause inconsistencies because of mutual interference is called concurrency control. A lock manager provides concurrency control, which ensures data integrity at all times. The two types of locks are read locks and write locks. The lock manager is responsible for assigning, releasing, and recording locks in the catalog. The lock manager makes use of a locking protocol that describes the locking rules, and a lock table that contains the lock information. Concurrency problems occur when multiple transactions execute concurrently without control.
英語のヒント
同じデータに対して同時に実行するトランザクションを調整し、相互干渉による不整合を起こさないようにすることを、並行性制御という。ロックマネージャーは並行性制御を行い、常にデータの整合性を確保する。ロックには、読み取りロックと書き込みロックの二種類がある。ロックマネージャーは、ロックの割り当てと解除、およびカタログへのロックの記録を担当する。ロックの規則を記したロックプロトコルと、ロック情報を収めたロック表を使う。複数のトランザクションが制御されずに並行実行されると、並行性の問題が起きる。
Data Distributionデータの分散
The process of storing data in more than one site to improve the data availability and retrieval performance is called data replication. Multiple databases located at different sites may need to be synchronized in real time to ensure consistency and optimal performance (e.g., fragmentation). There are different types of fragmentation:
英語のヒント
データの可用性と取得性能を高めるため、複数の場所へデータを格納する処理を、データ複製という。異なる場所にある複数のデータベースでは、一貫性と最適な性能を確保するために、リアルタイムの同期が必要な場合がある(フラグメンテーションなど)。フラグメンテーションには、次の種類がある。
• vertical fragmentation: consists of a subset of columns of data; global view can be retrieved with JOIN query; useful if only some of a tuple’s attributes are relevant to a node
英語のヒント
• 垂直分割:データの列の部分集合からなる。JOINの問い合わせで全体のビューを取り出せる。タプルの一部の属性だけが、あるノードに関係する場合に役立つ。
• horizontal fragmentation (sharding): the fragment consists of rows that satisfy a query predicate; global view can be retrieved with UNION query; common in NoSQL databases
英語のヒント
• 水平分割(シャーディング):問い合わせの述語を満たす行で断片を構成する。UNIONの問い合わせで全体のビューを取り出せる。NoSQLデータベースで一般的である。
• mixed fragmentation: combines horizontal and vertical fragmentation; global view can be retrieved with JOIN + UNION query
• 混合分割:水平分割と垂直分割を組み合わせる。JOINとUNIONを組み合わせた問い合わせで全体のビューを取り出せる。
Distributed Transaction Management分散トランザクション管理
A distributed transaction is a set of operations that are performed across multiple database systems. Distributed transaction management coordinates the resources between multiple databases. The transaction manager decides whether to commit or rollback a transaction using a two-phase commit (2PC). The steps of 2PC are described in Figure 8.12.
英語のヒント
分散トランザクションは、複数のデータベースシステムにまたがって実行する操作の集合である。分散トランザクション管理は、複数のデータベース間の資源を調整する。トランザクションマネージャーは、二相コミット(2PC)を使い、トランザクションをコミットするか、ロールバックするかを決める。図8.12に、2PCの手順を示す。
Figure 8.12

attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license · CC BY 4.0 · Source出典

Figure 8.12 Two-phase commit protocol illustrates the six steps needed for a distributed transaction. (attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license)
図8.12 二相コミットプロトコルは、分散トランザクションに必要な六つの手順を示している。(出典:著作権 Rice University、OpenStax、CC BY 4.0ライセンス)
The transaction management server manages the transactions in loosely coupled and tightly coupled modes. In loosely coupled, the different database servers coordinate transactions without sharing resources; in the tightly coupled, resources are shared.
英語のヒント
トランザクション管理サーバーは、疎結合と密結合の二つのモードでトランザクションを管理する。疎結合では、異なるデータベースサーバーが資源を共有せずにトランザクションを調整する。密結合では、資源を共有する。