Skip to content

Instantly share code, notes, and snippets.

@chrisjlee
Created March 22, 2012 17:44
Show Gist options
  • Save chrisjlee/2160765 to your computer and use it in GitHub Desktop.
Save chrisjlee/2160765 to your computer and use it in GitHub Desktop.
drupalcon denver 2012 - steve francia mongodb
mongodb - steve francia from 10gen (new york co)
uses native storage methods
useful for large storage
example blog
- mongo db using php
- mongodb doesn't need to convert to array
- just pass to connection object with array to collection object
- memcache -> query one dimension
- multi dimension and multivalue
Problems with current databases
- converting database from arrays
- no need to convert
- learning curve is issue
- no need for joins
Nice features
- support ad hoc query - no need to require indexes
- one document
- query language is intuitive
- no need for external connectors
pain points
- rarely need to use joins
- no foreign key integrity
- doesn't support
- sql is great for aggregation - sql has methods add etc
pipeline
- bunch of simple things
- notion of using command line
- e.g. pipeline method -> grep | etc
- used for aggregation methods
- don't use group
- aggregation framework runs faster than map produce
Cassandra vs mongodb
- useful for loggin - bread and butter
- cassandra optimized for insert
- cassandra used in parralel with other technologies
- several use cases
couchdb vs mongodb
- doesn't have sharding
- ubuntu -> blog post about not using couch
- not used for scaling
- general purpose database
indexes
- memcache wouldn't give performance boost on query
- mongodb uses indexes as well; same benefits
- don't query from index - takes longer
- with mdb you can use disk
- mdb allows you to index arrays of values
mongodb and scalability
- doubleclick displays lots of ads and record all images and clicks
- sharding natively - replication provides high availability
- possible to go single node to sharded without changing application
100% no room to allow it. must have memory to be able to do this
- 80% peak good part to provide read
- determine shard key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment