qpstudy 2013.07 nosql
Post on 13-Sep-2014
1.877 views
DESCRIPTION
TRANSCRIPT
![Page 1: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/1.jpg)
NoSQLって?正しく使い分けるための第一歩
qpstudy 2013.07
![Page 2: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/2.jpg)
Agenda
2. NoSQLの分類
1. NoSQLって?
3. NoSQLの紹介
![Page 3: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/3.jpg)
Agenda
1. NoSQLって?
2. NoSQLの分類
3. NoSQLの紹介
![Page 4: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/4.jpg)
定義 - NoSQLって?
定義は?
![Page 5: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/5.jpg)
定義 - NoSQLって?
定義は?
ありません
![Page 6: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/6.jpg)
定義 - NoSQLって?
一般にはRDBMS以外
NOSQL meetup 2009で使われてから広まったそう
http://blog.sym-link.com/2009/05/12/nosql_2009.html
http://ja.wikipedia.org/wiki/NoSQL
![Page 7: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/7.jpg)
目的 - NoSQLって?
なぜNoSQLが必要?
![Page 8: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/8.jpg)
データベースとは- NoSQLって?
- データを整理、格納し
- 検索して取り出す
RDBMSに限界が…
![Page 9: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/9.jpg)
RDBMSの限界- NoSQLって?
etc.
データ量
ノード数の限界データ増加に伴う性能劣化
スキーマ
開発速度の上昇
性能
レイテンシーQPSスループット
![Page 10: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/10.jpg)
NoSQLの目的 - NoSQLって?
RDBMSでは解決出来ない問題を解くため
※いずれかの問題領域に特化している傾向
![Page 11: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/11.jpg)
RDBMSは - NoSQLって?
RDBMSは必要なくなるか?
![Page 12: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/12.jpg)
RDBMSの理由 - NoSQLって?
- 大部分の問題は以前RDBMSで十分- RDBMSの適用領域も広がっている
- RDBMSの機能をトレードオフ
- 歴史が浅い- ノウハウ、実装の枯れ具合、ライブラリ etc.
![Page 13: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/13.jpg)
RDBMS適用領域 - NoSQLって?
ミドルウェアの進化
ハードウェアの進化
- メモリの大容量化- FusionIO 高速ブロックデバイス
- MySQLのmemcachedインターフェース- PostgreSQLのJSON型
![Page 14: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/14.jpg)
トレードオフ - NoSQLって?
- トランザクション
- SQL - 共通したインターフェース
- データモデル
- etc.
![Page 15: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/15.jpg)
ポイント - NoSQLって?
あなたの解くべき問題にマッチしていますか?
![Page 16: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/16.jpg)
Agenda
1. NoSQLって?
2. NoSQLの分類
3. NoSQLの紹介
![Page 17: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/17.jpg)
NoSQLの分類
※ RDBMSほどには体系化されていない
最後は個別のDBを見ていく必要が
![Page 18: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/18.jpg)
軸 - NoSQLの分類
- データの配置による分類
- データの表現による分類
データが物理的にどう配置されるか
ユーザーからみてどのようなデータを格納するか
![Page 19: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/19.jpg)
データの配置- NoSQLの分類
- スタンドアロン
- 分散 P2P型
- 分散 マスタ型
![Page 20: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/20.jpg)
スタンドアロン - NoSQLの分類
ノード ノードレプリケーション
- 一つのノードの全てのデータが配置される- レプリケーション含む
![Page 21: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/21.jpg)
分散 マスタ型- NoSQLの分類
ノード ノード ノード ノード
マスタ
- データは分割されて各ノードに配置- クラスタ全体のメタ情報を管理するマスタが存在
- データの配置- ノードの追加/削除
![Page 22: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/22.jpg)
分散 P2P型 - NoSQLの分類
- データは分割されて各ノードに配置- 各ノード自身がクラスタの状態を管理- 各ノードの状態は後で合わせる
ノード ノード ノード ノード
![Page 23: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/23.jpg)
データの表現 - NoSQLの分類
- KVS
- BigTable型
- ドキュメント指向
- グラフ
![Page 24: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/24.jpg)
KVS - NoSQLの分類
1 v12 v2
5 v5 v2key=2
3 v34 v4
検索格納
- キーとバリューのペア- 性能に特化
- レイテンシー、QPS
![Page 25: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/25.jpg)
ドキュメント指向 - NoSQLの分類
tagsに2を含むもののid
{“id”:1, ”tags”[1,2,3]}
{“id”:2, ”tags”[1,3]}
{“id”:3, ”tags”[2,5]}
{“id”:6, ”tags”[3,4]} 1,3,5
{“id”:4, ”tags”[1]}{“id”:5, ”tags”[2,3,4]}
検索格納
- 構造化された”ドキュメント”- JSON
- スキーマレス
![Page 26: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/26.jpg)
BigTable型 - NoSQLの分類
カラムファミリー1カラムファミリー1カラムファミリー1 カラムファミリー2カラムファミリー2カラムファミリー2カラムファミリー2列1 列2 列3 列4 列5 列6 列7
行1行2行3行4
- GoogleのBigTable- 大規模な分散を目標- カラム型とも
- 注: 列指向RDBMSとは異なる
- テーブル + カラムファミリー- 実際はKVSに近い
- key: row + column family + column- value: cell
![Page 27: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/27.jpg)
グラフ - NoSQLの分類
A
CB
D
ID リンク
A
B
C
D
B,C
A
D
- “ノード”と”エッジ”から構成される”グラフ構造”- トラバーサル
- ノード間を辿るクエリ
![Page 28: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/28.jpg)
Agenda
1. NoSQLって?
2. NoSQLの分類
3. NoSQLの紹介
![Page 29: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/29.jpg)
memcached - NoSQLの紹介
- KVS- スタンドアロン型- 主にキャッシュ層として
![Page 30: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/30.jpg)
Redis - NoSQLの紹介
- KVS- スタンドアロン型- バリューに構造化データ
- リスト、ハッシュ、セット
![Page 31: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/31.jpg)
MongoDB - NoSQLの紹介
- ドキュメント指向- 分散 マスタ型- 柔軟なクエリ / インデックス
![Page 32: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/32.jpg)
Cassandra HBase - NoSQLの紹介
- BigTable型- 分散 P2P型- Dynamoをベースにした分散
- BigTable型- 分散 マスタ型- キーでソート済み- 強い一貫性
![Page 33: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/33.jpg)
まとめ
![Page 34: qpstudy 2013.07 NoSQL](https://reader034.vdocuments.site/reader034/viewer/2022051311/5413bcdc8d7f7294698b46e5/html5/thumbnails/34.jpg)
まとめ
✓NoSQLはRDBMSで対応できない問題を解決する
✓解くべき問題に向けたDBを選ぶことが重要✓RDBMS/NoSQL含む
✓次のような軸で分類すると分かりやすい✓データの配置✓データの表現