Lean and mean MongoDB
-
Upload
oleg-podsechin -
Category
Documents
-
view
1.268 -
download
0
description
Transcript of Lean and mean MongoDB
![Page 1: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/1.jpg)
Lean and mean MongoDBor why MongoDB is good for start ups
![Page 2: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/2.jpg)
/whois olegp
![Page 3: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/3.jpg)
![Page 4: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/4.jpg)
/whois olegp
● doing startups since 2000– RIOT-E
● tech DD for investors since 2008 ● Startup Sauna coach● new venture: StartHQ
![Page 5: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/5.jpg)
Web apps 101
![Page 6: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/6.jpg)
![Page 7: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/7.jpg)
Web apps 101
● REST API centric design● One primary data store
– Except blobs
● No premature optimization– e.g. caching
![Page 8: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/8.jpg)
The Contenders
![Page 9: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/9.jpg)
![Page 10: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/10.jpg)
Background Reading
● “How FriendFeed uses MySQL to store schemaless data”– “mariadb dynamic columns”
● “PostgreSQL as a schemaless database”
![Page 11: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/11.jpg)
The Pros
![Page 12: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/12.jpg)
![Page 13: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/13.jpg)
The Pros
● Simpler schema design– Fewer many to one relationships
– Design is part of development, not separate
● No DB setup step● No DB migrations *● No ORMs● JSON as query language
![Page 14: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/14.jpg)
![Page 15: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/15.jpg)
Hosting
● Amazon RDS: from $18 ● Heroku Postgres: from $10● MongoHQ & MongoLab: from FREE
![Page 16: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/16.jpg)
Database as a Service
![Page 17: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/17.jpg)
![Page 18: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/18.jpg)
Database as a Service
● Web admin FTW– Saves you building your own
● No SSL– But on AWS you can't sniff traffic
● Expensive backups– But you can easily roll your own
![Page 19: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/19.jpg)
Some Code
return db.getCollection("apps").find({ nameLowerCase:{ $regex:utils.prettify(request.queryParams.term) }, verified:true }, { name:true, url:true }).sort({'extractors.social.score':-1}) .limit(10).toArray().map(function(app) { return { label:app.name, value:app.url }; });
![Page 20: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/20.jpg)
Tools
● 10gen MMS● Metrica● Nodetime
![Page 21: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/21.jpg)
Getting Started
![Page 22: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/22.jpg)
![Page 23: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/23.jpg)
Getting Started
● try.mongodb.org● “dailyjs lmaw”● olegp/notes & olegp/tokenize
![Page 24: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/24.jpg)
Summary
● Optimize for ease of development● Do design your schema● Do not prematurely optimize● Have fun!
![Page 25: Lean and mean MongoDB](https://reader034.fdocuments.us/reader034/viewer/2022051313/54b47b554a7959266d8b459d/html5/thumbnails/25.jpg)
Thanks!
@olegpodsechin
starthq.com/apps/?q=mongodb