SlideShare a Scribd company logo
From Dev to Prod with Sharded Mongo DB Clusters
May 2013
Johan Andersson
Severalnines AB
johan@severalnines.com
Topics
¤  Best Practice Deployment
¤  Keeping it running
¤  Scaling with Shards
Note: Most features mentioned in this presentation are
applicable only on MongoDB 2.2 or later.
2
Copyright 2011 Severalnines AB
3
Copyright 2011 Severalnines AB
“An OS check-up a day keeps downtime away”
Ancient Chinese wisdom
Distributed Computing 101
¤  Network latency is not 0
¤  Network is unreliable
¤  Network bandwidth is not infinite
¤  CPUs are not infinitely fast
¤  Disks are not infinitely fast
¤  Free RAM decreases fast
¤  Virtualization does not make the underlying hardware more
powerful
4
Copyright 2011 Severalnines AB
MongoDB Concepts
¤  Mongos
¤  Query routers, routes queries to shards
¤  Caches data from Config Servers
¤  Config Servers
¤  Records which shard holds what chunks
¤  Shard Servers
¤  Stores the actual data
5
Copyright 2011 Severalnines AB
Developer Setup
¤  A good test setup for a developer:
¤  One or three config Servers
¤  Thee shard servers
¤  One or more Mongos
¤  But do set it up as a shard server so you can validate queries
(explain) to make sure they behave as intended.
¤  Using correct indexes
¤  Vagrant image -
http://alexyu.se/content/2013/03/vagrant-box-severalnines-
database-cluster-deployment-scripts
6
Copyright 2011 Severalnines AB
Test Setup
¤  Recommendations
¤  One or three config Servers
¤  >1 shard - thee shard servers
¤  One or more Mongos
¤  Stay close to your production system.
¤  Two shards (even if prod use one only) allows you to:
¤  Verify queries use the correct indexes
¤  Check if one or all shards are hit
¤  Extremely useful when adding shards to Prod to avoid
performance regression.
7
Copyright 2011 Severalnines AB
Production Setup
¤  Start with a good and sound architecture from day one!
¤  A sharded architecture will allow you to scale easily
¤  Avoid un-necessary craziness and risk to switch a non-
sharded setup to a sharded
¤  You do want three copies of your data
8
Copyright 2011 Severalnines AB
Production Setup
9
Copyright 2011 Severalnines AB
PRIMARY SECONDARY
repl
Production Setup
10
Copyright 2011 Severalnines AB
Hard to scale, too crowded
Go for Best Practice instead
PRIMARY SECONDARY
repl
Production Setup
11
Copyright 2011 Severalnines AB
…
Shard0 Shard1 ShardN
…
Production Setup
¤  Allows you to scale - Add more shards and mongos easily
¤  It is proven – used by many large organizations
¤  Deploy…
¤  Mongos
¤  Config servers
¤  Shard servers (mongod --shardsvr)
¤  … on individual servers
12
Copyright 2011 Severalnines AB
When processes fails
¤  Config Server process fails
¤  If one config server fails, no chunk migration between shards
¤  No chunk splitting
¤  Shards are still read/writeable
¤  Mongos fails
¤  You will have many
¤  Shard server fails
¤  If PRIMARY fails à One SECONDARY will become PRIMARY
¤  If SECONDADY fails à Restart and it will resync with PRIMARY
¤  Restart the failed process!
¤  Troll the logs to see it starts without errors
13
Copyright 2011 Severalnines AB
Keeping it running
¤  RAM is a scarce resource – keep as much as possible in it!
¤  Use short field names in the Documents to reduce size:
¤  { first_name:’not good’}
¤  {fn:’better’}
¤  Important when you have many Documents
¤  Compact collections:
¤  Run on SECONDARY
¤  db.mycollection.runCommand(“compact”)
¤  Stop PRIMARY, SECONDARY becomes new PRIMARY.
14
Copyright 2011 Severalnines AB
Keeping it running
¤  Replication Lag
¤  Producer / Consumer problem
¤  Temporary or Permanent Problem?
¤  Permanent problem
¤  Expunge the oplog?
¤  Magic wand?
¤  Disk, network, or load-dependent problem?
¤  Remedy:
¤  Faster disks: Improve disk subsystem -> IOPS or SSD, RAID configuration
¤  Faster CPUs
¤  Can you reduce writes to the shard(s)?
¤  Scale with shards
15
Copyright 2011 Severalnines AB
Keeping it running
¤  Page Faults
¤  MongoDB uses mmap:ed files, allocated from the VMM address space.
Mmapped files does not need to fit in RAM
¤  OS manages what pages are mapped in RAM and not
¤  Accessing data on a page not in RAM cause a page fault
¤  Data will be loaded from DISK
¤  DISK is slow
¤  Performance will degrade
¤  If the number of PFs is constant, no worry, else if increasing, problem in the
horizon.
¤  Remedy:
¤  Increase RAM in server (Active working set should fit in RAM)
¤  Scale with shards
¤  Add SSD
16
Copyright 2011 Severalnines AB
Not cool
17
Copyright 2011 Severalnines AB
Not cool
18
Copyright 2011 Severalnines AB
You are done for!
19
Copyright 2011 Severalnines AB
Avoid the situation
¤  Keep data set in RAM
¤  Use fast io-subsystem since OS is managing the paging
¤  SSD
¤  IOPS on EC2
¤  Make sure the Host OS (Virtualized env) does not swap.
¤  Lock mongod’s to CPUs, check /etc/interrupts, bind to CPUs
not handling ETH interrupts, avoids ctx switching.
¤  Add shards before its too late
¤  More disks/CPUs,RAM to handle the load
Copyright 2011 Severalnines AB
20
Scaling with Shards
¤  Shard Keys
¤  When to scale?
¤  Add a shard
21
Copyright 2011 Severalnines AB
Database Size
¤  db.stats()
¤  Size of one db = dbStats.dataSize + dbStats.indexSize
¤  Does it fit in RAM?
¤  Plan ahead:
¤  avgObjSize x expectedNoOfDocuments
¤  Does it fit in RAM?
¤  How many documents can you store?
22
Copyright 2011 Severalnines AB
Working set
¤  Working Set Analyzer in 2.4 helps:
!"workingSet" : {!
! !"note" : "thisIsAnEstimate",!
! !"pagesInMemory" : 33688, //4KB pg_size!
! !"computationTimeMicros" : 15283,!
! !"overSeconds" : 1923 //dist pg_new to pg_oldest

},!
¤  Trend overSeconds and pagesInMemory
23
Copyright 2011 Severalnines AB
Shard Key
¤  Collections must have a Shard Key
¤  The shard key must be indexed
¤  Hash-based or Range based Sharding
¤  Hash-bashed great for exact match
¤  Subscriber/user databases
¤  Queries must use the shard key
¤  If not, all shards will be queried à slow
¤  Check and verify with .explain()
24
Copyright 2011 Severalnines AB
Adding Shards
¤  Adding a new Shard is easy:
¤  Deploy a new Replica-set:
¤  PRIMARY - 192.168.0.151
SECONDARY - 192.168.0.152
SECONDARY - 192.168.0.153
¤  Register the Replica Set:
¤  sh.addShard(“myshard2/192.168.0.151:27017”);
¤  Finding the time to add shards is harder
¤  Rebalancing costs and query performance will suffer due to
chunk migration.
¤  Do it off-peak if possible
¤  MongoDB will automatically rebalance the shards.
25
Copyright 2011 Severalnines AB
Q&A
26
Copyright 2011 Severalnines AB
Resources
27
Copyright 2011 Severalnines AB
¤  MongoDB Configurator
http://www.severalnines.com/mongodb-configurator/
¤  -ClusterControl for MongoDB
http://www.severalnines.com/resources/cmon-mongodb-
cluster-management-monitoring-tool
¤  Installing ClusterControl on top of existing MongoDB Cluster
http://www.severalnines.com/blog/install-clustercontrol-top-
existing-mongodb-sharded-cluster
¤  Vagrant image -
http://alexyu.se/content/2013/03/vagrant-box-severalnines-
database-cluster-deployment-scripts
Follow us on
28
Copyright 2011 Severalnines AB
¤  Twitter : @severalnines
¤  Facebook: www.facebook.com/severalnines
¤  Slideshare : www.slideshare.net/severalnines
¤  Linked-in: www.linkedin.com/company/severalnines
Thank you!
29
Copyright 2011 Severalnines AB

