SlideShare uma empresa Scribd logo
1 de 19
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




                                

Mais conteúdo relacionado

Mais procurados

Node.js introduction
Node.js introductionNode.js introduction
Node.js introduction
Prasoon Kumar
 
Oreilly Webcast Jun17
Oreilly Webcast Jun17Oreilly Webcast Jun17
Oreilly Webcast Jun17
Sean Hull
 
Mini-review + cheat sheet: ZFS on FUSE
Mini-review + cheat sheet: ZFS on FUSEMini-review + cheat sheet: ZFS on FUSE
Mini-review + cheat sheet: ZFS on FUSE
Asociatia ProLinux
 
ngServer and-collaboratived-development-between-san-francisco-and-tokyo
ngServer and-collaboratived-development-between-san-francisco-and-tokyongServer and-collaboratived-development-between-san-francisco-and-tokyo
ngServer and-collaboratived-development-between-san-francisco-and-tokyo
Satoshi Tanaka
 

Mais procurados (20)

dba_lounge_Iasi: Everybody likes redis
dba_lounge_Iasi: Everybody likes redisdba_lounge_Iasi: Everybody likes redis
dba_lounge_Iasi: Everybody likes redis
 
NodeJS Presentation
NodeJS PresentationNodeJS Presentation
NodeJS Presentation
 
Node
NodeNode
Node
 
Node.js introduction
Node.js introductionNode.js introduction
Node.js introduction
 
Oreilly Webcast Jun17
Oreilly Webcast Jun17Oreilly Webcast Jun17
Oreilly Webcast Jun17
 
Mini-review + cheat sheet: ZFS on FUSE
Mini-review + cheat sheet: ZFS on FUSEMini-review + cheat sheet: ZFS on FUSE
Mini-review + cheat sheet: ZFS on FUSE
 
Juju, LXC, OpenStack: Fun with Private Clouds
Juju, LXC, OpenStack: Fun with Private CloudsJuju, LXC, OpenStack: Fun with Private Clouds
Juju, LXC, OpenStack: Fun with Private Clouds
 
Mysql talk
Mysql talkMysql talk
Mysql talk
 
Ops Jumpstart: Admin 101
Ops Jumpstart: Admin 101Ops Jumpstart: Admin 101
Ops Jumpstart: Admin 101
 
ngServer and-collaboratived-development-between-san-francisco-and-tokyo
ngServer and-collaboratived-development-between-san-francisco-and-tokyongServer and-collaboratived-development-between-san-francisco-and-tokyo
ngServer and-collaboratived-development-between-san-francisco-and-tokyo
 
GruntJS + Wordpress
GruntJS + WordpressGruntJS + Wordpress
GruntJS + Wordpress
 
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
 
Strategies for Backing Up MongoDB
Strategies for Backing Up MongoDBStrategies for Backing Up MongoDB
Strategies for Backing Up MongoDB
 
Create a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDBCreate a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDB
 
The cassandra odyssey
The cassandra odysseyThe cassandra odyssey
The cassandra odyssey
 
Barcamp MySQL
Barcamp MySQLBarcamp MySQL
Barcamp MySQL
 
Elastic jenkins
Elastic jenkinsElastic jenkins
Elastic jenkins
 
Cassandra Anti-Patterns
Cassandra Anti-PatternsCassandra Anti-Patterns
Cassandra Anti-Patterns
 
MongoUK - Approaching 1 billion documents with MongoDB1 Billion Documents
MongoUK - Approaching 1 billion documents with MongoDB1 Billion DocumentsMongoUK - Approaching 1 billion documents with MongoDB1 Billion Documents
MongoUK - Approaching 1 billion documents with MongoDB1 Billion Documents
 
Erlang scheduler
Erlang schedulerErlang scheduler
Erlang scheduler
 

Destaque

Schema design with MongoDB (Dwight Merriman)
Schema design with MongoDB (Dwight Merriman)Schema design with MongoDB (Dwight Merriman)
Schema design with MongoDB (Dwight Merriman)
MongoSF
 
Mastering the MongoDB Javascript Shell
Mastering the MongoDB Javascript ShellMastering the MongoDB Javascript Shell
Mastering the MongoDB Javascript Shell
Scott Hernandez
 
Zero to Mongo in 60 Hours
Zero to Mongo in 60 HoursZero to Mongo in 60 Hours
Zero to Mongo in 60 Hours
MongoSF
 
Text databases and information retrieval
Text databases and information retrievalText databases and information retrieval
Text databases and information retrieval
unyil96
 

