2011 08-16 MongoNYC

1,870 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,870
On SlideShare
0
From Embeds
0
Number of Embeds
208
Actions
Shares
0
Downloads
15
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

2011 08-16 MongoNYC

  1. 1. Happiness isMongoDB<br />Tuesday, august16th, 2011<br />Daniel Doubrovkine (dB.) | @dblockdotorg | http://art.sy<br />
  2. 2. Art Genome Project<br />Kasimir Malevich – “Self Portrait” - vs. - William Beckman – “Self Portrait”<br />
  3. 3. Nearest Neighbor Search in High-Dimensional Space<br />Euclidean Distance<br />artworks.each { |a2|<br /> d = euclidean(a1, a2)<br />}.sort by |d|<br />𝑑=(100−40)2+(0−100)2+…+(0−60)2<br /> <br />
  4. 4. MySQL Prototype: Schema<br />
  5. 5. MySQL Prototype: Schema<br /><ul><li>Need a sorted vector of values, including zeroes: [ 100, 0, 20, … 60 ] on boot</li></ul>Annoying …<br />10K artworks: 5 minutes to startup<br />… accomplishes nothing.<br />
  6. 6. MongoDB<br />Genome.genes – it’s a hash!<br />{ “Career Stage” => 100, …, “Conceptual” => 20 }<br />Genome, Embedded in Artwork<br />Locality Sensitive Hashing<br />
  7. 7. Choosing MongoDB<br />Got (too) many years of experience with *SQL / DW<br />@harryh uses it @ 4sq<br />@eliothorowitzlooks pretty smart<br />db.startups.find({ location : { $near : GA }, category : ‘nosql database vendor' } ).first = 10gen<br />install … ? … profit<br />available on Heroku from MongoHQ<br />much better for continuous deployment<br />
  8. 8. Tidbits<br />MongoDB retrieval by ID is as fast, if not faster, than Ruby Hash<br />Using Rails + Rake and Mongo is safer than mongo shell db.collection.update({x: y})<br />Shared Hosting is not Rubber, You Can’t Stretch It<br />Map/reduce for live queries really doesn’t work, no reallymongoid_fulltext<br />Read-secondary + Map/Reduce can be fun read_secondary: <%= $rails_rake_task.nil? or !$rails_rake_task %><br />Collection names are limited in length if you use mongodumphttps://jira.mongodb.org/browse/SERVER-2973<br />copyDatabase requires administrative privilegeshttps://jira.mongodb.org/browse/SERVER-2846<br />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<br />Mongo Interest is growing, RoR + MongoId = GTDhttp://code.dblock.org/ror-win-getting-things-done-with-mongodb-mongoid<br />
  9. 9. Dev/Staging/Production<br />MongoHQ Extensions via Heroku<br />Production Directly w/MongoHQ<br />A Few Hundred Bucks / mo.<br />Mongo 1.8.1 w/ replica sets, 2 DBs and 1 arbiter<br />Different Availability Zones<br />Dedicated RAM, separate EBS, shared CPU<br />Early Issues, Now Very Stable<br />Jason McCay + other folks @ MongoHQ= Awesome<br />Mongoid2.0.2<br />mongoid_slug<br />mongoid_fulltext<br />mongoid_history<br />delayed_job_mongoid<br />
  10. 10. We *heart* MongoDB<br /> name: Daniel Doubrovkine(aka. dB.)<br />company: http://art.sy<br />^work here twitter:@dblockdotorg<br /> blog: http://code.dblock.org ^link to slides here<br /> email: dblock@dblock.org<br />

×