More Related Content

What's hot

Date-tiered Compaction Policy for Time-series Data
Date-tiered Compaction Policy for Time-series DataDate-tiered Compaction Policy for Time-series Data
Date-tiered Compaction Policy for Time-series Data
HBaseCon
 
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB
 
Cassandra TK 2014 - Large Nodes
Cassandra TK 2014 - Large NodesCassandra TK 2014 - Large Nodes
Cassandra TK 2014 - Large Nodes
aaronmorton
 
Understanding and tuning WiredTiger, the new high performance database engine...
Understanding and tuning WiredTiger, the new high performance database engine...Understanding and tuning WiredTiger, the new high performance database engine...
Understanding and tuning WiredTiger, the new high performance database engine...
Ontico
 
Managing Cassandra at Scale by Al Tobey
Managing Cassandra at Scale by Al TobeyManaging Cassandra at Scale by Al Tobey
Managing Cassandra at Scale by Al Tobey
DataStax Academy
 
Basic Sharding in MongoDB presented by Shaun Verch
Basic Sharding in MongoDB presented by Shaun VerchBasic Sharding in MongoDB presented by Shaun Verch
Basic Sharding in MongoDB presented by Shaun Verch
MongoDB
 
Scaling Cassandra for Big Data
Scaling Cassandra for Big DataScaling Cassandra for Big Data
Scaling Cassandra for Big Data
DataStax Academy
 
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
DataStax Academy
 
Optimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at LocalyticsOptimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at Localytics
Benjamin Darfler
 
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
DataStax
 
Keynote: Apache HBase at Yahoo! Scale
Keynote: Apache HBase at Yahoo! ScaleKeynote: Apache HBase at Yahoo! Scale
Keynote: Apache HBase at Yahoo! Scale
HBaseCon
 
Sharding with MongoDB (Eliot Horowitz)
Sharding with MongoDB (Eliot Horowitz)Sharding with MongoDB (Eliot Horowitz)
Sharding with MongoDB (Eliot Horowitz)
MongoSF
 
Performance tuning - A key to successful cassandra migration
Performance tuning - A key to successful cassandra migrationPerformance tuning - A key to successful cassandra migration
Performance tuning - A key to successful cassandra migration
Ramkumar Nottath
 
Really Big Elephants: PostgreSQL DW
Really Big Elephants: PostgreSQL DWReally Big Elephants: PostgreSQL DW
Really Big Elephants: PostgreSQL DW
PostgreSQL Experts, Inc.
 
Troubleshooting redis
Troubleshooting redisTroubleshooting redis
Troubleshooting redis
DaeMyung Kang
 
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops Team
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops TeamEvolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops Team
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops Team
Mydbops
 
A Detailed Look At cassandra.yaml (Edward Capriolo, The Last Pickle) | Cassan...
A Detailed Look At cassandra.yaml (Edward Capriolo, The Last Pickle) | Cassan...A Detailed Look At cassandra.yaml (Edward Capriolo, The Last Pickle) | Cassan...
A Detailed Look At cassandra.yaml (Edward Capriolo, The Last Pickle) | Cassan...
DataStax
 
Mongodb - Scaling write performance
Mongodb - Scaling write performanceMongodb - Scaling write performance
Mongodb - Scaling write performance
Daum DNA
 
Tales from Taming the Long Tail
Tales from Taming the Long TailTales from Taming the Long Tail
Tales from Taming the Long Tail
HBaseCon
 
Deploying postgre sql on amazon ec2
Deploying postgre sql on amazon ec2 Deploying postgre sql on amazon ec2
Deploying postgre sql on amazon ec2
Denish Patel
 

What's hot (20)

Date-tiered Compaction Policy for Time-series Data
Date-tiered Compaction Policy for Time-series DataDate-tiered Compaction Policy for Time-series Data
Date-tiered Compaction Policy for Time-series Data
 
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
 
