SlideShare a Scribd company logo
NoSQL
研究⽣生 鍾聖彥
指導⽼老師 李永⼭山教授
NoSQL 意指不僅僅是 SQL
Introduction
•

NoSQL⼀一詞最早出現於1998年,是Carlo Strozzi開發的
⼀一個輕量、開放原始碼、不提供SQL功能的關係資料庫

•

2009年來⾃自Rackspace的Eric Evans再次提出了NoSQL
的概念,這時的NoSQL主要指⾮非關係型、分布式、不提供
ACID的資料庫設計模式。(為聚會取名⼦子>>>NoSQL)

•

NoSQL資料庫通常都是基於21世紀早期網站需求⽽而設計

•

聚焦在叢集上的巨量資料
NoSQL是⼀一個不⼩小⼼心被創⽴立的名詞
NoSQL資料庫的共通特性
•

不使⽤用關聯式模型

•

在叢集上可以良好執⾏行

•

開放原始碼

•

爲21世紀的網站所建⽴立

•

無綱要的

•

不使⽤用SQL作為查詢語⾔言
為什麼要⽤用 NoSQL?(1/2)
• 管理⼤大規模資料:NoSQL 資料庫能輕易處理⼤大量的讀寫
週期、眾多⽤用⼾戶,以及數以 petabytes 計的資料。
50

(petabytes =2

bytes; 1024 terabytes, or a million gigabytes.)

• 不需要資料庫綱要 (Schema):當涉及到綱要建構時,它
們提供了相當廣泛的選擇空間,能輕易地和物件相對應。
• 開發者親和性:NoSQL 資料庫對各主要程式語⾔言提供了
簡單的 API,因此再也⽤用不著複雜的 ORM 框架。如果特定程式
語⾔言沒有 API 可⽤用時,還是可以透過簡單的 Restful API,使⽤用
XML 以及 JSON 格式經由 HTTP 存取資料。
為什麼要⽤用 NoSQL?(2/2)
• 可⽤用性: 多數分散式 NoSQL 資料庫都提供簡易
的資料複製,單⼀一節點的毀損較不會影響資料的可⽤用
性。
• 延展性:NoSQL 資料庫不需要專⽤用的⾼高效能伺服
器。輕易地運⾏行在⼀一般硬體組成的叢集上。
• 低延遲
Do not fully support relational features
no join operations (except within partitions),
no referential integrity constraints across partitions.
How did we get?
•

Explosion of social media sites (Google,Facebook,
Twitter) with large data needs

•

Rise of cloud-based solutions such as Amazon S3
(simple storage solution)

•

Open-source community
Who influences?
Dynamo and BigTable
•

Three major papers were the seeds of
the NoSQL movement:

BigTable (Google)
Dynamo (Amazon)
•

CAP Theorem
CAP Theorem
•

