SlideShare a Scribd company logo
First steps with MongoDB




              
Index
    When you should use  NoSQL
    When you should not use NoSQL
    A quick look at MongoDB
    Other features
    Main scheme
    Replication
    Auto­sharding
    Architecture
    First steps
                                  
When should I use NoSQL?


 Caching
 High data amount
 Horizontal scalability(without joins or complex 
  transactions)


 The Slogan is ”not only SQL”  and ”not only 
  NOSQL” 

                             
When should not I use
NoSQL


    High transaction level
    Business Intelligence
    Problems that need relational queries




                               
A quick look at MongoDB

    Document database oriented (BSON)
    Flexible scheme
    Dinamic queries
    Replication
    Auto­sharding
    Atomic operations
    Full indexes

                             
A quick look at MongoDB

    Not relational
    Distributed
    Opensource
    Horizontal scalability
    Drivers for most known programming languages
    Replication and automatic sharding
    GridFS

                               
Other features

    Map Reduce
      Queries are executed in parallel in all of the shards
      Adittion and process of flexible data
    Geospatial index
      Find objects based on their geographical location 




                                    
Basic scheme

Database Server
Shell
Sharding router


            Mongod                               Mongo
        Database server                     Interactive shell



                             Mongos
                          Sharding router


                                       
Replication

    Master: mongod –master
    Slave: mongod –source url:port or pasive –slavedelay 
      numberofseconds
    Replica Sets
      Full support in dealing with failures(recommended by each 
        shard)
      You can have passive members that never will be masters.
    Master­master
      Only recommended for insert and delete queries by id.
                                  
Auto-sharding

    Defined by a shard key
    Response in dealing with failures is handled by each 
     replica set.
    Queries map reduce could run in paralell between 
     many shards.
    You can add servers as shards and automatically data 
     are distributed along of all shards. 



                                
Fragmentation




             
Fragmentation




             
Architecture
    Shards Servers: mongod –shardsvr
    You can configure replication to dealing with failures.
    Shards Routers: mongos –configdb 
     urlconfig:portconfig
    It is the shell for the rest of clients.
    It can be executed in an application server for reduce 
       the load of the server.
    Config Routers:mongod –configsvr
    Recommended a group of 3
                                   
Logical architecture




               
Important note
    _id
      Special key
      Present in all stored documents
      Unique to each collection
      It can be the type you want




                                     
First step with sharding

    use admin
    db.runCommand( { addshard : "pre­mongo1:10000" } );
    db.runCommand( { addshard : "pre­mongo2:10000" } );
    db.runCommand( { enablesharding : "activities" } );
    db.runCommand( { shardcollection : 
      "activities.userWall" , key : { userId: 1 } } );
    db.printShardingStatus()


                                  
Backup

    EC2 → Snapshot EBS
    LVM→ Snapshot LV
    FS→mysqldump, dd (with sharding not recommended)
    Weak point of sharding.
    More details ­> http://bit.ly/wNdlIA




                                
Questions?




              
Who am I?

    Spanish web: http://www.juanvicenteherrera.es
    English web: http://www.juanvicenteherrera.eu
    Twitter: http://twitter.com/jvicenteherrera
    LinkedIn: http://es.linkedin.com/in/jvherrera




                                

More Related Content

PPT
Aleksandr_Butenko_Mobile_Development
Ciklum
 
PPTX
mongodb-brief-intro-february-2012
Chris Westin
 
PDF
Gcd and concurrency programming
Li Lin
 
PPT
MongoDB Basic Concepts
MongoDB
 
PDF
X3
uupaa
 
PPTX
mongoDB for sysadmins
Jordi Soucheiron
 
PDF
RelStorage Plone Zope RDB Storage Backend
Jens Klein
 
PDF
Supercharge your next Vue app with Nuxt
The Software House
 
Aleksandr_Butenko_Mobile_Development
Ciklum
 
mongodb-brief-intro-february-2012
Chris Westin
 
Gcd and concurrency programming
Li Lin
 
