2011 08-16 MongoNYC
-
Upload
daniel-doubrovkine -
Category
Technology
-
view
1.626 -
download
2
description
Transcript of 2011 08-16 MongoNYC
![Page 1: 2011 08-16 MongoNYC](https://reader036.fdocuments.in/reader036/viewer/2022081414/5495bc5cac795925288b50dc/html5/thumbnails/1.jpg)
T U E S D AY, A U G U S T 1 6 T H , 2 0 1 1
Happiness is MongoDB
Daniel Doubrovkine (dB.) | @dblockdotorg | http://art.sy
![Page 2: 2011 08-16 MongoNYC](https://reader036.fdocuments.in/reader036/viewer/2022081414/5495bc5cac795925288b50dc/html5/thumbnails/2.jpg)
Art Genome Project
Kasimir Malevich – “Self Portrait” - vs. - William Beckman – “Self Portrait”
![Page 3: 2011 08-16 MongoNYC](https://reader036.fdocuments.in/reader036/viewer/2022081414/5495bc5cac795925288b50dc/html5/thumbnails/3.jpg)
Nearest Neighbor Search in High-Dimensional Space
𝑑=√(100−40)2+(0−100)2+…+(0−60)2
Euclidean Distance
artworks.each { |a2| d = euclidean(a1, a2)}.sort by |d|
![Page 4: 2011 08-16 MongoNYC](https://reader036.fdocuments.in/reader036/viewer/2022081414/5495bc5cac795925288b50dc/html5/thumbnails/4.jpg)
MySQL Prototype: Schema
![Page 5: 2011 08-16 MongoNYC](https://reader036.fdocuments.in/reader036/viewer/2022081414/5495bc5cac795925288b50dc/html5/thumbnails/5.jpg)
MySQL Prototype: Schema
• Need a sorted vector of values, including zeroes: [ 100, 0, 20, … 60 ] on boot
Annoying …10K artworks: 5 minutes to startup
… accomplishes nothing.
![Page 6: 2011 08-16 MongoNYC](https://reader036.fdocuments.in/reader036/viewer/2022081414/5495bc5cac795925288b50dc/html5/thumbnails/6.jpg)
MongoDB
Genome.genes – it’s a hash!{ “Career Stage” => 100, …, “Conceptual” => 20 }
Genome, Embedded in Artwork
Locality Sensitive Hashing
![Page 7: 2011 08-16 MongoNYC](https://reader036.fdocuments.in/reader036/viewer/2022081414/5495bc5cac795925288b50dc/html5/thumbnails/7.jpg)
Choosing MongoDB
Got (too) many years of experience with *SQL / DW
@harryh uses it @ 4sq@eliothorowitz looks pretty smartdb.startups.find(
{ location : { $near : GA }, category : ‘nosql database vendor' } ).first = 10gen
install … ? … profitavailable on Heroku from MongoHQmuch better for continuous deployment
![Page 8: 2011 08-16 MongoNYC](https://reader036.fdocuments.in/reader036/viewer/2022081414/5495bc5cac795925288b50dc/html5/thumbnails/8.jpg)
Tidbits
MongoDB retrieval by ID is as fast, if not faster, than Ruby Hash Using Rails + Rake and Mongo is safer than mongo shell
db.collection.update({x: y})
Shared Hosting is not Rubber, You Can’t Stretch It Map/reduce for live queries really doesn’t work, no really
mongoid_fulltext
Read-secondary + Map/Reduce can be fun read_secondary: <%= $rails_rake_task.nil? or !$rails_rake_task %>
Collection names are limited in length if you use mongodumphttps://jira.mongodb.org/browse/SERVER-2973
copyDatabase requires administrative privilegeshttps://jira.mongodb.org/browse/SERVER-2846
Mongo cursors aren’t snapshotted by defaultProcessing 5183 of 4012 …http://www.mongodb.org/display/DOCS/How+to+do+Snapshotted+Queries+in+the+Mongo+Database
Mongo Interest is growing, RoR + MongoId = GTDhttp://code.dblock.org/ror-win-getting-things-done-with-mongodb-mongoid
![Page 9: 2011 08-16 MongoNYC](https://reader036.fdocuments.in/reader036/viewer/2022081414/5495bc5cac795925288b50dc/html5/thumbnails/9.jpg)
Dev/Staging/Production
MongoHQ Extensions via Heroku Production Directly w/MongoHQ
A Few Hundred Bucks / mo. Mongo 1.8.1 w/ replica sets, 2 DBs and 1 arbiter Different Availability Zones Dedicated RAM, separate EBS, shared CPU Early Issues, Now Very Stable Jason McCay + other folks @ MongoHQ = Awesome
Mongoid 2.0.2
mongoid_slug mongoid_fulltext mongoid_history delayed_job_mongoid
![Page 10: 2011 08-16 MongoNYC](https://reader036.fdocuments.in/reader036/viewer/2022081414/5495bc5cac795925288b50dc/html5/thumbnails/10.jpg)
name: Daniel Doubrovkine (aka. dB.)
company: http://art.sy ^ work here
twitter: @dblockdotorg blog: http://code.dblock.org ^ link to slides here
email: [email protected]
We *heart* MongoDB