Destaque (20)

MongoDB
MongoDBMongoDB
MongoDB
 
Getting Started with MongoDB
Getting Started with MongoDBGetting Started with MongoDB
Getting Started with MongoDB
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Seth Edwards on MongoDB
Seth Edwards on MongoDBSeth Edwards on MongoDB
Seth Edwards on MongoDB
 
Intro to NoSQL and MongoDB
 Intro to NoSQL and MongoDB Intro to NoSQL and MongoDB
Intro to NoSQL and MongoDB
 
Schema design with MongoDB (Dwight Merriman)
Schema design with MongoDB (Dwight Merriman)Schema design with MongoDB (Dwight Merriman)
Schema design with MongoDB (Dwight Merriman)
 
Mastering the MongoDB Javascript Shell
Mastering the MongoDB Javascript ShellMastering the MongoDB Javascript Shell
Mastering the MongoDB Javascript Shell
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
An Evening with MongoDB - Orlando: Welcome and Keynote
An Evening with MongoDB - Orlando: Welcome and KeynoteAn Evening with MongoDB - Orlando: Welcome and Keynote
An Evening with MongoDB - Orlando: Welcome and Keynote
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB 3.0
MongoDB 3.0 MongoDB 3.0
MongoDB 3.0
 
Plan de entrenamiento Maratón de Madrid Mes 3
Plan de entrenamiento Maratón de Madrid Mes 3Plan de entrenamiento Maratón de Madrid Mes 3
Plan de entrenamiento Maratón de Madrid Mes 3
 
Mongo db intro new
Mongo db intro newMongo db intro new
Mongo db intro new
 
Zero to Mongo in 60 Hours
Zero to Mongo in 60 HoursZero to Mongo in 60 Hours
Zero to Mongo in 60 Hours
 
Text databases and information retrieval
Text databases and information retrievalText databases and information retrieval
Text databases and information retrieval
 
Mongodb
MongodbMongodb
Mongodb
 
Mongo DB on the JVM - Brendan McAdams
Mongo DB on the JVM - Brendan McAdamsMongo DB on the JVM - Brendan McAdams
Mongo DB on the JVM - Brendan McAdams
 
Mongodb
MongodbMongodb
Mongodb
 
MongoDB 3.2 Feature Preview
MongoDB 3.2 Feature PreviewMongoDB 3.2 Feature Preview
MongoDB 3.2 Feature Preview
 

Semelhante a MongoDB Devops Madrid February 2012

MongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseMongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql Database
Sudhir Patil
 
MongoDB Knowledge Shareing
MongoDB Knowledge ShareingMongoDB Knowledge Shareing
MongoDB Knowledge Shareing
Philip Zhong
 

Semelhante a MongoDB Devops Madrid February 2012 (20)

mongodb tutorial
mongodb tutorialmongodb tutorial
mongodb tutorial
 
NoSQL with MySQL
NoSQL with MySQLNoSQL with MySQL
NoSQL with MySQL
 
MongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseMongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL Database
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architecture
 
MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...
MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...
MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...
 
MySQL HA
MySQL HAMySQL HA
MySQL HA
 
Python mongo db-training-europython-2011
Python mongo db-training-europython-2011Python mongo db-training-europython-2011
Python mongo db-training-europython-2011
 
Invitation to mongo db @ Rakuten TechTalk
Invitation to mongo db @ Rakuten TechTalkInvitation to mongo db @ Rakuten TechTalk
Invitation to mongo db @ Rakuten TechTalk
 
StorageOS, Storage for Containers Shouldn't Be Annoying at Container Camp UK
StorageOS, Storage for Containers Shouldn't Be Annoying at Container Camp UKStorageOS, Storage for Containers Shouldn't Be Annoying at Container Camp UK
StorageOS, Storage for Containers Shouldn't Be Annoying at Container Camp UK
 
MongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of viewMongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of view
 
Experience In Building Scalable Web Sites Through Infrastructure's View
Experience In Building Scalable Web Sites Through Infrastructure's ViewExperience In Building Scalable Web Sites Through Infrastructure's View
Experience In Building Scalable Web Sites Through Infrastructure's View
 
Monogo db in-action
Monogo db in-actionMonogo db in-action
Monogo db in-action
 
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcript
 
Conceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónConceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producción
 
Brk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBrk2051 sql server on linux and docker
Brk2051 sql server on linux and docker
 
RDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and PatternsRDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and Patterns
 
MongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseMongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql Database
 
MongoATL: How Sourceforge is Using MongoDB
MongoATL: How Sourceforge is Using MongoDBMongoATL: How Sourceforge is Using MongoDB
MongoATL: How Sourceforge is Using MongoDB
 
MongoDB Knowledge Shareing
MongoDB Knowledge ShareingMongoDB Knowledge Shareing
MongoDB Knowledge Shareing
 
Let's Containerize New York with Docker!
Let's Containerize New York with Docker!Let's Containerize New York with Docker!
Let's Containerize New York with Docker!
 

Mais de Juan Vicente Herrera Ruiz de Alejo

Mais de Juan Vicente Herrera Ruiz de Alejo (20)

Keycloak SSO basics
Keycloak SSO basicsKeycloak SSO basics
Keycloak SSO basics
 
OpenShift Multicluster
OpenShift MulticlusterOpenShift Multicluster
OpenShift Multicluster
 
Deploying Minecraft with Ansible
Deploying Minecraft with AnsibleDeploying Minecraft with Ansible
Deploying Minecraft with Ansible
 
Tell me how you provision and I'll tell you how you are
Tell me how you provision and I'll tell you how you areTell me how you provision and I'll tell you how you are
Tell me how you provision and I'll tell you how you are
 
Santander DevopsandCloudDays 2021 - Hardening containers.pdf
Santander DevopsandCloudDays 2021 - Hardening containers.pdfSantander DevopsandCloudDays 2021 - Hardening containers.pdf
Santander DevopsandCloudDays 2021 - Hardening containers.pdf
 
X by orange; una telco en la nube
X by orange;   una telco en la nubeX by orange;   una telco en la nube
X by orange; una telco en la nube
 
Dorsal carrera de la mujer ROSAE 2017
Dorsal carrera de la mujer ROSAE 2017 Dorsal carrera de la mujer ROSAE 2017
Dorsal carrera de la mujer ROSAE 2017
 
Cartel carrera de la mujer ROSAE 2017
Cartel carrera de la mujer  ROSAE 2017Cartel carrera de la mujer  ROSAE 2017
Cartel carrera de la mujer ROSAE 2017
 
Volkswagen Prague Marathon 2017
Volkswagen Prague Marathon 2017Volkswagen Prague Marathon 2017
Volkswagen Prague Marathon 2017
 
Plan de entrenamiento Maratón de Madrid Mes 2
Plan de entrenamiento Maratón de Madrid Mes 2Plan de entrenamiento Maratón de Madrid Mes 2
Plan de entrenamiento Maratón de Madrid Mes 2
 
Plan de entrenamiento Maratón de Madrid Mes 1
Plan de entrenamiento Maratón de Madrid Mes 1Plan de entrenamiento Maratón de Madrid Mes 1
Plan de entrenamiento Maratón de Madrid Mes 1
 
Cartel carrera de la mujer ROSAE 2014
Cartel carrera de la mujer ROSAE 2014Cartel carrera de la mujer ROSAE 2014
Cartel carrera de la mujer ROSAE 2014
 
AWS migration: getting to Data Center heaven with AWS and Chef
AWS migration: getting to Data Center heaven with AWS and ChefAWS migration: getting to Data Center heaven with AWS and Chef
AWS migration: getting to Data Center heaven with AWS and Chef
 
Devops madrid: successful case in AWS
Devops madrid: successful case in AWSDevops madrid: successful case in AWS
Devops madrid: successful case in AWS
 
Devops Madrid Marzo - Caso de uso en AWS
Devops Madrid Marzo - Caso de uso en AWSDevops Madrid Marzo - Caso de uso en AWS
Devops Madrid Marzo - Caso de uso en AWS
 
Configuration management with Chef
Configuration management with ChefConfiguration management with Chef
Configuration management with Chef
 
DevOps and Chef improve your life
DevOps and Chef improve your life DevOps and Chef improve your life
DevOps and Chef improve your life
 
Amazon EC2: What is this and what can I do with it?
Amazon EC2: What is this and what can I do with it?Amazon EC2: What is this and what can I do with it?
Amazon EC2: What is this and what can I do with it?
 
MongoDB - Madrid Devops Febrero
MongoDB - Madrid Devops FebreroMongoDB - Madrid Devops Febrero
MongoDB - Madrid Devops Febrero
 
Introducción a AWS
Introducción a AWSIntroducción a AWS
Introducción a AWS
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 

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