SlideShare a Scribd company logo
Back to Basics Spanish 4 Introduction to sharding
June 20-21, 2017
Chicago, IL
Chicago, IL
MongoDB World is where the
world’s fastest growing
database community comes
to connect, explore, and
learn.
Back to Basics 2017: Webinar 4
Sharding
Rubén Terceño
Senior Solutions Architect, EMEA
ruben@mongodb.com
@rubenTerceno
Alejandro Mancilla
Senior Solutions Architect, LATAM
alejandro.mancilla@mongodb.com
@alxmancilla
¡Bienvenidos!
Agenda del Curso
Date Time Webinar
25-Abril-2016 16:00 CEST Introducción a NoSQL
3-Mayo-2016 16:00 CEST Mi primera aplicación MongoDB
9-Mayo-2016 16:00 CEST Introducción a los ReplicaSets
16-Mayo-2016 16:00 CEST Introducción al Sharding
16:00 CEST = 14:00 UTC = 11:00am Argentina / Uruguay = 9:30am
Venezuela/Chile = 9:00am Colombia / Ecuador / México
Resumen de los webinars 1 a 3
• ¿Porqué existe NoSQL?
• Características clave de MongoDB
• Instalación y creación de bases de datos y colecciones
• Operaciones CRUD, Índices y explain()
• Replicación de datos en MongoDB
• MongoDB Atlas y Compass
Agenda de hoy
• ¿Qué es eso de Sharding? ¿Lo necesito?
• La arquitectura de un sharded cluster
• Restricciones en un sharded cluster
• ¿Cómo funciona en la práctica?
ReplicaSet
mongod
27017
mongod
27017
mongod
27017
Replica Set mongod
Secondary
mongod
Primary
mongod
Secondary
Oplog
replication
Heartbeat
Limitations
mongod
27018
mongod
27018
mongod
27018
mongod
27017
mongod
27017
mongod
27017
RAM
CPU
Network
Disk IO
Sharding = Horizontal Scaling
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27017
mongod
27017
mongod
27017
mongod
27017
mongod
27017
mongod
27017 Shard
Introducing the Query Router
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongos
27017
Shard
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
Introducing the Config Servers
config
27019
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
config
27019
mongos
27017
Shard
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
config
27019
Limitless scaling
mongod
27017
mongod
27017
mongod
27017
mongos
27017
mongos
27017
mongos
27017
mongos
27017
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
mongod
27018
config
27019
config
27019
config
27019
Construction
• Build Cluster
• Identify shard key
• Sharding happens on individual collections
• To shard a collection:
sh.shardCollection( "MUGS.members",{"name" : 1 } )
Sharding key
• Sharding key is the way MongoDB partition collections.
• The range of the sharding key is split in several chunks.
• The chunks are distributed evenly among the available shards
Selecting a sharding key
• Probably the most influential decision on performance
• A good sharding key has:
• High cardinality
• Evenly distributed frequency
• A non-monotonic creation rate
• And much more important: is used on queries.
• Limitations
• Sharding key is immutable
• Sharding key values are immutable
• Sharding key can’t be a multikey, geospatial or text index
Config servers and mongos
• Config servers store metadata (chunk distribution and location)
• They can be configured as a replica set from version 3.2 (CSRS)
• Up to 50 config servers
• Hardened failover
• mongos acts as query routers
• mongos keep a local copy of config server information
• mongos can be deployed on the application server
Sharding, when?
• Shard only when needed:
• Vertical scalability is not possible anymore
• RAM
• CPU
• IOPS
• Concurrency
• Depending on the server technology the range to start
thinking in sharding is around a few Tb of data.
Chunk is a Section on the Range
Chunk Splitting
How Data Is Distributed
• Initially 1 chunk
• Default max chunk size: 64mb
• MongoDB automatically splits & migrates chunks when max
reached
Balancing The Cluster
Acquiring The Balancer Lock
Moving The Chunk
Commiting The Migration
Clean Up
Routing Requests - Targeted
Routing Requests – Non-Targeted
Routing with Sort
Resumen
• Sharding = Horizontal Scalability
• MongoDB automatically balances the cluster
• Shards can be added dynamically to a live system
• Rebalancing happens in the background
• Shard key partitions the content
• Shard key is immutable
• Shard key can route queries to a specific shard
• Queries without a shard key are sent to all members
• Each member process its part in parallel.
What's Next?
• Sign up for an online course: https://university.mongodb.com/
• Join a MUG: https://www.meetup.com/pro/mongodb/
Próximo Webinar
¿¿Conceptos Avanzados??
• Nos quedan muchas cosas por compartir
• Índices Geográficos y de Texto Libre
• Seguridad
• Conectores de BI y Big Data
• Motores de Almacenamiento
• Y mucho más…
• Manténgase atento:
• Denos su opinión, por favor: back-to-basics@mongodb.com
¿Preguntas?
Back to Basics Spanish 4 Introduction to sharding

More Related Content

What's hot (20)

PPTX
Introducción a NoSQL
MongoDB
 
PPTX
Back to Basics, webinar 2: La tua prima applicazione MongoDB
MongoDB
 
PPTX
Conceptos básicos. seminario web 3 : Diseño de esquema pensado para documentos
MongoDB
 
PPTX
Sharding
MongoDB
 
PPTX
Back to Basics: My First MongoDB Application
MongoDB
 
PPT
Mongo Web Apps: OSCON 2011
rogerbodamer
 
ODP
MongoDB - Ekino PHP
Florent DENIS
 
PPTX
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
MongoDB
 
PPTX
Conceptos básicos. Seminario web 5: Introducción a Aggregation Framework
MongoDB
 
