SlideShare a Scribd company logo
MongoDB

 Part II
Admin UI

There are a number of open source projects that provide an
admin 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)
MongoHub details

Retail time CRUD operations monitoring
Multi-database views
Detailed collection views
Interactive querying
MySQL Import / Export
Monitoring and Diagnostics

The newer versions on MongoDB come with 
   mongostat
   sudo mongosniff --source NET lo0
Could be straight forward to hook up custom Nagios
alerts and monitoring with this data
Replication
Old way < 1.6                 New way >= 1.6
How it all works

MongoDB has a primary node who does the writes
The data is then replicated to the rest of the set
MongoDB has auto fail-over so if the current primary
pukes, then another node is "elected"
A write is theoretically complete when a "majority" of
the 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
The Ugly Truth

If a node fails-over during replication and all the nodes
haven't received it...
The data drops ;..(
MongoDB Make Believe Land




      Node 2   Node 3
MongoDB Make Believe Land




      Node 2   Node 3
MongoDB Make Believe Land




      Node 2   Node 3
MongoDB Make Believe Land




      Node 2   Node 3
How do I set that up?
Well, its super hard...
   ...NOT to do it right
I <3 MongoDB documentation
   http://www.mongodb.
   org/display/DOCS/Replica+Set+Tutorial
You can also do N nodes and 1 arbiter, where N % 2 == 0
"Shards are the secret sauce..."
I just shar(d|t)ed
Shards


                            Shard 2
Shard 1




          Node 2   Node 3
Choose wisely!

> When sharding you must
choose your shard key wisely
for an even distribution of load
and data
> It's best to choose composite
shard keys and determine the
most common queries
> Helps ensure your query
targets a single shard vs.
querying ALL shards
Map / Reduce
Map / Reduce

> You can write map/reduce
functions in the shell and with
any of the supported MongoDB
drivers
Logging with MongoDB

Got this link from the MongoDB
meetup at Engine Yard this past
week.

Thanks to Robert Stewart for
the great presentation:

http://www.slideshare.
net/WombatNation/logging-
app-behavior-to-mongo-db

More Related Content

Similar to MongoDB Part 2 (20)

DOCX
MongoDB Replication and Sharding
Tharun Srinivasa
 
PPTX
Get expertise with mongo db
Amit Thakkar
 
PPTX
Python mongo db-training-europython-2011
Andreas Jung
 
PPTX
Conceptos básicos. Seminario web 6: Despliegue de producción
MongoDB
 
PDF
OSDC 2012 | Scaling with MongoDB by Ross Lawley
NETWAYS
 
PPTX
Scaling with MongoDB
MongoDB
 
PPTX
Getting started with replica set in MongoDB
Kishor Parkhe
 
PPTX
Back to Basics: Build Something Big With MongoDB
MongoDB
 
PPTX
Back to Basics Spanish Webinar 3 - Introducción a los replica sets
MongoDB
 
PPTX
Back tobasicswebinar part6-rev.
MongoDB
 
PPTX
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
MongoDB
 
PPT
High Availabiltity & Replica Sets with mongoDB
Gareth Davies
 
PPTX
MongoDB 3.0
Victoria Malaya
 
PDF
MongoDB - An Introduction
sethfloydjr
 
ODP
MongoDB: Advance concepts - Replication and Sharding
Knoldus Inc.
 
PPT
Mongo db roma replication and sharding
Guglielmo Incisa Di Camerana
 
PPT
2011 mongo FR - scaling with mongodb
antoinegirbal
 
PPTX
2014 05-07-fr - add dev series - session 6 - deploying your application-2
MongoDB
 
PDF
Mongodb workshop
Harun Yardımcı
 
ODP
Introduction to MongoDB with PHP
fwso
 
MongoDB Replication and Sharding
Tharun Srinivasa
 
Get expertise with mongo db
Amit Thakkar
 
Python mongo db-training-europython-2011
Andreas Jung
 
Conceptos básicos. Seminario web 6: Despliegue de producción
MongoDB
 
OSDC 2012 | Scaling with MongoDB by Ross Lawley
NETWAYS
 
Scaling with MongoDB
MongoDB
 
Getting started with replica set in MongoDB
Kishor Parkhe
 
Back to Basics: Build Something Big With MongoDB
MongoDB
 
Back to Basics Spanish Webinar 3 - Introducción a los replica sets
MongoDB
 
Back tobasicswebinar part6-rev.
MongoDB
 
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
MongoDB
 
High Availabiltity & Replica Sets with mongoDB
Gareth Davies
 
MongoDB 3.0
Victoria Malaya
 
MongoDB - An Introduction
sethfloydjr
 
MongoDB: Advance concepts - Replication and Sharding
Knoldus Inc.
 
Mongo db roma replication and sharding
Guglielmo Incisa Di Camerana
 
2011 mongo FR - scaling with mongodb
antoinegirbal
 
2014 05-07-fr - add dev series - session 6 - deploying your application-2
MongoDB
 
Mongodb workshop
Harun Yardımcı
 
Introduction to MongoDB with PHP
fwso
 

Recently uploaded (20)

PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
July Patch Tuesday
Ivanti
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Biography of Daniel Podor.pdf
Daniel Podor
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
July Patch Tuesday
Ivanti
 
Ad

MongoDB Part 2

  • 2. Admin UI There are a number of open source projects that provide an admin 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. MongoHub details Retail time CRUD operations monitoring Multi-database views Detailed collection views Interactive querying MySQL Import / Export
  • 4. Monitoring and Diagnostics The newer versions on MongoDB come with  mongostat sudo mongosniff --source NET lo0 Could be straight forward to hook up custom Nagios alerts and monitoring with this data
  • 5. Replication Old way < 1.6 New way >= 1.6
  • 6. How it all works MongoDB has a primary node who does the writes The data is then replicated to the rest of the set MongoDB has auto fail-over so if the current primary pukes, then another node is "elected" A write is theoretically complete when a "majority" of the 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. The Ugly Truth If a node fails-over during replication and all the nodes haven't received it... The data drops ;..(
  • 8. MongoDB Make Believe Land Node 2 Node 3
  • 9. MongoDB Make Believe Land Node 2 Node 3
  • 10. MongoDB Make Believe Land Node 2 Node 3
  • 11. MongoDB Make Believe Land Node 2 Node 3
  • 12. How do I set that up? Well, its super hard... ...NOT to do it right I <3 MongoDB documentation http://www.mongodb. org/display/DOCS/Replica+Set+Tutorial You can also do N nodes and 1 arbiter, where N % 2 == 0
  • 13. "Shards are the secret sauce..."
  • 15. Shards Shard 2 Shard 1 Node 2 Node 3
  • 16. Choose wisely! > When sharding you must choose your shard key wisely for an even distribution of load and data > It's best to choose composite shard keys and determine the most common queries > Helps ensure your query targets a single shard vs. querying ALL shards
  • 18. Map / Reduce > You can write map/reduce functions in the shell and with any of the supported MongoDB drivers
  • 19. Logging with MongoDB Got this link from the MongoDB meetup at Engine Yard this past week. Thanks to Robert Stewart for the great presentation: http://www.slideshare. net/WombatNation/logging- app-behavior-to-mongo-db