Cassandra TK 2014 - Large Nodes
Cassandra TK 2014 - Large NodesCassandra TK 2014 - Large Nodes
Cassandra TK 2014 - Large Nodes
 
Understanding and tuning WiredTiger, the new high performance database engine...
Understanding and tuning WiredTiger, the new high performance database engine...Understanding and tuning WiredTiger, the new high performance database engine...
Understanding and tuning WiredTiger, the new high performance database engine...
 
Managing Cassandra at Scale by Al Tobey
Managing Cassandra at Scale by Al TobeyManaging Cassandra at Scale by Al Tobey
Managing Cassandra at Scale by Al Tobey
 
Basic Sharding in MongoDB presented by Shaun Verch
Basic Sharding in MongoDB presented by Shaun VerchBasic Sharding in MongoDB presented by Shaun Verch
Basic Sharding in MongoDB presented by Shaun Verch
 
Scaling Cassandra for Big Data
Scaling Cassandra for Big DataScaling Cassandra for Big Data
Scaling Cassandra for Big Data
 
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
 
Optimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at LocalyticsOptimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at Localytics
 
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
 
Keynote: Apache HBase at Yahoo! Scale
Keynote: Apache HBase at Yahoo! ScaleKeynote: Apache HBase at Yahoo! Scale
Keynote: Apache HBase at Yahoo! Scale
 
Sharding with MongoDB (Eliot Horowitz)
Sharding with MongoDB (Eliot Horowitz)Sharding with MongoDB (Eliot Horowitz)
Sharding with MongoDB (Eliot Horowitz)
 
Performance tuning - A key to successful cassandra migration
Performance tuning - A key to successful cassandra migrationPerformance tuning - A key to successful cassandra migration
Performance tuning - A key to successful cassandra migration
 
Really Big Elephants: PostgreSQL DW
Really Big Elephants: PostgreSQL DWReally Big Elephants: PostgreSQL DW
Really Big Elephants: PostgreSQL DW
 
Troubleshooting redis
Troubleshooting redisTroubleshooting redis
Troubleshooting redis
 
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops Team
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops TeamEvolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops Team
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops Team
 
A Detailed Look At cassandra.yaml (Edward Capriolo, The Last Pickle) | Cassan...
A Detailed Look At cassandra.yaml (Edward Capriolo, The Last Pickle) | Cassan...A Detailed Look At cassandra.yaml (Edward Capriolo, The Last Pickle) | Cassan...
A Detailed Look At cassandra.yaml (Edward Capriolo, The Last Pickle) | Cassan...
 
Mongodb - Scaling write performance
Mongodb - Scaling write performanceMongodb - Scaling write performance
Mongodb - Scaling write performance
 
Tales from Taming the Long Tail
Tales from Taming the Long TailTales from Taming the Long Tail
Tales from Taming the Long Tail
 
Deploying postgre sql on amazon ec2
Deploying postgre sql on amazon ec2 Deploying postgre sql on amazon ec2
Deploying postgre sql on amazon ec2
 

Similar to Development to Production with Sharded MongoDB Clusters

Ceph Day Shanghai - SSD/NVM Technology Boosting Ceph Performance
Ceph Day Shanghai - SSD/NVM Technology Boosting Ceph Performance Ceph Day Shanghai - SSD/NVM Technology Boosting Ceph Performance
Ceph Day Shanghai - SSD/NVM Technology Boosting Ceph Performance
Ceph Community
 
Getting The Most Out Of Your Flash/SSDs
Getting The Most Out Of Your Flash/SSDsGetting The Most Out Of Your Flash/SSDs
Getting The Most Out Of Your Flash/SSDs
Aerospike, Inc.
 
Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community
 
Severalnines Training: MySQL® Cluster - Part IX
Severalnines Training: MySQL® Cluster - Part IXSeveralnines Training: MySQL® Cluster - Part IX
Severalnines Training: MySQL® Cluster - Part IX
Severalnines
 
