第8章データ管理
Differences between XML and Relational DataXMLデータと関係データの違い
While XML data are hierarchical, relational data are represented in a model of relationships. XML data are self-describing, but relational data are not. XML data have inherent ordering, but relational data do not. RDBMS only supports atomic data types such as integer, string, and date. XML DTDs do not support atomic data types. XML Schema supports both atomic and aggregated types (aggregated types modeled in object-relational databases using user-defined types). XML data are semistructured (can include certain anomalies, and a change to DTD or XSD necessitates regeneration of tables). For example, suppose a banking application needs to transfer money from one account to another. The transaction may involve multiple steps, such as deducting the amount from the sender's account and adding it to the recipient's account. If any of these steps fail, the entire transaction should be rolled back to ensure that the database remains consistent. Atomicity ensures that the transaction either completes successfully and all the changes are committed, or it fails and none of the changes are committed, leaving the database in a consistent state.
英語のヒント
XMLデータが階層的であるのに対し、関係データは関連のモデルで表される。XMLデータは自己記述的だが、関係データはそうではない。XMLデータには本来の順序があるが、関係データにはない。RDBMSは、整数、文字列、日付といった原子的なデータ型だけを支える。XMLのDTDは、原子的なデータ型を支えない。XML Schemaは、原子的な型と集約型の両方を支える。集約型は、オブジェクト関係データベースでは利用者定義型を使ってモデル化する。XMLデータは半構造化されており、一定の変則を含み得る。DTDやXSDを変更すると、表の再生成が必要となる。たとえば、銀行のアプリケーションで、ある口座から別の口座へ送金する必要があるとしよう。トランザクションは、送金元の口座から金額を差し引き、受取人の口座へ加えるなど、複数の手順を含み得る。どれか一つでも失敗したら、データベースの一貫性を保つため、トランザクション全体をロールバックすべきである。原子性により、トランザクションは正常に完了して変更がすべてコミットされるか、失敗して変更が一つもコミットされないかの、いずれかになる。これによって、データベースは一貫した状態に保たれる。
Mappings between XML and Object-Relational DataXMLデータとオブジェクト関係データの対応付け
An ontology is semantic data used to describe entities of the real world and the relationship between the entities using the Web Ontology Language (OWL) (Figure 8.16). To convert and map XML data into relational databases, we can use table-based mapping, which copies data from an external source such as XML into the selected table. A database schema is the structure of a database that defines how data are organized within a database. Schema-oblivious mapping stores both OWL class and instance data in a single table, which allows files to be easily parsed and loaded into the database. Schema-aware mapping maps the OWL schema into corresponding tables and then loads the instance data into the selected tables.
英語のヒント
オントロジーは、ウェブオントロジー言語(OWL)を使い、現実世界の実体と実体間の関連を記述する、意味に関するデータである(図8.16)。XMLデータを関係データベースへ変換して対応付けるには、表に基づくマッピングを使える。これは、XMLなどの外部データ源から、選んだ表へデータをコピーするものである。データベーススキーマは、データベース内でデータをどう組織するかを定める構造である。スキーマを考慮しないマッピングでは、OWLのクラスデータとインスタンスデータを一つの表へ格納するため、ファイルを簡単に解析してデータベースへ読み込める。スキーマを考慮するマッピングでは、OWLスキーマを対応する表へ写し、その後、インスタンスデータを選んだ表へ読み込む。

attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license · CC BY 4.0 · Source出典
Figure 8.16 The service profile tells what the service does, the service grounding tells how to access it, and the service model tells how it works. (attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license)
図8.16 サービスプロファイルは、サービスが何をするかを示す。サービスグラウンディングは、どうアクセスするかを示す。サービスモデルは、どう動作するかを示す。(出典:著作権 Rice University、OpenStax、CC BY 4.0ライセンス)
GLOBAL ISSUES IN TECHNOLOGY技術をめぐる世界的な課題
IT Solutions and Security IssuesITによる解決策とセキュリティ上の問題
IT solutions can help to address a range of security issues that organizations may face. Some common IT solutions for security issues include encryption and antivirus software.
英語のヒント
ITによる解決策は、組織が直面し得るさまざまなセキュリティ上の問題への対処に役立つ。よく使われるものには、暗号化やウイルス対策ソフトウェアがある。
Given the diversity of nonrelational database management systems and the fact that multiple systems may sometimes be used as part of the same solution, what are possible security issues that need to be considered?
英語のヒント
非関係データベース管理システムの多様性と、一つの解決策の中で複数のシステムを使う場合もあることを踏まえると、どのようなセキュリティ上の問題を考慮する必要があるだろうか。
Unstructured Data and NoSQL Databases非構造化データとNoSQLデータベース
Unstructured data are data that are not arranged according to the data model and cannot be stored in a traditional relational database. NoSQL databases are schema-agnostic and provide the flexibility needed to store and manipulate large volumes of unstructured and semistructured data. Users do not need to know what types of data are stored during setup, and the system can accommodate changes in data types and schema. Designed to distribute data across different nodes, NoSQL databases are generally more horizontally scalable and fault-tolerant. MongoDB Atlas is an example of a NoSQL database system that is fully managed and operates on the cloud.
英語のヒント
非構造化データは、データモデルに従って配置されておらず、従来の関係データベースに格納できないデータである。NoSQLデータベースは特定のスキーマに依存せず、大量の非構造化データや半構造化データを格納・操作するための柔軟性を持つ。利用者は設定時に格納するデータの型を知っておく必要がなく、システムはデータ型やスキーマの変化に対応できる。NoSQLデータベースは、異なるノードへデータを分散するよう設計されており、一般に、水平方向へ拡張しやすく、障害にも強い。MongoDB Atlasは、管理を全面的に任せられ、クラウド上で動くNoSQLデータベースシステムの一例である。
NoSQL DBMS is not ACID compliant and data consistency is not guaranteed. NoSQL DBMSs provide eventual consistency instead: when old data are getting overwritten, results that are a little wrong are temporarily returned. For example, Google’s search engine index cannot overwrite its data while people are simultaneously searching a given term so it does not give the most up-to-date results during a search, but it gives the best answer it can. While this setup does not work in situations where data consistency is necessary, such as financial transactions, it is just fine for tasks that require speed rather than pinpoint accuracy.
英語のヒント
NoSQL DBMSはACIDに準拠せず、データの一貫性は保証されない。代わりに、結果整合性を提供する。古いデータが上書きされている間は、少し不正確な結果が一時的に返される。たとえば、Googleの検索エンジンの索引は、人々が同時にある語を検索している間、そのデータを上書きできない。このため、検索時に最も新しい結果を返すわけではないが、可能な限り最善の答えを返す。こうした仕組みは、金融取引のようにデータの一貫性が必要な状況には適さないが、厳密な正確さより速さを必要とする作業には十分である。
Key-Value Storesキーバリューストア
A key-value store is a simple database that uses an associative array such as Redis, DynamoDB, and Cosmos DB. It stores only key-value pairs, provides basic functionality for retrieving the value associated with a known key, and works best with a simple database schema.
英語のヒント
キーバリューストアは、Redis、DynamoDB、Cosmos DBなどの、連想配列を使う単純なデータベースである。キーと値の組だけを格納し、既知のキーに対応する値を取り出す基本機能を備える。単純なデータベーススキーマに最も適している。