Lean and mean MongoDB

Post on 13-Jan-2015

1,268 views 0 download

Tags:

description

Why MongoDB is a good fit for startups.

transcript

Lean and mean MongoDBor why MongoDB is good for start ups

/whois olegp

/whois olegp

● doing startups since 2000– RIOT-E

● tech DD for investors since 2008 ● Startup Sauna coach● new venture: StartHQ

Web apps 101

Web apps 101

● REST API centric design● One primary data store

– Except blobs

● No premature optimization– e.g. caching

The Contenders

Background Reading

● “How FriendFeed uses MySQL to store schemaless data”– “mariadb dynamic columns”

● “PostgreSQL as a schemaless database”

The Pros

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

Hosting

● Amazon RDS: from $18 ● Heroku Postgres: from $10● MongoHQ & MongoLab: from FREE

Database as a Service

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

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 }; });

Tools

● 10gen MMS● Metrica● Nodetime

Getting Started

Getting Started

● try.mongodb.org● “dailyjs lmaw”● olegp/notes & olegp/tokenize

Summary

● Optimize for ease of development● Do design your schema● Do not prematurely optimize● Have fun!

Thanks!

@olegpodsechin

starthq.com/apps/?q=mongodb