Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
MongoDB 101
Search
Nick Jackson
May 07, 2012
Technology
130
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
MongoDB 101
A crash course on MongoDB I gave to attendees at the JISC MRD Hackday organised by DevCSI.
Nick Jackson
May 07, 2012
More Decks by Nick Jackson
See All by Nick Jackson
It's all about the data.
jacksonj04
0
97
Development Tools
jacksonj04
0
120
Eating Your Own Dog Food
jacksonj04
0
360
LNCD and The Cloud
jacksonj04
0
130
OAuth 101
jacksonj04
3
380
API Driven Development
jacksonj04
0
230
We Can Haz Ur Datas?!
jacksonj04
0
360
Universal Search at Lincoln
jacksonj04
0
58
Jerome Overview
jacksonj04
0
61
Other Decks in Technology
See All in Technology
子育てエンジニアの可処分時間が減っても成長を諦めない戦い方
sudoakiy
6
4.6k
スキマバイトという雇用形態は存在しないので、雇用期間1日のアルバイト契約を事業者とワーカーが結ぶ手続きを支えるのがタイミーなんです
akitoshiga
0
180
サブエージェントと Claude Mods で作る独自 Advisor ツールの話
kenichiodo
2
150
AI × アーキテクト 第1・2章|生成AIの課題とアーキテクトの素養
daidaidai
0
130
AIは「聞けば答える」から「任せると自分で進める」へ - JACTIMペナン地域部会・ペナン三水会講演
knishioka
0
110
AI駆動開発の時代になったのでトヨタ生産方式から見直す
terurou
7
6k
Snapshot Testing in Practice: Predictable and Reliable SwiftUI Views
fespinoza
0
220
DevelopersIO 2026 知識の地図を描く ─ オントロジーとは何か?
ishikawa_satoru
1
1.6k
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
110
Cognition AI Japan - ウェビナー2_テストQA_運用監視
cogakira
0
140
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
1
1.8k
大型犬好きによるPugの紹介
yamanoku
1
150
Featured
See All Featured
The Language of Interfaces
destraynor
162
27k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
310
Making Projects Easy
brettharned
120
6.8k
We Have a Design System, Now What?
morganepeng
55
8.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
Automating Front-end Workflow
addyosmani
1369
210k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Un-Boring Meetings
codingconduct
0
450
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Statistics for Hackers
jakevdp
799
230k
Transcript
MongoDB 101
I am... • Nick Jackson • Awesome Developer Dude •
University of Lincoln • @jacksonj04
MongoDB Is... • A NoSQL document database.
Eh?
NoSQL • Is not a specification (unlike SQL). • (Generally)
doesn’t have schemas. • (Generally) works at web-scale. • (Generally) doesn’t do relational integrity.
Document Databases • Store documents. • Don’t store key-value pairs.
• Make building APIs and stuff really easy.
Ye Olde SQL id name email 1 Nick
[email protected]
2
Joss
[email protected]
Ye Olde SQL id name email office building 1 Nick
... 3107 MHT 2 Joss ... 3015 MHT 3 Harry ... NULL MHT
:-(
Documents: Awesome! { name: ‘Nick’, email: ‘
[email protected]
’, location: { office:
‘3105’, building: ‘MHT’ } }
Documents: Awesome! { name: ‘Harry’, email: ‘
[email protected]
’ }
Documents: Awesome! { name: ‘Joss’, email: ‘
[email protected]
’, location: { office:
‘3105’, building: ‘MHT’ }, likes: { music: [‘Folk’, ‘Hip-Hop’], drink: [‘Coffee’, ‘Ale’] } }
Servers Are Easy
On Its Own Mongo App
Replicated Mongo 1 Mongo 2 Mongo 3 App
Sharded App Router 1 Router 2 Mongo S1 Mongo S2
Mongo S3
http://mongodb.org
Inserts <3 JSON > db.people.save({name:'Nick'}) > db.people.save({name:'Joss'}) > db.people.save({name:'Harry'})
Query Be Simple... > db.people.find() { "_id" : ObjectId("4fa...103"), "name"
: "Nick" } { "_id" : ObjectId("4fa...104"), "name" : "Joss" } { "_id" : ObjectId("4fa...105"), "name" : "Harry" }
Query Be Simple... > db.people.find({name:'Nick'}) { "_id" : ObjectId("4fa...103"), "name"
: "Nick" }
Query Be Quick... > db.people.ensureIndex({name:1})
Updates are easy > db.people.update({name:'Nick'},{name:'Nick',likes: ['coffee']}) > db.people.find({name:'Nick'}) { "_id"
: ObjectId("4fa...103"), "name" : "Nick", "likes" : [ "coffee" ] }
Queries are powerful > db.people.update({name:'Joss'},{name:'Joss',likes: ['coffee','folk music']}) > db.people.find({likes:'coffee'}) {
"_id" : ObjectId("4fa...103"), "name" : "Nick", "likes" : [ "coffee" ] } { "_id" : ObjectId("4fa...104"), "name" : "Joss", "likes" : [ "coffee", "folk music" ] }
Deletes are also easy > db.people.remove({name:'Nick'}) > db.people.find() { "_id"
: ObjectId("4fa...104"), "name" : "Joss", "likes" : [ "coffee", "folk music" ] } { "_id" : ObjectId("4fa...105"), "name" : "Harry" }
Cool Things! • Geospatial indexes. db.places.find({loc:{$near:[-2, 53]}}) • JavaScript in
the Mongo shell. • Map/Reduce operations. • Can be used as a filesystem.
Downsides It has a few
It’s not ACID • Set of atomic operators, but no
things like transactions. • No enforced consistency. At all. • No locking, so updates can collide and be lost. • Disk writes are (usually) deferred, so data can be lost in failures.
It’s not ‘Enterprise’ • Your DBAs will find it new
and scary. • You need to un-learn a lot of the SQL mindset. • It’s not seen as ‘proven’, but this is generally rubbish.
Some MongoDB Users • Craigslist • MTV • SourceForge •
Disney • National Archives • HM Government • The Guardian • New York Times • bit.ly • GitHub • Foursquare • http://lncn.eu/fhx5