書籍情報データベースOpen Library

世界中の書籍の情報を集め、ユーザーが閲覧編集できるようにしたOpen Libraryでは新しいデータベース・フレームワークThingDBが使われている。PostgreSQLをベースにしたThingDBではthingと呼ぶオブジェクトをストアし、各thingに複数のキーと値のペアを与える。Open Libraryでは各ページ、書籍、著者やユーザーがthingとなり、例えば書籍ではキーがタイトルで値がA Heartbreaking Work of Staggering Genius、キーがジャンルで値が回想録のようになる。またそれぞれのキー・値ペアが保存時の時間とユーザー名とともにバージョンとしてストアされるので、ある程度構造化されたデータの中から以前に戻って古いデータを抽出することができる。ただ新しいデータベース・フレームワークを構築するだけでは充分とは言えないのでOpen LibraryではAaron Swartzによるinfogamiというwikiテクノロジーを使っている。infogamiは普通のwikiが非構造データをストアするのに対してある程度構造化されたデータをストアしThingDBがそのデータをクエリすることが可能になっている。

So we created ThingDB (tdb), a new database framework that gives us this flexibility. ThingDB stores a collection of objects, called "things". For example, on the Open Library site, each page, book, author, and user is a thing in the database. Each thing then has a series of arbitrary key-value pairs as properties. For example, a book thing may have the key "title" with the value "A Heartbreaking Work of Staggering Genius" and the key "genre" with the value "Memoir". Each collection of key-value pairs is stored as a version, along with the time it was saved and the person who saved it. This allows us to store full semi-structured data, as well as travel back thru time to retrieve old versions of it.

http://demo.openlibrary.org/about/tech