MongoDB Part 2

1,851 views
1,787 views

Published on

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

  • Be the first to like this

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

No notes for slide

MongoDB Part 2

  1. 1. MongoDB Part II
  2. 2. Admin UIThere are a number of open source projects that provide anadmin console to your MongoDB instances.Some are web UI and some are native UI applications.  MongoHub is a native Mac OS app that has many great bells and whistles (my personal fav) MongoVUE is a native Windows .NET Many Ruby web based apps that run using Sinatra and MongoDB driver (Futon4Mongo, Mongo3, etc)
  3. 3. MongoHub detailsRetail time CRUD operations monitoringMulti-database viewsDetailed collection viewsInteractive queryingMySQL Import / Export
  4. 4. Monitoring and DiagnosticsThe newer versions on MongoDB come with  mongostat sudo mongosniff --source NET lo0Could be straight forward to hook up custom Nagiosalerts and monitoring with this data
  5. 5. ReplicationOld way < 1.6 New way >= 1.6
  6. 6. How it all worksMongoDB has a primary node who does the writesThe data is then replicated to the rest of the setMongoDB has auto fail-over so if the current primarypukes, then another node is "elected"A write is theoretically complete when a "majority" ofthe nodes in the set received the data ma·jor·i·ty noun mə-ˈjor-ə-tē In MongoDB terms it means there is at least 1 primary and at least 1 other node running If only 1 node is left standing...well that sucks
  7. 7. The Ugly TruthIf a node fails-over during replication and all the nodeshavent received it...The data drops ;..(
  8. 8. MongoDB Make Believe Land Node 2 Node 3
  9. 9. MongoDB Make Believe Land Node 2 Node 3
  10. 10. MongoDB Make Believe Land Node 2 Node 3
  11. 11. MongoDB Make Believe Land Node 2 Node 3
  12. 12. How do I set that up?Well, its super hard... ...NOT to do it rightI <3 MongoDB documentation http://www.mongodb. org/display/DOCS/Replica+Set+TutorialYou can also do N nodes and 1 arbiter, where N % 2 == 0
  13. 13. "Shards are the secret sauce..."
  14. 14. I just shar(d|t)ed
  15. 15. Shards Shard 2Shard 1 Node 2 Node 3
  16. 16. Choose wisely!> When sharding you mustchoose your shard key wiselyfor an even distribution of loadand data> Its best to choose compositeshard keys and determine themost common queries> Helps ensure your querytargets a single shard vs.querying ALL shards
  17. 17. Map / Reduce
  18. 18. Map / Reduce> You can write map/reducefunctions in the shell and withany of the supported MongoDBdrivers
  19. 19. Logging with MongoDBGot this link from the MongoDBmeetup at Engine Yard this pastweek.Thanks to Robert Stewart forthe great presentation:http://www.slideshare.net/WombatNation/logging-app-behavior-to-mongo-db

×