Delivering Apache Hadoop for the Modern Data Architecture
Delivering Apache Hadoop for the Modern Data Architecture Delivering Apache Hadoop for the Modern Data Architecture
Delivering Apache Hadoop for the Modern Data Architecture
Hortonworks
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Odinot Stanislas
 
Ceph
CephCeph
Performance Whack-a-Mole Tutorial (pgCon 2009)
Performance Whack-a-Mole Tutorial (pgCon 2009) Performance Whack-a-Mole Tutorial (pgCon 2009)
Performance Whack-a-Mole Tutorial (pgCon 2009)
PostgreSQL Experts, Inc.
 
SQLintersection keynote a tale of two teams
SQLintersection keynote a tale of two teamsSQLintersection keynote a tale of two teams
SQLintersection keynote a tale of two teams
Sumeet Bansal
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
Ross Lawley
 
Why does my choice of storage matter with cassandra?
Why does my choice of storage matter with cassandra?Why does my choice of storage matter with cassandra?
Why does my choice of storage matter with cassandra?
Johnny Miller
 
Using ТРСС to study Firebird performance
Using ТРСС to study Firebird performanceUsing ТРСС to study Firebird performance
Using ТРСС to study Firebird performance
Mind The Firebird
 
Five steps perform_2009 (1)
Five steps perform_2009 (1)Five steps perform_2009 (1)
Five steps perform_2009 (1)
PostgreSQL Experts, Inc.
 
5 Steps to PostgreSQL Performance
5 Steps to PostgreSQL Performance5 Steps to PostgreSQL Performance
5 Steps to PostgreSQL Performance
Command Prompt., Inc
 
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
VMworld
 
QCon2016--Drive Best Spark Performance on AI
QCon2016--Drive Best Spark Performance on AIQCon2016--Drive Best Spark Performance on AI
QCon2016--Drive Best Spark Performance on AI
Lex Yu
 
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
Severalnines
 
Presentation architecting a cloud infrastructure
Presentation   architecting a cloud infrastructurePresentation   architecting a cloud infrastructure
Presentation architecting a cloud infrastructure
solarisyourep
 
Presentation architecting a cloud infrastructure
Presentation   architecting a cloud infrastructurePresentation   architecting a cloud infrastructure
Presentation architecting a cloud infrastructure
xKinAnx
 
MySQL Tuning
MySQL TuningMySQL Tuning
MySQL Tuning
Ford AntiTrust
 

Similar to Development to Production with Sharded MongoDB Clusters (20)

Ceph Day Shanghai - SSD/NVM Technology Boosting Ceph Performance
Ceph Day Shanghai - SSD/NVM Technology Boosting Ceph Performance Ceph Day Shanghai - SSD/NVM Technology Boosting Ceph Performance
Ceph Day Shanghai - SSD/NVM Technology Boosting Ceph Performance
 
Getting The Most Out Of Your Flash/SSDs
Getting The Most Out Of Your Flash/SSDsGetting The Most Out Of Your Flash/SSDs
Getting The Most Out Of Your Flash/SSDs
 
Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph
 
Severalnines Training: MySQL® Cluster - Part IX
Severalnines Training: MySQL® Cluster - Part IXSeveralnines Training: MySQL® Cluster - Part IX
Severalnines Training: MySQL® Cluster - Part IX
 
Delivering Apache Hadoop for the Modern Data Architecture
Delivering Apache Hadoop for the Modern Data Architecture Delivering Apache Hadoop for the Modern Data Architecture
Delivering Apache Hadoop for the Modern Data Architecture
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
 
Ceph
CephCeph
Ceph
 
Performance Whack-a-Mole Tutorial (pgCon 2009)
Performance Whack-a-Mole Tutorial (pgCon 2009) Performance Whack-a-Mole Tutorial (pgCon 2009)
Performance Whack-a-Mole Tutorial (pgCon 2009)
 
SQLintersection keynote a tale of two teams
SQLintersection keynote a tale of two teamsSQLintersection keynote a tale of two teams
SQLintersection keynote a tale of two teams
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
 
Why does my choice of storage matter with cassandra?
Why does my choice of storage matter with cassandra?Why does my choice of storage matter with cassandra?
Why does my choice of storage matter with cassandra?
 
