Using Mongo At Shopwiki
Upcoming SlideShare
Loading in...5
×
 

Using Mongo At Shopwiki

on

  • 3,651 views

Presentation by Avery Rosen, CTO of ShopWiki.com, on how MongoDB is being used all over their enterprise.

Presentation by Avery Rosen, CTO of ShopWiki.com, on how MongoDB is being used all over their enterprise.

Statistics

Views

Total Views
3,651
Views on SlideShare
3,160
Embed Views
491

Actions

Likes
3
Downloads
38
Comments
0

5 Embeds 491

http://devblog.shopwiki.com 446
http://www.slideshare.net 32
http://lanyrd.com 7
http://swdev.tumblr.com 5
http://www.tumblr.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • Shopping search engine; crawl the web using AI to aggregate; add data feeds; in-memory search; web front-end <br />
  • relationship with founders, opportunity, Eliot: final project together, I was playing with QT he wrote a DB and network protocol. Dwight wrote the adserver, code I became highly familiar with on the adserver team. <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • Largest, write-only <br />
  • highly utilized <br />
  • perfect for document oriented architecture, same format as we use to eventually index <br />
  • browse structure for consumers and SEO, daily updates, live access, cached in front-end <br />
  • historical note: doubleclick&#x2019;s imageserver. no brainer to convert backend to avoid maintenance overhead <br />
  • Prototype: schema extensible, no need for table alters, as in visit table; JSON instead of ORM; joins can be ugly and unpredictable <br />
  • Prototype: schema extensible, no need for table alters, as in visit table; JSON instead of ORM; joins can be ugly and unpredictable <br />
  • Prototype: schema extensible, no need for table alters, as in visit table; JSON instead of ORM; joins can be ugly and unpredictable <br />
  • Prototype: schema extensible, no need for table alters, as in visit table; JSON instead of ORM; joins can be ugly and unpredictable <br />
  • Many to many joins are missing, but you might not miss them. Storage is cheap, although has consequences for replication; correct for typos with testing <br />
  • <br />
  • denormalization, but storage is cheap <br />
  • denormalization, but storage is cheap <br />
  • date functions missing <br />
  • with document, can key on alerting, no hunting for last_good_count <br />
  • it&#x2019;s easy to roll out code without indices; ext3 is just terrible; big data, 10% of empty too much, custom oplog size, too small; some people using false-ORM to minify attribute labels <br />
  • it&#x2019;s easy to roll out code without indices; ext3 is just terrible; big data, 10% of empty too much, custom oplog size, too small; some people using false-ORM to minify attribute labels <br />
  • it&#x2019;s easy to roll out code without indices; ext3 is just terrible; big data, 10% of empty too much, custom oplog size, too small; some people using false-ORM to minify attribute labels <br />
  • it&#x2019;s easy to roll out code without indices; ext3 is just terrible; big data, 10% of empty too much, custom oplog size, too small; some people using false-ORM to minify attribute labels <br />
  • <br />

Using Mongo At Shopwiki Using Mongo At Shopwiki Presentation Transcript

  • MongoDB @ShopWiki.com our swiss-army datastore
  • Overview Introductions Uses at ShopWiki Benefits and Tradeoffs Gotchas
  • ShopWiki - what we do
  • MongoDB Founder Pedigree
  • Uses at ShopWiki
  • Uses at ShopWiki Site Visit Analytics
  • Uses at ShopWiki Site Visit Analytics Datafeeds
  • Uses at ShopWiki Site Visit Analytics Datafeeds Site Browsers
  • Uses at ShopWiki Site Visit Analytics Datafeeds Site Browsers Image/Thumbnail Server
  • Uses at ShopWiki Site Visit Analytics Datafeeds Site Browsers Image/Thumbnail Server One-offs of All Kinds
  • Visit Analytics - contents Data Size Total On Disk: 869GB Largest collection: count : 88729347 items size : 165GB totalIndexSize : 18GB
  • Visit Analytics - usage Typical inserts/s query/s update/s delete/s getmore/s locked % conn 222 133 284 0 2 11% 738 Use spike inserts/s query/s update/s delete/s getmore/s locked % conn 710 420 654 0 9 10% 650
  • Datafeeds { ProductID : 2309, Title : “Elephant Leash”, Brand : “Acme”, Price : 49.99, Breadcrumbs : [ “Pets”, “Exotic”, “Accessories” ], Description : “Horton will love this stylish and functional leash, and you won’t violate any local statutes when you walk around with the Acme Elephant Leash!” }
  • Site-Browsing Datastore
  • Image/Thumbnail Server Before: custom append-only datastore After: MongoDB all the way!
  • Benefits
  • Benefits Prototype to Production, always extensible
  • Benefits Prototype to Production, always extensible JSON objects > ORM
  • Benefits Prototype to Production, always extensible JSON objects > ORM No joins in code
  • Benefits Prototype to Production, always extensible JSON objects > ORM No joins in code One-Button Replication
  • Tradeoffs No “DESCRIBE” (use indices instead) Denormalization: Storage and Replication Date handling Typos mean schema corruption
  • Many-to-many NodeID Color Shape ProductID Feel Temp 890 Purple Round 98 Soft 50 1039 Brown Square 202 Hard 98 6029 Brown Triangle 451 Squishy 102 NodeID ProductID 890 202 890 98 6029 451 1039 451
  • Inverted List Pairs { NodeID : 890, Products : [ 202, 98 ], Color : "Purple", Shape : "Round" }, { NodeID : 6029, Products : [ 451 ], Color : "Brown", Shape : "Triangle" }, etc...
  • Inverted List Pairs { NodeID : 890, Products : [ 202, 98 ], Color : "Purple", Shape : "Round" }, { NodeID : 6029, Products : [ 451 ], Color : "Brown", Shape : "Triangle" }, etc... YOUR CODE HERE
  • Inverted List Pairs { NodeID : 890, Products : [ 202, 98 ], Color : "Purple", Shape : "Round" }, { NodeID : 6029, Products : [ 451 ], Color : "Brown", Shape : "Triangle" }, etc... YOUR CODE HERE { ProductID : 451, BrowseNodes : [ 6029, 1039 ], Feel : "Squishy", Temp : 102 }, { ProductID : 202, BrowseNodes : [ 890 ], Feel : "Hard", Temp : 98 }, etc...
  • Datafeed alerting, RDB No “INTERVAL 1 DAY” Feed status feed offer_count site_id date Alerts feed offer_count site_id date ack fix_target
  • Datafeed alerting, Mongo No joins, selects... index sub-objects { feed, offer_count, site_id, date, alert : [ status, time, etc...], last_good_count }
  • Gotchas
  • Gotchas Prototype to Production: ensureIndex() is cheap
  • Gotchas Prototype to Production: ensureIndex() is cheap ext3 -- banished from the land
  • Gotchas Prototype to Production: ensureIndex() is cheap ext3 -- banished from the land oplog size for replication
  • Gotchas Prototype to Production: ensureIndex() is cheap ext3 -- banished from the land oplog size for replication {number_of_times_the_user_clicked : 1}
  • AFTER PARTY @SLATE SPECIAL THANKS TO GILT FOR SPONSORING 54 WEST 21st STREET