⼜又被稱作 布魯爾定理(Brewer's theorem)

•

Brewer’s CAP “Theorem”: for any system sharing data it is
impossible to guarantee simultaneously all of these three
properties:

•

Consistency: all nodes see the same data at the same time

•

Availability: a guarantee that every request receives a
response about whether it was successful or failed

•

Partition tolerance: the system continues to operate despite
arbitrary message loss or failure of part of the system
CAP Theorem
!

•

Very large systems will partition at some point:

It is necessary to decide between C and A
!

•

Traditional DBMS prefer C over A and P

!

•

Most Web applications choose A (except in specific
applications such as order processing)
No sql
NoSQL database
NoSQL 資料模型(1/2)
•

Key-value Stores:⼀一般只包含⼀一系列的全域鍵值對,每個值各
伴隨有獨特的鍵

•

Document stores:模型的著名實作包括 MongoDB、CouchDB、
RavenDB

•

Column-oriented:Google 針對內部使⽤用的 BigTable 分散式儲存系
統,發表研究論⽂文之後,以列為導向的資料庫知名的其他實作包括
Hadoop Hbase、Apache Cassandra、HyperTable

•

圖形 (Graph):適合⽤用來記錄任何擁有複雜關係的資料,如社群網
路、產品偏好或是任何規則等。ex: Twitter ⽤用以實現⽤用⼾戶追蹤 (follow)
圖形的 FlockDB.
!
•

NoSQL 資料模型(2/2)
Hierarchical :These databases store data in the form of
hierarchical relevance, that is, tree or parent-child
relationship.

ex:階層式資料庫著名的實作包括 Microsoft 的 Windows
Registry 與 IBM 的 IMS 資料庫
•

Triple stores:Triple stores save data in the form of subjectpredicate-object with the predicate being the linking factor
between subject and object.

Support Semantic Web and RDF Storage
Complexity
Key-value Stores
Extremely	
  simple	
  interface	
  

Data model: (key, value) pairs
Operations: Insert(key,value), Fetch(key),
Update(key), Delete(key)

Implementa2on:	
  efficiency,	
  scalability,	
  fault-­‐tolerance	
  
•
•
•
•

Records distributed to nodes based on key
Replication
Single-record transactions, “eventual consistency”
Riak – Based on Amazon’s Dynamo.

Example	
  systems	
  

Google BigTable, Amazon Dynamo, Cassandra,
Voldemort, HBase, …
Key-value Stores

!

•

Riak – Based on Amazon’s Dynamo.
Suitable or Not suitable
合適的使⽤用狀況

不適合使⽤用狀況

儲存網路通訊對話資訊

取得不同資料間的關係

使⽤用者喜好設定

多個鍵值操作

購物⾞車資料

⽤用資料來查詢
Document stores
Like Key-Value Stores except value is document
Data model: (key, document) pairs
Document: JSON, XML, other semistructured formats
Basic operations:
Insert(key,document), Fetch(key),
Update(key), Delete(key)
Also Fetch based on document contents.
Example systems
CouchDB, MongoDB, SimpleDB, …
Document stores
Suitable or Not suitable
合適的使⽤用狀況

不適合使⽤用狀況

事件歷史記錄

包含多種複雜交易

內容管理系統、部落格

在不同叢集結構上查詢

網路分析、

即時資料分析
Column-oriented
Based on JSON format: a data model which supports
lists, maps, dates, Boolean with nesting
Really: indexed semistructured documents
!

Example: Mongo
{
Name:"Jaroslav",
Address:"Malostranske nám. 25, 118 00 Praha 1“
Grandchildren: [Claire: "7", Barbara: "6", "Magda: "3",
"Kirsten: "1", "Otis: "3", Richard: "1"]
}
Column-oriented
Column-oriented
Row oriented
Id

username

email

Department

1

John

john@foo.com

Sales

2

Mary

mary@foo.com

Marketing

3

Yoda

yoda@foo.com

IT

Column oriented
Id

Username

email

Department

1

John

john@foo.com

Sales

2

Mary

mary@foo.com

Marketing

3

Yoda

yoda@foo.com

IT
Suitable or Not suitable
合適的使⽤用狀況

不適合使⽤用狀況

事件歷史記錄

讀取或寫⼊入

ACID交易系統

內容管理系統、部落格
平台

開發初期階段

限期使⽤用(廣告推播)

查詢變更(COST)
Graph stores
Interfaces and query languages vary
Example systems: Neo4j, FlockDB, Pregel, …
RDF “triple stores” can map to graph databases

•
•
•
•
•
•

Data model: nodes and edges
Nodes may have properties (including ID)
Edges may have labels or roles
Graph stores
Graph stores
Suitable or Not suitable
合適的使⽤用狀況

不適合使⽤用狀況

社群網路發佈

更新全部或實體⼦子集

轉發、傳遞基於位置的
服務
Recommendation
Conclusion and Discuss
NoSQL database cover only a part of data-intensive
cloud applications (mainly Web applications).
!

Problems with cloud computing:
• SaaS applications require enterprise-level functionality,
including ACID transactions, security, and other
features associated with commercial RDBMS
technology, i.e.
!

•
!
!
!

NoSQL should not be the only option in the cloud.
Conclusion and Discuss
!
!

Hybrid solutions:
Voldemort with MySQL as one of storage backend
deal with NoSQL data as semistructured data
integrating RDBMS and NoSQL via SQL/XML
!
Reference
http://www.ithome.com.tw/itadm/article.php?c=63360&s=5
http://www.openfoundry.org/index.php?
option=com_content&task=view&id=9040&Itemid=4;isletter=1
http://www.julianbrowne.com/article/viewer/brewers-cap-theorem
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.20.1495 

Book:搞懂NoSQL的15堂課(Pramod J. Sadalage、
Martin Fowler)
End

More Related Content

PPTX
NoSQL-MongoDB
PDF
An overview to sql engines
PDF
CH09:Collection與Map
PPTX
深入淺出Node.JS
PDF
CH16:整合資料庫
PDF
大型网站架构的发展
PPTX
Elasticsearch search engine_development_tips
KEY
Redis
NoSQL-MongoDB
An overview to sql engines
CH09:Collection與Map
深入淺出Node.JS
CH16:整合資料庫
大型网站架构的发展
Elasticsearch search engine_development_tips
Redis

What's hot (20)

PDF
MySQL设计、优化、运维
PPTX
Elastic stack day-1
PPTX
Java_08:SQL
PDF
Cassandra Technical and history overview
PDF
Nginx深度開發與客制化
PPTX
快速入坑 Node.js - 0613 SITCON 雲林定期聚
PDF
设计高性能mysql应用-TechClub技术沙龙
PPTX
ASP.Net MVC Framework
PPT
数据库高可用架构
PPTX
Team Foundation Server
PDF
MySQL技术分享:一步到位实现mysql优化
PDF
Spark sql培训
PDF
關聯式資料庫系統的規劃
PPTX
鳳山高中/網頁應用程式開發入門 I
PPTX
1到100000000 - 分布式大型网站的架构设计
PPTX
Ch09 整合資料庫
PDF
CH17:反射與類別載入器
PDF
漫画背后的故事
PDF
Tdsql在微众银行核心交易系统中的实践 雷海林
PPT
新浪微博redis技术演化
MySQL设计、优化、运维
Elastic stack day-1
Java_08:SQL
Cassandra Technical and history overview
Nginx深度開發與客制化
快速入坑 Node.js - 0613 SITCON 雲林定期聚
设计高性能mysql应用-TechClub技术沙龙
ASP.Net MVC Framework
数据库高可用架构
Team Foundation Server
MySQL技术分享:一步到位实现mysql优化
Spark sql培训
關聯式資料庫系統的規劃
鳳山高中/網頁應用程式開發入門 I
1到100000000 - 分布式大型网站的架构设计
Ch09 整合資料庫
CH17:反射與類別載入器
漫画背后的故事
Tdsql在微众银行核心交易系统中的实践 雷海林
新浪微博redis技术演化
Ad

Similar to No sql (20)

PPTX
No sql带来了什么 孙立
PPTX
開放原始碼 Ch2.4 app - oss - db (ver 1.0)
PPTX
No sql数据库杂谈—理论篇
PDF
Sql or no sql, that is the question
PPT
Sequoia db 技术概述_sacc
PDF
基于My sql的分布式数据库实践
PDF
基于MySQL的分布式数据库实践
PPSX
浅谈 My sql 性能调优
PPSX
MySQL应用优化实践
PDF
美丽说的架构发展与变迁 New
PPTX
賽門鐵克 Storage Foundation 6.0 簡報
PPTX
20141128(刘胜)UTC2014分布式和云服务的思考与实践——支付清算行业分布式架构的探索
PPTX
阿里自研数据库 Ocean base实践
PPTX
阿里自研数据库 Ocean base实践
PDF
Azure Data Lake 簡介
PPT
深入学习Mongo db
PPTX
現代資料庫
PPTX
架構設計-資料存取的選擇
PPSX
No sql应用场景及cassandra架构分析
PDF
NoSQL误用和常见陷阱分析
No sql带来了什么 孙立
開放原始碼 Ch2.4 app - oss - db (ver 1.0)
No sql数据库杂谈—理论篇
Sql or no sql, that is the question
Sequoia db 技术概述_sacc
基于My sql的分布式数据库实践
基于MySQL的分布式数据库实践
浅谈 My sql 性能调优
MySQL应用优化实践
美丽说的架构发展与变迁 New
賽門鐵克 Storage Foundation 6.0 簡報
20141128(刘胜)UTC2014分布式和云服务的思考与实践——支付清算行业分布式架构的探索
阿里自研数据库 Ocean base实践
阿里自研数据库 Ocean base实践
Azure Data Lake 簡介
深入学习Mongo db
現代資料庫
架構設計-資料存取的選擇
No sql应用场景及cassandra架构分析
NoSQL误用和常见陷阱分析
Ad

More from Department of Information Management Ming Chuan University, Taiwan (9)

No sql