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
Seedhack 2011 - Introducing MongoDB
Search
Russell Smith
April 20, 2012
Technology
1
77
Seedhack 2011 - Introducing MongoDB
Russell Smith
April 20, 2012
Tweet
Share
More Decks by Russell Smith
See All by Russell Smith
Ops Skills and Tools for Beginners [MongoDB World 2014]
ukd1
0
91
3 Infrastructure + workflow lessons from an early stage startup
ukd1
0
71
Bitcoin Ops & Security Primer
ukd1
1
120
Gearman & Kohana
ukd1
2
830
Geo & capped collections with MongoDB
ukd1
1
87
Cassandra London UG July 2011 - Riak vs Cassandra
ukd1
1
220
MongoDB - Map Reduce
ukd1
2
160
MongoDB London UG, April 2011 - MongoDB Introduction
ukd1
1
57
MongoDB London 2011 - MongoDB Command Line Tools
ukd1
1
130
Other Decks in Technology
See All in Technology
JAWS-UG Bedrock Claude Night
yamahiro
3
620
Tellus の衛星データを見てみよう #mf_fukuoka
kongmingstrap
0
230
GrafanaMeetup_AmazonManagedGrafanaのアクセス制御機能とマルチテナント環境下でのアクセス制御について
daitak
0
310
いいたいことちゃんという
tkengo
0
110
Grafana x PagerDuty Better Together
jacopen
0
160
Azureの基本的な権限管理の勉強会
yhana
0
940
Java EE/Jakarta EEの現状と将来―クラウドネイティブ時代にJava EEは対応できるのか?―
takakiyo
1
170
IaCジェネレーターとBedrockで詳細設計書を生成してみた
tsukasa_ishimaru
3
470
アクセシビリティを考慮したUI/CSSフレームワーク・ライブラリ選定
yajihum
2
1k
VS CodeでAWSを操作しよう
smt7174
8
1.8k
オーナーシップを持つ領域を明確にする
konifar
13
3.2k
競技としてのKaggle、役に立つKaggle
yu4u
5
2k
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
How GitHub (no longer) Works
holman
304
140k
KATA
mclloyd
15
12k
The Straight Up "How To Draw Better" Workshop
denniskardys
227
130k
Agile that works and the tools we love
rasmusluckow
325
20k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
Thoughts on Productivity
jonyablonski
58
3.8k
Six Lessons from altMBA
skipperchong
21
3k
The Mythical Team-Month
searls
216
42k
Imperfection Machines: The Place of Print at Facebook
scottboms
260
12k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
40
4.4k
Transcript
An introduction to MongoDB Russell Smith Friday, 20 April 12
/usr/bin/whoami • Russell Smith • Consultant for UKD1 Limited, •
External consultant for 10gen • Help with code, architecture, infrastructure, devops, sysops, capacity planning, etc • <3 MongoDB, MySQL, Redis, Gearman, Neo4j, Kohana, Riak, PHP, Debian, AWS, etc Friday, 20 April 12
What is MongoDB • A scalable, high-performance, open source, document-oriented
database. • Stores JSON like documents • Commercially backed by 10gen Friday, 20 April 12
Why choose it? • Schema-less • Simple • Reliable •
Scalable • Drivers Friday, 20 April 12
Who uses it? • Foursquare • Disney • Craigslist •
MTV Networks • O2 • Telefonica Friday, 20 April 12
Basics • insert • find • update • remove •
ensureIndex Friday, 20 April 12
Insert • db.test.insert({hello: ‘world’}); Friday, 20 April 12
Find • db.test.find() • Equivalent of SELECT * FROM test;
> db.test.insert({hello: ‘world’}); > db.test.find(); { "_id" : ObjectId("4e7c9f464bdd7534bc498ff7"), "hello" : "world" } Friday, 20 April 12
Updating • db.test.update(<condition>, <operation>) > db.test.find(); { "_id" : ObjectId("4e7c9f464bdd7534bc498ff7"),
"hello" : "world" } > db.test.update({hello:‘world’}, {hello: ‘seedhack’}); > db.test.find(); { "_id" : ObjectId("4e7c9f464bdd7534bc498ff7"), "hello" : "seedhack" } Friday, 20 April 12
Removing • db.test.remove(<condition>) > db.test.find(); { "_id" : ObjectId("4e7c9f464bdd7534bc498ff7"), "hello"
: "seedhack" } > db.test.remove({hello: ‘seedhack’}); > db.test.count() 0 > Friday, 20 April 12
Indexes • It’s usually a good idea to index your
collections • How and which columns depends on what you are doing • explain > db.test.ensureIndex({hello:1}) Friday, 20 April 12
More advanced • sort, count, limit, special operators • Capped
collections • Geospatial indexing • MapReduce • Replica sets • Sharding Friday, 20 April 12
Getting started... • Download & install - http://www.mongodb.org/downloads • Online
shell - http://www.mongodb.org/ Friday, 20 April 12
Questions / Further • Come and ask me questions •
Updates can also push, set, increment, decrement, etc http://bit.ly/gEfKOr • Indexes can be across multiple keys, 2D (geo) and ASC / DESC http://bit.ly/hpK68Q • SQL -> Mongo chart http://bit.ly/ig1Yfj Friday, 20 April 12