Using ТРСС to study Firebird performance
Using ТРСС to study Firebird performanceUsing ТРСС to study Firebird performance
Using ТРСС to study Firebird performance
 
Five steps perform_2009 (1)
Five steps perform_2009 (1)Five steps perform_2009 (1)
Five steps perform_2009 (1)
 
5 Steps to PostgreSQL Performance
5 Steps to PostgreSQL Performance5 Steps to PostgreSQL Performance
5 Steps to PostgreSQL Performance
 
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
 
QCon2016--Drive Best Spark Performance on AI
QCon2016--Drive Best Spark Performance on AIQCon2016--Drive Best Spark Performance on AI
QCon2016--Drive Best Spark Performance on AI
 
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
 
Presentation architecting a cloud infrastructure
Presentation   architecting a cloud infrastructurePresentation   architecting a cloud infrastructure
Presentation architecting a cloud infrastructure
 
Presentation architecting a cloud infrastructure
Presentation   architecting a cloud infrastructurePresentation   architecting a cloud infrastructure
Presentation architecting a cloud infrastructure
 
MySQL Tuning
MySQL TuningMySQL Tuning
MySQL Tuning
 

More from Severalnines

WEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service ProvidersWEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service Providers
Severalnines
 
LIVE DEMO: CCX for CSPs, a drop-in DBaaS solution
LIVE DEMO: CCX for CSPs, a drop-in DBaaS solutionLIVE DEMO: CCX for CSPs, a drop-in DBaaS solution
LIVE DEMO: CCX for CSPs, a drop-in DBaaS solution
Severalnines
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
DIY DBaaS: A guide to building your own full-featured DBaaS
DIY DBaaS: A guide to building your own full-featured DBaaSDIY DBaaS: A guide to building your own full-featured DBaaS
DIY DBaaS: A guide to building your own full-featured DBaaS
Severalnines
 
Cloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSCloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaS
Severalnines
 
Tips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudTips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloud
Severalnines
 
Working with the Moodle Database: The Basics
Working with the Moodle Database: The BasicsWorking with the Moodle Database: The Basics
Working with the Moodle Database: The Basics
Severalnines
 
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
Severalnines
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
Severalnines
 
Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDB
Severalnines
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Severalnines
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Severalnines
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Severalnines
 
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDB
Severalnines
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash Course
Severalnines
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDB
Severalnines
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerAdvanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona Server
Severalnines
 
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifePolyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Severalnines
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Severalnines
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Severalnines
 

More from Severalnines (20)

WEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service ProvidersWEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service Providers
 
LIVE DEMO: CCX for CSPs, a drop-in DBaaS solution
LIVE DEMO: CCX for CSPs, a drop-in DBaaS solutionLIVE DEMO: CCX for CSPs, a drop-in DBaaS solution
LIVE DEMO: CCX for CSPs, a drop-in DBaaS solution
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
 
DIY DBaaS: A guide to building your own full-featured DBaaS
DIY DBaaS: A guide to building your own full-featured DBaaSDIY DBaaS: A guide to building your own full-featured DBaaS
DIY DBaaS: A guide to building your own full-featured DBaaS
 
Cloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSCloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaS
 
Tips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudTips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloud
 
Working with the Moodle Database: The Basics
Working with the Moodle Database: The BasicsWorking with the Moodle Database: The Basics
Working with the Moodle Database: The Basics
 
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
 
Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDB
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
��
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDB
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash Course
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDB
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerAdvanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona Server
 
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifePolyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
 

Recently uploaded

How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Erasmo Purificato
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Toru Tamaki
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 

Recently uploaded (20)

How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 

