Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
The things I've seen, living with MongoDB
Bradley Whittington
October 03, 2013
Technology
0
94
The things I've seen, living with MongoDB
A short talk through some of the lessons learned about MongoDB at Motribe and Mxit
Bradley Whittington
October 03, 2013
Tweet
Share
More Decks by Bradley Whittington
See All by Bradley Whittington
Black Friday 2017 talk at Cape Town DevOps meetup
bradwhittington
0
15
Let's talk about Git
bradwhittington
0
51
Doing something new in an existing company culture
bradwhittington
0
100
Load Balancing 101
bradwhittington
1
450
Agile-ish is good enough
bradwhittington
1
380
PHP Addiction - or, teach someone about python
bradwhittington
2
600
Quick overview of MongoDB
bradwhittington
0
48
Other Decks in Technology
See All in Technology
セキュキャンを卒業してその後
kurochan
0
600
DMMプラットフォーム ゼロから始めるKubernetes運用 課題と改善
pospome
0
420
ログ集約基盤をCloudWatchからOpenSearchに変えてみた
yuhta28
0
140
ECS on EC2 で Auto Scaling やってみる!
sayjoy
1
280
DevRel組織についての考察
taijihagino
PRO
0
150
ログラスを支える技術的投資の仕組み / loglass-technical-investment
urmot
9
2k
テクニカルライティングの検定を受けてみた話 / "My Story About Taking the Technical Writing Exam
line_developers
PRO
1
220
MySQL v5.7 勉強会/study-mysql-ver-5-7
andpad
0
2.1k
セキュリティ・キャンプ全国大会2022 企業紹介イベント/seccamp2022-nikkei
nikkei_engineer_recruiting
0
140
ReverseETLでユーザーに価値を届ける基盤を実現した話
hakky
0
360
セキュアなTerraformの使い方 ~ 機密情報をコードに含めず環境構築するにはどうしたらいいの?
harukasakihara
9
1.6k
Oblivious Online Monitoring for Safety LTL Specification via Fully Homomorphic Encryption
anqou
1
410
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
19
3.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
7
1.1k
Docker and Python
trallard
27
1.6k
How GitHub (no longer) Works
holman
297
140k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
37
3.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
269
12k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
100
6k
A designer walks into a library…
pauljervisheath
196
16k
4 Signs Your Business is Dying
shpigford
169
20k
Bootstrapping a Software Product
garrettdimon
296
110k
Writing Fast Ruby
sferik
612
57k
Raft: Consensus for Rubyists
vanstee
127
5.5k
Transcript
The things I’ve seen, living with MongoDB Brad Whittington VP
web products - Mxit
What we use MongoDB for Primary data store for a
few consumer products. Motribe mobile social network - JudgeME & MxPix Mxit Launch
JudgeMe
None
Polytechnical university of hardknocks 1 week into my new job…
Zero MongoDB experience Massive crashes and timeouts on our cluster Hundreds of requests per minute
MongoDB docs == MongoDB + EC2 =
db.serverStatus() rs.add(...) MMS
MongoSQL? Mongo is *not* a relational database This is bad:
{ _id:... friend_id:... user_id:... }
The Data is Hot If you can’t fit all your
data in RAM, make sure you are kind to your (network connected) hard drives. Reads from (networked) disks are (incredibly) slow.
sort by rand() limit 1 MongoDB is all… One Solution!
(see the help pages for more) Add random geospatial positions Geospatial indexing Query for objects near [x,y] Disks are all like
I wish we had Capped Arrays*... Database with Capped Collections.Totally
okay. For the first n00 000 collections. Then it’s a bad idea. A very bad idea. * Available in MongoDB 2.4
A fresh start. Mxit Launch Platform for app creation Aim
for ±single document per request Cache cleverly, aggressively Database per app 300 authors 9M pageviews/month 2M unique users 4 m1.small 1 amazon core, 1.7GB ram
A fresh lesson Doing ensureIndex(..., {background:true}) inline in the request
is sub-optimal. 60 indexing processes 3M document collection (not fully in RAM) Not ideal.
db.currentOp() db.killOp() db.repair() db.currentOp().inprog.forEach( function(d){ if(d.waitingForLock && d.lockType != "read")
printjson(d) })
MongoDB Love • Mongo terminal is JS • Recovery is
quick, easy • Sharding is easy • Indexes are lovely • Be careful in your architecture / queries. Pure index queries are ++ • MongoDB is not a Relational DB
Read http://aphyr.com/tags/jepsen Aphyr / Jepsen / Call me maybe
@darb github.com/bradwhittington speakerdeck.com/u/bradwhittington/ Questions?