Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
NoSQL & MongoDB
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Shuai Liu
June 20, 2014
Programming
200
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
NoSQL & MongoDB
Shuai Liu
June 20, 2014
More Decks by Shuai Liu
See All by Shuai Liu
Auto-Layout.pdf
liushuaikobe
2
140
Python-intro-2
liushuaikobe
0
87
Python-intro-1
liushuaikobe
0
87
GitRadar——毕业论文答辩
liushuaikobe
0
220
Other Decks in Programming
See All in Programming
型も通る、synthも通る、それでも危ない 〜AIのCDKの権限とコストを機械で検証する〜 / It Passes Type Checks, It Passes Synth Checks, but It’s Still Risky — Automatically Verifying Permissions and Costs in AI’s CDK —
seike460
PRO
1
530
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
250
AIが無かった頃の素敵な出会いの話
codmoninc
1
380
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
290
Android CLI
fornewid
0
210
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
120
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
0
1.7k
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
650
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
1.1k
霧の中の代数的エフェクト
funnyycat
1
460
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
150
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
170
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
40k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
420
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.7k
sira's awesome portfolio website redesign presentation
elsirapls
0
320
A designer walks into a library…
pauljervisheath
211
24k
Embracing the Ebb and Flow
colly
88
5.1k
Faster Mobile Websites
deanohume
310
32k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
680
Chasing Engaging Ingredients in Design
codingconduct
0
260
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
190
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
610
Transcript
No-SQL & mongoDB @liushuaikobe
What’s No-SQL?
Strozzi NoSQL (1998) RDBMS operator-stream paradigm(PIPE) a set of shell
routines that access normal files of the OS Carlo Strozzi
No-SQL == Not Have SQL
No-SQL == Not Have Structured Query Language SQL
…departs from the relational model altogether; it should therefore have
been called more appropriately 'NoREL'.
A meetup@San Francisco ——"open source, distributed, non relational databases” Organized
by Johan Oskarsson(Last.fm) Google's Bigtable & Amazon's Dynamo Eric Evans(then in RackSpace) reintroduced “No-SQL”
No-SQL == non-relational
Eric Evans My regret however isn't about what the name
says, it's about what it doesn't.
no:sql(east) conference@ Atlanta
> select fun, profit > from real_world > where relational=false;
No-SQL == Not Only SQL
CAP Theorem (Eric Brewer) Consistency Partition Tolerance Availability
BASE neutral A C I D PH S B E
A
asically vailable ventually Consistent oft-state S B E A
Why No-SQL? Traditional RDBMS —— CA Do We really need
Transaction? Horizontal-Scale
List Of NoSQL DBs Wide Column Store Document Store Key
Value / Tuple Store Graph Databases …
mongoDB
10gen established in 2007, @New York originally aimed to build
a Paas architecture released MongoDB, maintaining it
MongoDB Inc. (2013.08) established in 2007, @New York originally aimed
to build a Paas architecture released MongoDB, maintaining it
MongoDB document-oriented(BSON) Storage schema-free high-performance build for scale
Document
Data-Model Design References Embedded
Reference
Embedded
which way is better? No Define answer.
A Instance
{ "actor_attributes" : {
"name" : "Dan Tao", "company" : "Google", ... "email" : "
[email protected]
" }, "repository" : { "fork" : false, "watchers" : 0, "description" : "Oh, nothing, nothing", ... "id" : 13155632, "name" : "breakneck" }, "url" : "https://github.com/dtao/breakneck/compare/dccee09561...38984e5dce", "created_at" : "2013-‐09-‐28T18:00:06-‐07:00", "actor" : "dtao", "public" : true, "type" : "PushEvent", "payload" : { "shas" : [ [ ... ] ], "head" : "38984e5dce1a21b778d4c26bde493270b4625662", "ref" : "refs/heads/master", "size" : 1 } }
RDBMS——ERD Actor Repo Event 1..n 1..1 1..n 1..1
While in mongo… { "_id" : ObjectId("5287d3e947e36f2280584179") "actor_attributes"
: { "name" : "Dan Tao", "company" : "Google", ... "email" : "
[email protected]
" } } { "_id" : ObjectId("5287d3e947e36f22805844b3") "actor_attributes" : { "name" : "Dan Tao", "company" : "Google", ... "email" : "
[email protected]
" } } { "_id" : ObjectId("5287d3e947e36f22805844c9") "actor_attributes" : { "name" : "Dan Tao", "company" : "Google", ... "email" : "
[email protected]
" } } Actor
{ "_id" : ObjectId("5287d41647e36f2280586033"), “repository" : {
"fork" : false, ... "name" : "breakneck" }, "actor" : "Sam", … "payload" : { "shas" : [ [ ... ] ], "ref" : "refs/heads/master", "size" : 1 } } Event { "_id" : ObjectId("5287d41647e36f2280586035"), “repository" : { "fork" : false, ... "name" : "breakneck" }, "actor" : "Tom", … "payload" : { "shas" : [ [ ... ] ], "ref" : "refs/heads/master", "size" : 1 } } { "_id" : ObjectId("5287d41647e36f2280586537"), “repository" : { "fork" : false, ... "name" : "breakneck" }, "actor" : "Mike", … "payload" : { "shas" : [ [ ... ] ], "ref" : "refs/heads/master", "size" : 1 } }
Summary No-SQL => No? No! Why No-SQL? CAP & BASE
MongoDB (Inc.) Schema design
How to Choose? Depending on your needs…
Thanks @liushuaikobe
Q & A http:/ /www.girlsgonestrong.com/video-qa/