論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
「NOSQLの基礎知識」講義資料 第20回JDMC定例セミナー(201310)
1. Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
2. 2
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
3. 3
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
4. 4
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
5. 5
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
6. 6
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
7. 7
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
8. 8
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
12. 12
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
13. Bigtable や Dynamo の論文発表が契機となり、
ソフトウェアによる大
規模分散技術は俄かに脚光を浴びました。
ビッグデータに直面していた
Web サービスのエンジニア達がこれに触発され、
Bigtable や Dynamo の
図0-2
13
Google Bigtableと Amazon Dynamo の発表論文
(表紙の一部)
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
14. ンソースとしてリリースされました。
その後 Cassandra は、
大規模な
ニュース関連 SNS であるDigg
(ディッグ) クラウドサービスの大手
や、
図1-2
14
代表的なNOSQL の利用企業の例
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
15. 15
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
16. 16
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
17. 17
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
18. 18
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
22. 22
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
23. Copyright (C) H. Takatsuji 2010
23
http://www.ie.reitaku-u.ac.jp/~tak/rdb2/rdb2-01.html
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
24. おけるデータ分割のイメージ
サーバー 1
サーバー 2
サーバー 3
サーバー 4
ーを指定するだけでバリューを探し出せるキー・バリュー型で
Cloudian Inc. & KK – Except where複
ケールアウトにより数十台、
数百台にサーバーが増えても、otherwise noted, content on this document is licensed
24
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
27. ・バリュー型におけるデータ分割のイメージ
サーバー 1
サーバー 2
2
第
サーバー 3
サーバー 4
2
章
N
O
S
Q
L
の
デ
ー
タ
モ
デ
ル
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
27
複数のサーバーに複数のバリューを複製する
28. 0 キー・バリュー型におけるデータの複製
サーバー 1
複製
複製
サーバー 2
複製
サーバー 3
28
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
のような課題に対するソリューションを実装しておらず、
単独のサー
29. { author:
created:
title:
text:
tags:
comments :
}
29
'joe',
new Date('03/28/2009'),
'Yet another blog post',
'Here is the text...',
[ 'example', 'joe' ],
[ { author: 'jim',
comment: 'I disagree'},
{ author: 'nancy', comment: 'Good post' }]
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
30. ファミリー」
を定義します。
その中でツィートID は、 2-14 のように、
図
新
しいツィートが発生するごとに、
行として縦方向に追加されていきます。
図2-14
カラム指向型における行の追加
ツィート・カラムファミリー
カラム
行キー
キー ィートID)
(ツ
ユーザー ID
ユーザーネーム
ボディ
タイムスタンプ
t342
u2415
gemini
NOSQL is fun
1234567
新しいツィートごとに新しい行を加える
図2-13
カラムの名前を固定しなくてよい
ユーザーライン・カラムファミリー
このデータベースにおいて、
ユーザーのツィートを取得するには、
ユー
カラム
ザーライン・カラムファミリーからユーザーのツィートID を取得し、
各
行キー
タイムスタンプ
キー
(ユーザー ID)
1234567
1234568
1234569
u2415
t342
t353
t389
72_第2章_責.indd 063
30
ツィート ID
2.4 カラム指向型の特徴
新しいツィートごとに新しい行を加える
2
063
第
2
章
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
N
2012/04/06 10:59:47
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
O
31. 31
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
32. 32
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
33. 33
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
35. 35
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
36. 36
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
37. 37
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
38. 38
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
39. 39
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
40. 40
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
41. Hibari DBのクラスター構成(Chain Replication)
41
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
43. 図 3-19 のように Bigtable では、
辞書配列に従ってキーの値がソートさ
図3-19
*
Bigtable のデータ割当て
タブレット
(リージョン)
行キー:
[ Arkansas , California )
行キー:
[ California , California-LosAngeles )
行キー:
[ California-LosAngeles , Colorado )
行キー:
[ Colorado , Florida )
タブレット
(リージョン)
サーバー 1
タブレット
(リージョン)
サーバー 2
3 ガベージコレクショ (Garbage Collection:GC)
ン
とは、
プログラムが実行の際に確保したメ
モリ
領域のう 不要になった領域を解放する処理です。同様に、 ドディ
ち、
ハー
スク上で不要になった領域
を削除する処理もこのよ
うに呼ばれます。
いずれの場合においても、
その都度解放や削除を行う り
よ
も、
ある程度不要な領域が溜まった時に一括して行う とで、
こ
全般的な性能を稼ぐのがこの仕組み
の目的です。
43
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
44. ACM
(Association for Computing Machinery)
が主催した PODC
(Principle Of Distributed Computing)
シンポジウムにおける
「Towards Robust Distributed Systems」
と題した基調講演の中でのことでした。
図3-6
Eric Brewer の CAP 定理
3
第
Consistency
整合性
Availability
可用性
Tolerance to network
「分散システムにおいては、
これら 3 つのうち最大 2 つ
しか満たすことができない」
分断耐性
(2000 年 7 月 19 日 PODC 基調講演)
Partitions
44
3
章
基ア
本ー
概キ
念テ
とク
技チ
術ャ
の
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
45. 通常のケース:
(1)
クライアントはデータの更新要求を A または B のいずれか
一方に送る。
(2) と B はデータが更新されたことを他方に通知する。
A
(3)
通知を受けた側は、自分のデータにその更新を反映する。
クライアント 1
クライアント 2
リクエスト
データ
データ
A
B
レプリケーション
(複製)
①クライアント1が Aに対して更新要求を出し、
Aは自身の持つデー
タを更新する。
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
② A はデータが更新されたことを B に伝え、 は自身の持つデータ
B
45
46. 46
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
47. ア
ョンや業務上の要求条件次第です。 ン
ライアント 1
クライアント 2
ト
が
書
き
生じた場合
込
み
CP
(整合性と分断耐性)
の場合:
リクエストは片方のグループ
(仮に A)リ
ク
だけが受け付け、他のグループは
エ
A
B
ス
自主的に停止する。
ト
を
クライアント 1
クライアント 2 送
る
3
第
3A
B
章
基ア
本ー
AP 概 キ
(可用性と分断耐性)
の場合:
念テ
リクエストは全てのグループが受け
とク
技チ
付けるが、A と B のデータは不整合
術ャ
となる。
の
クライアント 1
クライアント 2
ク
ラ
イ
ア
データ
データ
ン
ト
A
B
A
B
が
書
き
込
(可用性と分断耐性)
の場合:
み AP
リ リクエストは全てのグループが受け KK – Except where otherwise noted, content on this document is licensed
Cloudian Inc. &
ク 47
under a
付けるが、A と B のデータは不整合 Creative Commons Attribution-NonCommercial 3.0 Unported License.
48. しょう。
以下のような形で表されます。
R + W >N の場合には、
整合性が保証できる
図3-10
Quorum の概念図 + W <N]
[R
R+W<N の場合
書き込み
(W=1)
読み出し
(R=1)
?
?
?
複製
(N=3)
ノード 1
ノード 2
ノード 3
書き込みが 1 つのノードに行われているが、ノード
1.2.3 のどのノードから 1 つだけデータを読み出すか
はわからない。
_第3章_責.indd 088
48
2012/04/06 11:06:34
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
49. 果的にデータの整合性を保証できることになります。
図3-11
Quorum の概念図 + W >N]
[R
R+W>N の場合
書き込み
(W=2)
読み出し
(R=2)
複製
(N=3)
ノード 1
ノード 2
ノード 3
書き込みが 2 つのノードに行われ、読み出しが 2 つ
のノードに行われれば、必ず書き込みが行われた 2
つのノードのうちの 1 つに行きつく。
3.2 データの整合性に関する概念と技術
責.indd 089
089
2012/04/06 11:06:35
49
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
50. CAP 定理に基づいた NOSQL データベースの分類が、
Nathan Hurst
*2
氏のブログ
「Visual Guide to NOSQL Systems」 で紹介されています。
図3-7
CAP 定理によるNOSQL の分類
可用性 :
Cassandra
HBase
Riak
MongoDB
整合性
Redis
Infinispan
Neo4J
VoltDB (NewSQL)
どのクライアントも
常に読み出しと書き込み
ができる
A
CA
RDBMS
(MySQL、
Postgres 等)
Aster Data
Greenplum
Vertica
AP
2 者選択
C
Bigtable
Hypertable
HBase
Dynamo
Voldemort
Tokyo Cabinet
KAI
Cassandra
SimpleDB
CouchDB
Riak
P 分断耐性
:
物理ネットワークが分断
されても間違った結果を
引き起こさない
:
すべてのクライアント
が常に同一のデータを
見ている
50
リレーショナル型
(比較対照)
キー・バリュー型
データモデル
カラム指向型/テーブル
ドキュメント指向型
CP
MongoDB
Terrastore
Scalaris
Berkeley DB
Memcache DB
Redis
Cloudian Inc. & KK – Except where otherwise noted, content on this document(整合性と分
図 3-7 を見ると、
ほぼ全ての NOSQL データベースが、 is licensed
CP
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
断耐性) AP
か (可用性と分断耐性)
に分類されていることがわかると思い
51. Apache Cassandra
51
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
52. 52
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
53. Basho Riak
53
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
54. 54
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
55. Redis
55
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
56. 56
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
57. 57
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
58. 58
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
59. 59
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
60. 60
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
61. 61
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
62. These icons on this page are licensed to Tatsuya Kawano under
RF Clipart Standard License. http://rfclipart.com/ Please do not reuse.
62
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
64. 64
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
65. 65
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
66. 66
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
68. 68
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
73. 73
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
74. 74
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
75. 75
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
76. 76
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
77. 77
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
78. 78
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
79. 79
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
80. 80
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
82. 82
Cloudian Inc. & KK – Except where otherwise noted, content on this document is licensed
under a Creative Commons Attribution-NonCommercial 3.0 Unported License.