PPTX
High Performance Applications with MongoDB
MongoDB
 
PDF
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB
 
PDF
10 Key MongoDB Performance Indicators
iammutex
 
PPTX
Webinar: Getting Started with MongoDB - Back to Basics
MongoDB
 
PPTX
Back to Basics 2017: Introduction to Sharding
MongoDB
 
PPTX
Webinar Back to Basics 3 - Introduzione ai Replica Set
MongoDB
 
PDF
MongoDB World 2016: From the Polls to the Trolls: Seeing What the World Think...
MongoDB
 
ODP
MongoDB : The Definitive Guide
Wildan Maulana
 
PDF
Шардинг в MongoDB, Henrik Ingo (MongoDB)
Ontico
 
PPTX
Back to Basics Webinar 1: Introduction to NoSQL
MongoDB
 
PDF
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
MongoDB
 
Introducción a NoSQL
MongoDB
 
Back to Basics, webinar 2: La tua prima applicazione MongoDB
MongoDB
 
Conceptos básicos. seminario web 3 : Diseño de esquema pensado para documentos
MongoDB
 
Sharding
MongoDB
 
Back to Basics: My First MongoDB Application
MongoDB
 
Mongo Web Apps: OSCON 2011
rogerbodamer
 
MongoDB - Ekino PHP
Florent DENIS
 
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
MongoDB
 
Conceptos básicos. Seminario web 5: Introducción a Aggregation Framework
MongoDB
 
High Performance Applications with MongoDB
MongoDB
 
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB
 
10 Key MongoDB Performance Indicators
iammutex
 
Webinar: Getting Started with MongoDB - Back to Basics
MongoDB
 
Back to Basics 2017: Introduction to Sharding
MongoDB
 
Webinar Back to Basics 3 - Introduzione ai Replica Set
MongoDB
 
MongoDB World 2016: From the Polls to the Trolls: Seeing What the World Think...
MongoDB
 
MongoDB : The Definitive Guide
Wildan Maulana
 
Шардинг в MongoDB, Henrik Ingo (MongoDB)
Ontico
 
Back to Basics Webinar 1: Introduction to NoSQL
MongoDB
 
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
MongoDB
 

Similar to Back to Basics Spanish 4 Introduction to sharding (20)

PDF
Sharding
MongoDB
 
PPTX
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB
 
PPTX
Sharding
MongoDB
 
KEY
Mongodb sharding
xiangrong
 
PPTX
Introduction to Sharding
MongoDB
 
PPTX
Introduction to Sharding
MongoDB
 
PPTX
Webinar: Sharding
MongoDB
 
PPTX
Sharding - Seoul 2012
MongoDB
 
PDF
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops Team
Mydbops
 
PPTX
Conceptos básicos. Seminario web 6: Despliegue de producción
MongoDB
 
KEY
Sharding with MongoDB (Eliot Horowitz)
MongoSF
 
PPTX
Basic Sharding in MongoDB presented by Shaun Verch
MongoDB
 
PDF
Sharding in MongoDB Days 2013
Randall Hunt
 
KEY
Scaling MongoDB (Mongo Austin)
MongoDB
 
KEY
2011 mongo sf-scaling
MongoDB
 
PPTX
Back to Basics German 3: Einführung ins Sharding
MongoDB
 
KEY
The Care + Feeding of a Mongodb Cluster
Chris Henry
 
PPTX
DBVersity MongoDB Online Training Presentations
Srinivas Mutyala
 
PPT
2011 mongo FR - scaling with mongodb
antoinegirbal
 
KEY
Sharding with MongoDB (Eliot Horowitz)
MongoDB
 
Sharding
MongoDB
 
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB
 
Sharding
MongoDB
 
Mongodb sharding
xiangrong
 
Introduction to Sharding
MongoDB
 
Introduction to Sharding
MongoDB
 
Webinar: Sharding
MongoDB
 
Sharding - Seoul 2012
MongoDB
 
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops Team
Mydbops
 
Conceptos básicos. Seminario web 6: Despliegue de producción
MongoDB
 
Sharding with MongoDB (Eliot Horowitz)
MongoSF
 
Basic Sharding in MongoDB presented by Shaun Verch
MongoDB
 
Sharding in MongoDB Days 2013
Randall Hunt
 
Scaling MongoDB (Mongo Austin)
MongoDB
 
2011 mongo sf-scaling
MongoDB
 
Back to Basics German 3: Einführung ins Sharding
MongoDB
 
The Care + Feeding of a Mongodb Cluster
Chris Henry
 
DBVersity MongoDB Online Training Presentations
Srinivas Mutyala
 
2011 mongo FR - scaling with mongodb
antoinegirbal
 
Sharding with MongoDB (Eliot Horowitz)
MongoDB
 
Ad

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB
 
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB
 
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB
 
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB
 
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB
 
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB
 
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB
 
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB
 
Ad

Recently uploaded (20)

PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 

Back to Basics Spanish 4 Introduction to sharding

Editor's Notes

  • #4: Who I am, how long have I been at MongoDB.
  • #5: Delighted to have you here. Hope you can make it to all the sessions. Sessions will be recorded so we can send them out afterwards so don’t worry if you miss one. If you have questions please pop them in the sidebar.
  • #21: Once chunk size is reached, mongos asks mongod to split a chunk + internal function called splitVector() mongod counts number of documents on each side of split + based on avg. document size `db.stats()` Chunk split is a **logical** operation (no data has moved) Max on first chunk should be 14
  • #23: Balancer is running on mongos Once the difference in chunks between the most dense shard and the least dense shard is above the migration threshold, a balancing round starts