Development to Production with Sharded MongoDB Clusters

  • 1. From Dev to Prod with Sharded Mongo DB Clusters May 2013 Johan Andersson Severalnines AB johan@severalnines.com
  • 2. Topics ¤  Best Practice Deployment ¤  Keeping it running ¤  Scaling with Shards Note: Most features mentioned in this presentation are applicable only on MongoDB 2.2 or later. 2 Copyright 2011 Severalnines AB
  • 3. 3 Copyright 2011 Severalnines AB “An OS check-up a day keeps downtime away” Ancient Chinese wisdom
  • 4. Distributed Computing 101 ¤  Network latency is not 0 ¤  Network is unreliable ¤  Network bandwidth is not infinite ¤  CPUs are not infinitely fast ¤  Disks are not infinitely fast ¤  Free RAM decreases fast ¤  Virtualization does not make the underlying hardware more powerful 4 Copyright 2011 Severalnines AB
  • 5. MongoDB Concepts ¤  Mongos ¤  Query routers, routes queries to shards ¤  Caches data from Config Servers ¤  Config Servers ¤  Records which shard holds what chunks ¤  Shard Servers ¤  Stores the actual data 5 Copyright 2011 Severalnines AB
  • 6. Developer Setup ¤  A good test setup for a developer: ¤  One or three config Servers ¤  Thee shard servers ¤  One or more Mongos ¤  But do set it up as a shard server so you can validate queries (explain) to make sure they behave as intended. ¤  Using correct indexes ¤  Vagrant image - http://alexyu.se/content/2013/03/vagrant-box-severalnines- database-cluster-deployment-scripts 6 Copyright 2011 Severalnines AB
  • 7. Test Setup ¤  Recommendations ¤  One or three config Servers ¤  >1 shard - thee shard servers ¤  One or more Mongos ¤  Stay close to your production system. ¤  Two shards (even if prod use one only) allows you to: ¤  Verify queries use the correct indexes ¤  Check if one or all shards are hit ¤  Extremely useful when adding shards to Prod to avoid performance regression. 7 Copyright 2011 Severalnines AB
  • 8. Production Setup ¤  Start with a good and sound architecture from day one! ¤  A sharded architecture will allow you to scale easily ¤  Avoid un-necessary craziness and risk to switch a non- sharded setup to a sharded ¤  You do want three copies of your data 8 Copyright 2011 Severalnines AB
  • 9. Production Setup 9 Copyright 2011 Severalnines AB PRIMARY SECONDARY repl
  • 10. Production Setup 10 Copyright 2011 Severalnines AB Hard to scale, too crowded Go for Best Practice instead PRIMARY SECONDARY repl
  • 11. Production Setup 11 Copyright 2011 Severalnines AB … Shard0 Shard1 ShardN …
  • 12. Production Setup ¤  Allows you to scale - Add more shards and mongos easily ¤  It is proven – used by many large organizations ¤  Deploy… ¤  Mongos ¤  Config servers ¤  Shard servers (mongod --shardsvr) ¤  … on individual servers 12 Copyright 2011 Severalnines AB
  • 13. When processes fails ¤  Config Server process fails ¤  If one config server fails, no chunk migration between shards ¤  No chunk splitting ¤  Shards are still read/writeable ¤  Mongos fails ¤  You will have many ¤  Shard server fails ¤  If PRIMARY fails à One SECONDARY will become PRIMARY ¤  If SECONDADY fails à Restart and it will resync with PRIMARY ¤  Restart the failed process! ¤  Troll the logs to see it starts without errors 13 Copyright 2011 Severalnines AB
  • 14. Keeping it running ¤  RAM is a scarce resource – keep as much as possible in it! ¤  Use short field names in the Documents to reduce size: ¤  { first_name:’not good’} ¤  {fn:’better’} ¤  Important when you have many Documents ¤  Compact collections: ¤  Run on SECONDARY ¤  db.mycollection.runCommand(“compact”) ¤  Stop PRIMARY, SECONDARY becomes new PRIMARY. 14 Copyright 2011 Severalnines AB
  • 15. Keeping it running ¤  Replication Lag ¤  Producer / Consumer problem ¤  Temporary or Permanent Problem? ¤  Permanent problem ¤  Expunge the oplog? ¤  Magic wand? ¤  Disk, network, or load-dependent problem? ¤  Remedy: ¤  Faster disks: Improve disk subsystem -> IOPS or SSD, RAID configuration ¤  Faster CPUs ¤  Can you reduce writes to the shard(s)? ¤  Scale with shards 15 Copyright 2011 Severalnines AB
  • 16. Keeping it running ¤  Page Faults ¤  MongoDB uses mmap:ed files, allocated from the VMM address space. Mmapped files does not need to fit in RAM ¤  OS manages what pages are mapped in RAM and not ¤  Accessing data on a page not in RAM cause a page fault ¤  Data will be loaded from DISK ¤  DISK is slow ¤  Performance will degrade ¤  If the number of PFs is constant, no worry, else if increasing, problem in the horizon. ¤  Remedy: ¤  Increase RAM in server (Active working set should fit in RAM) ¤  Scale with shards ¤  Add SSD 16 Copyright 2011 Severalnines AB
  • 17. Not cool 17 Copyright 2011 Severalnines AB
  • 18. Not cool 18 Copyright 2011 Severalnines AB
  • 19. You are done for! 19 Copyright 2011 Severalnines AB
  • 20. Avoid the situation ¤  Keep data set in RAM ¤  Use fast io-subsystem since OS is managing the paging ¤  SSD ¤  IOPS on EC2 ¤  Make sure the Host OS (Virtualized env) does not swap. ¤  Lock mongod’s to CPUs, check /etc/interrupts, bind to CPUs not handling ETH interrupts, avoids ctx switching. ¤  Add shards before its too late ¤  More disks/CPUs,RAM to handle the load Copyright 2011 Severalnines AB 20
  • 21. Scaling with Shards ¤  Shard Keys ¤  When to scale? ¤  Add a shard 21 Copyright 2011 Severalnines AB
  • 22. Database Size ¤  db.stats() ¤  Size of one db = dbStats.dataSize + dbStats.indexSize ¤  Does it fit in RAM? ¤  Plan ahead: ¤  avgObjSize x expectedNoOfDocuments ¤  Does it fit in RAM? ¤  How many documents can you store? 22 Copyright 2011 Severalnines AB
  • 23. Working set ¤  Working Set Analyzer in 2.4 helps: !"workingSet" : {! ! !"note" : "thisIsAnEstimate",! ! !"pagesInMemory" : 33688, //4KB pg_size! ! !"computationTimeMicros" : 15283,! ! !"overSeconds" : 1923 //dist pg_new to pg_oldest
 },! ¤  Trend overSeconds and pagesInMemory 23 Copyright 2011 Severalnines AB
  • 24. Shard Key ¤  Collections must have a Shard Key ¤  The shard key must be indexed ¤  Hash-based or Range based Sharding ¤  Hash-bashed great for exact match ¤  Subscriber/user databases ¤  Queries must use the shard key ¤  If not, all shards will be queried à slow ¤  Check and verify with .explain() 24 Copyright 2011 Severalnines AB
  • 25. Adding Shards ¤  Adding a new Shard is easy: ¤  Deploy a new Replica-set: ¤  PRIMARY - 192.168.0.151 SECONDARY - 192.168.0.152 SECONDARY - 192.168.0.153 ¤  Register the Replica Set: ¤  sh.addShard(“myshard2/192.168.0.151:27017”); ¤  Finding the time to add shards is harder ¤  Rebalancing costs and query performance will suffer due to chunk migration. ¤  Do it off-peak if possible ¤  MongoDB will automatically rebalance the shards. 25 Copyright 2011 Severalnines AB
  • 27. Resources 27 Copyright 2011 Severalnines AB ¤  MongoDB Configurator http://www.severalnines.com/mongodb-configurator/ ¤  -ClusterControl for MongoDB http://www.severalnines.com/resources/cmon-mongodb- cluster-management-monitoring-tool ¤  Installing ClusterControl on top of existing MongoDB Cluster http://www.severalnines.com/blog/install-clustercontrol-top- existing-mongodb-sharded-cluster ¤  Vagrant image - http://alexyu.se/content/2013/03/vagrant-box-severalnines- database-cluster-deployment-scripts
  • 28. Follow us on 28 Copyright 2011 Severalnines AB ¤  Twitter : @severalnines ¤  Facebook: www.facebook.com/severalnines ¤  Slideshare : www.slideshare.net/severalnines ¤  Linked-in: www.linkedin.com/company/severalnines
  • 29. Thank you! 29 Copyright 2011 Severalnines AB