MongoDB Basic Concepts
MongoDB
 
X3
uupaa
 
mongoDB for sysadmins
Jordi Soucheiron
 
RelStorage Plone Zope RDB Storage Backend
Jens Klein
 
Supercharge your next Vue app with Nuxt
The Software House
 

What's hot (20)

PDF
dba_lounge_Iasi: Everybody likes redis
Liviu Costea
 
PPTX
NodeJS Presentation
Faisal Shahzad Khan
 
PDF
Node
Arjun Raj
 
PDF
Node.js introduction
Prasoon Kumar
 
PPT
Oreilly Webcast Jun17
Sean Hull
 
PDF
Mini-review + cheat sheet: ZFS on FUSE
Asociatia ProLinux
 
PDF
Juju, LXC, OpenStack: Fun with Private Clouds
Sameer Verma
 
PPT
Mysql talk
LogicMonitor
 
PPTX
Ops Jumpstart: Admin 101
MongoDB
 
PDF
ngServer and-collaboratived-development-between-san-francisco-and-tokyo
Satoshi Tanaka
 
PDF
GruntJS + Wordpress
Leonardo Balter
 
PPTX
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
DataStax Academy
 
PPTX
Strategies for Backing Up MongoDB
MongoDB
 
PDF
Create a RESTful API with NodeJS, Express and MongoDB
Hengki Sihombing
 
PPTX
The cassandra odyssey
Phillip Gentry
 
ODP
Barcamp MySQL
Kris Buytaert
 
PDF
Elastic jenkins
Daniel Barker
 
PDF
Cassandra Anti-Patterns
Matthew Dennis
 
PDF
MongoUK - Approaching 1 billion documents with MongoDB1 Billion Documents
Boxed Ice
 
PDF
Erlang scheduler
dennis zhuang
 
dba_lounge_Iasi: Everybody likes redis
Liviu Costea
 
NodeJS Presentation
Faisal Shahzad Khan
 
Node
Arjun Raj
 
Node.js introduction
Prasoon Kumar
 
Oreilly Webcast Jun17
Sean Hull
 
Mini-review + cheat sheet: ZFS on FUSE
Asociatia ProLinux
 
Juju, LXC, OpenStack: Fun with Private Clouds
Sameer Verma
 
Mysql talk
LogicMonitor
 
Ops Jumpstart: Admin 101
MongoDB
 
ngServer and-collaboratived-development-between-san-francisco-and-tokyo
Satoshi Tanaka
 
GruntJS + Wordpress
Leonardo Balter
 
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
DataStax Academy
 
Strategies for Backing Up MongoDB
MongoDB
 
Create a RESTful API with NodeJS, Express and MongoDB
Hengki Sihombing
 
The cassandra odyssey
Phillip Gentry
 
Barcamp MySQL
Kris Buytaert
 
Elastic jenkins
Daniel Barker
 
Cassandra Anti-Patterns
Matthew Dennis
 
MongoUK - Approaching 1 billion documents with MongoDB1 Billion Documents
Boxed Ice
 
Erlang scheduler
dennis zhuang
 
Ad

Viewers also liked (20)

PPTX
MongoDB
Tharun Srinivasa
 
PPTX
Getting Started with MongoDB
Pankaj Bajaj
 
KEY
Mongodb intro
christkv
 
KEY
Introduction to MongoDB
Sean Laurent
 
ODP
Seth Edwards on MongoDB
Skills Matter
 
PDF
Intro to NoSQL and MongoDB
MongoDB
 
PPTX
Schema design with MongoDB (Dwight Merriman)
MongoSF
 
PPTX
Mastering the MongoDB Javascript Shell
Scott Hernandez
 
ODP
Introduction to MongoDB
Knoldus Inc.
 
KEY
An Evening with MongoDB - Orlando: Welcome and Keynote
MongoDB
 
ODP
Introduction to MongoDB
Dineesha Suraweera
 
PPTX
MongoDB 3.0
Victoria Malaya
 
