Quick overview of MongoDB

580 views

Published on

Here is the slides from the presentation I gave at the tech architecture meetup in cape town / codebridge - https://www.facebook.com/events/429242577096097/433182133368808/?notif_t=plan_mall_activity

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

No Downloads
Views
Total views
580
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
12
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Quick overview of MongoDB

  1. 1. MongoDB A quick overviewBrad - @darb – Dev/Ops manager, Motribe
  2. 2. Structure of my talkContext / How we are using MongoDBTerminology in MongoDB worldDeployment / GrowingThe things that suck
  3. 3. What we do - 3 web apps, 1 MongoDB cluster‧ Motribe - mobile social network ● ±50k monthly active users‧ JudgeMe – mxit social app ● 1m signups in 45 days / 200k+ photo uploads ● 0.5m - 3m pageviews/day‧ MxPix – mxit photo sharing app ● 200k+ signups in a week / 70k+ photo uploads ● 0.5m – 1m page views/day
  4. 4. MongoDB (from "humongous")‧ JSON Document storage‧ Documents are members of Collections‧ Collections belong to Databases‧ Indexes on any key in a document‧ Javascript interface for queries‧ Trivial Sharding of data
  5. 5. Some benefits‧ Implicit creation of databases, collections‧ Index and query anything inside document (composite keys, 2d/geo indexing)‧ Great documentation‧ Great examples (e.g. randomization)‧ Emphasis on Just Works™‧ Drivers in many languages‧ Active community
  6. 6. Grow up or out‧ Horizontal – read/write throughput ● Shard databases - split collections over shards ● Shard collections - split documents over shards‧ Vertical – read throughput ● Replica sets – Auto master / slaves, voting, promotion, demotion – Time delayed slaves – Magic... bring up mongo server, inform config server, siphons data
  7. 7. Moving parts at scale‧ Routers – “mongos” ● Abstract the magic, route requests to the right place ● Collate responses from shards, etc. ● Apps connect to “mongos”‧ Config servers ● Min 3x for redundancy ● Knows about dbs, shards, slaves
  8. 8. A picture
  9. 9. Monitoring‧ Mongo Monitoring Service (MMS) is lovely‧ JS console means you can do powerful things on the terminal‧ JS interface exposes lots of data ● Size of indexes ● Comprehensive info about where db/collections stored ● Location, status and health of nodes
  10. 10. The things that suck‧ Index anything means indexes can get large (e.g. we have 4gb of indexes on a big collection)‧ You need to aim to have all indexes+data in ram‧ MapReduce is available but meh ● Improving with each release, possible to hack onto hadoop
  11. 11. More of the things that suck‧ Implicit creation means mis-spelled dbs, collections == WTF‧ B-tree indexes mean queries/insertion by _id are O(log n) not O(1) ala pure key/value stores

×