PDF
Plan de entrenamiento Maratón de Madrid Mes 3
Juan Vicente Herrera Ruiz de Alejo
 
PPTX
Mongo db intro new
Abhinav Dhasmana
 
PDF
Zero to Mongo in 60 Hours
MongoSF
 
PDF
Text databases and information retrieval
unyil96
 
PDF
Mongodb
Scott Motte
 
PDF
Mongo DB on the JVM - Brendan McAdams
JAX London
 
PDF
MongoDB 3.2 Feature Preview
Norberto Leite
 
Getting Started with MongoDB
Pankaj Bajaj
 
Mongodb intro
christkv
 
Introduction to MongoDB
Sean Laurent
 
Seth Edwards on MongoDB
Skills Matter
 
Intro to NoSQL and MongoDB
MongoDB
 
Schema design with MongoDB (Dwight Merriman)
MongoSF
 
Mastering the MongoDB Javascript Shell
Scott Hernandez
 
Introduction to MongoDB
Knoldus Inc.
 
An Evening with MongoDB - Orlando: Welcome and Keynote
MongoDB
 
Introduction to MongoDB
Dineesha Suraweera
 
MongoDB 3.0
Victoria Malaya
 
Plan de entrenamiento Maratón de Madrid Mes 3
Juan Vicente Herrera Ruiz de Alejo
 
Mongo db intro new
Abhinav Dhasmana
 
Zero to Mongo in 60 Hours
MongoSF
 
Text databases and information retrieval
unyil96
 
Mongodb
Scott Motte
 
Mongo DB on the JVM - Brendan McAdams
JAX London
 
MongoDB 3.2 Feature Preview
Norberto Leite
 
Ad

Similar to MongoDB Devops Madrid February 2012 (20)

KEY
Sharding with MongoDB (Eliot Horowitz)
MongoSF
 
KEY
Sharding with MongoDB (Eliot Horowitz)
MongoDB
 
PPT
2011 mongo FR - scaling with mongodb
antoinegirbal
 
KEY
2011 mongo sf-scaling
MongoDB
 
PDF
Mongo db transcript
foliba
 
PDF
Mongodb workshop
Harun Yardımcı
 
KEY
Scaling with MongoDB
MongoDB
 
PDF
MongoDB - An Introduction
sethfloydjr
 
KEY
Scaling MongoDB (Mongo Austin)
MongoDB
 
PPTX
MongoDB Internals
Siraj Memon
 
PPT
MongoDB Knowledge Shareing
Philip Zhong
 
PDF
MongoDB: Advantages of an Open Source NoSQL Database
FITC
 
KEY
Mongodb sharding
xiangrong
 
PPTX
Agility and Scalability with MongoDB
MongoDB
 
PPTX
MongoDB: An Introduction - june-2011
Chris Westin
 
PDF
Introduction to Mongodb
Harun Yardımcı
 
PPTX
DBVersity MongoDB Online Training Presentations
Srinivas Mutyala
 
PDF
Introduction to MongoDB
Mike Dirolf
 
PPT
MONGODB VASUDEV PRAJAPATI DOCUMENTBASE DATABASE
vasustudy176
 
KEY
The Care + Feeding of a Mongodb Cluster
Chris Henry
 
Sharding with MongoDB (Eliot Horowitz)
MongoSF
 
Sharding with MongoDB (Eliot Horowitz)
MongoDB
 
2011 mongo FR - scaling with mongodb
antoinegirbal
 
2011 mongo sf-scaling
MongoDB
 
Mongo db transcript
foliba
 
Mongodb workshop
Harun Yardımcı
 
Scaling with MongoDB
MongoDB
 
MongoDB - An Introduction
sethfloydjr
 
Scaling MongoDB (Mongo Austin)
MongoDB
 
MongoDB Internals
Siraj Memon
 
MongoDB Knowledge Shareing
Philip Zhong
 
MongoDB: Advantages of an Open Source NoSQL Database
FITC
 
Mongodb sharding
xiangrong
 
Agility and Scalability with MongoDB
MongoDB
 
MongoDB: An Introduction - june-2011
Chris Westin
 
Introduction to Mongodb
Harun Yardımcı
 
DBVersity MongoDB Online Training Presentations
Srinivas Mutyala
 
Introduction to MongoDB
Mike Dirolf
 
MONGODB VASUDEV PRAJAPATI DOCUMENTBASE DATABASE
vasustudy176
 
The Care + Feeding of a Mongodb Cluster
Chris Henry
 

More from Juan Vicente Herrera Ruiz de Alejo (20)

PDF
Un puente enre MLops y Devops con Openshift AI
Juan Vicente Herrera Ruiz de Alejo
 
PDF
Practical Threat Modeling - WorldParty 2k23 HackMadrid.pdf
Juan Vicente Herrera Ruiz de Alejo
 
PDF
Keycloak SSO basics
Juan Vicente Herrera Ruiz de Alejo
 
PDF
OpenShift Multicluster
Juan Vicente Herrera Ruiz de Alejo
 
PDF
Deploying Minecraft with Ansible
Juan Vicente Herrera Ruiz de Alejo
 
PDF
Tell me how you provision and I'll tell you how you are
Juan Vicente Herrera Ruiz de Alejo
 
PDF
Santander DevopsandCloudDays 2021 - Hardening containers.pdf
Juan Vicente Herrera Ruiz de Alejo
 
PDF
X by orange; una telco en la nube
Juan Vicente Herrera Ruiz de Alejo
 
PDF
Dorsal carrera de la mujer ROSAE 2017
Juan Vicente Herrera Ruiz de Alejo
 
PDF
Cartel carrera de la mujer ROSAE 2017
Juan Vicente Herrera Ruiz de Alejo
 
PDF
Volkswagen Prague Marathon 2017
Juan Vicente Herrera Ruiz de Alejo
 
PDF
Plan de entrenamiento Maratón de Madrid Mes 2
Juan Vicente Herrera Ruiz de Alejo
 
PDF
Plan de entrenamiento Maratón de Madrid Mes 1
Juan Vicente Herrera Ruiz de Alejo
 
PDF
Cartel carrera de la mujer ROSAE 2014
Juan Vicente Herrera Ruiz de Alejo
 
PPT
AWS migration: getting to Data Center heaven with AWS and Chef
Juan Vicente Herrera Ruiz de Alejo
 
ODP
Devops madrid: successful case in AWS
Juan Vicente Herrera Ruiz de Alejo
 
ODP
Devops Madrid Marzo - Caso de uso en AWS
Juan Vicente Herrera Ruiz de Alejo
 
ODP
Configuration management with Chef
Juan Vicente Herrera Ruiz de Alejo
 
ODP
DevOps and Chef improve your life
Juan Vicente Herrera Ruiz de Alejo
 
ODP
Amazon EC2: What is this and what can I do with it?
Juan Vicente Herrera Ruiz de Alejo
 
Un puente enre MLops y Devops con Openshift AI
Juan Vicente Herrera Ruiz de Alejo
 
Practical Threat Modeling - WorldParty 2k23 HackMadrid.pdf
Juan Vicente Herrera Ruiz de Alejo
 
OpenShift Multicluster
Juan Vicente Herrera Ruiz de Alejo
 
Deploying Minecraft with Ansible
Juan Vicente Herrera Ruiz de Alejo
 
Tell me how you provision and I'll tell you how you are
Juan Vicente Herrera Ruiz de Alejo
 
Santander DevopsandCloudDays 2021 - Hardening containers.pdf
Juan Vicente Herrera Ruiz de Alejo
 
X by orange; una telco en la nube
Juan Vicente Herrera Ruiz de Alejo
 
Dorsal carrera de la mujer ROSAE 2017
Juan Vicente Herrera Ruiz de Alejo
 
Cartel carrera de la mujer ROSAE 2017
Juan Vicente Herrera Ruiz de Alejo
 
Volkswagen Prague Marathon 2017
Juan Vicente Herrera Ruiz de Alejo
 
Plan de entrenamiento Maratón de Madrid Mes 2
Juan Vicente Herrera Ruiz de Alejo
 
Plan de entrenamiento Maratón de Madrid Mes 1
Juan Vicente Herrera Ruiz de Alejo
 
Cartel carrera de la mujer ROSAE 2014
Juan Vicente Herrera Ruiz de Alejo
 
AWS migration: getting to Data Center heaven with AWS and Chef
Juan Vicente Herrera Ruiz de Alejo
 
Devops madrid: successful case in AWS
Juan Vicente Herrera Ruiz de Alejo
 
Devops Madrid Marzo - Caso de uso en AWS
Juan Vicente Herrera Ruiz de Alejo
 
Configuration management with Chef
Juan Vicente Herrera Ruiz de Alejo
 
DevOps and Chef improve your life
Juan Vicente Herrera Ruiz de Alejo
 
Amazon EC2: What is this and what can I do with it?
Juan Vicente Herrera Ruiz de Alejo
 

Recently uploaded (20)

PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Software Development Methodologies in 2025
KodekX
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 

MongoDB Devops Madrid February 2012

  • 1. First steps with MongoDB    
  • 2. Index When you should use  NoSQL When you should not use NoSQL A quick look at MongoDB Other features Main scheme Replication Auto­sharding Architecture First steps    
  • 3. When should I use NoSQL? Caching High data amount Horizontal scalability(without joins or complex  transactions) The Slogan is ”not only SQL”  and ”not only  NOSQL”     
  • 4. When should not I use NoSQL High transaction level Business Intelligence Problems that need relational queries    
  • 5. A quick look at MongoDB Document database oriented (BSON) Flexible scheme Dinamic queries Replication Auto­sharding Atomic operations Full indexes    
  • 6. A quick look at MongoDB Not relational Distributed Opensource Horizontal scalability Drivers for most known programming languages Replication and automatic sharding GridFS    
  • 7. Other features Map Reduce Queries are executed in parallel in all of the shards Adittion and process of flexible data Geospatial index Find objects based on their geographical location     
  • 8. Basic scheme Database Server Shell Sharding router Mongod Mongo Database server Interactive shell Mongos Sharding router    
  • 9. Replication Master: mongod –master Slave: mongod –source url:port or pasive –slavedelay  numberofseconds Replica Sets Full support in dealing with failures(recommended by each  shard) You can have passive members that never will be masters. Master­master Only recommended for insert and delete queries by id.    
  • 10. Auto-sharding Defined by a shard key Response in dealing with failures is handled by each  replica set. Queries map reduce could run in paralell between  many shards. You can add servers as shards and automatically data  are distributed along of all shards.     
  • 13. Architecture Shards Servers: mongod –shardsvr You can configure replication to dealing with failures. Shards Routers: mongos –configdb  urlconfig:portconfig It is the shell for the rest of clients. It can be executed in an application server for reduce  the load of the server. Config Routers:mongod –configsvr Recommended a group of 3    
  • 15. Important note _id Special key Present in all stored documents Unique to each collection It can be the type you want    
  • 16. First step with sharding use admin db.runCommand( { addshard : "pre­mongo1:10000" } ); db.runCommand( { addshard : "pre­mongo2:10000" } ); db.runCommand( { enablesharding : "activities" } ); db.runCommand( { shardcollection :  "activities.userWall" , key : { userId: 1 } } ); db.printShardingStatus()    
  • 17. Backup EC2 → Snapshot EBS LVM→ Snapshot LV FS→mysqldump, dd (with sharding not recommended) Weak point of sharding. More details ­> http://bit.ly/wNdlIA    
  • 19. Who am I? Spanish web: http://www.juanvicenteherrera.es English web: http://www.juanvicenteherrera.eu Twitter: http://twitter.com/jvicenteherrera LinkedIn: http://es.linkedin.com/in/jvherrera