SlideShare a Scribd company logo
NoSQL Infrastructure
~3333 write ops/s 0.07 - 0.05 ms response
David Mytton
Woop Japan!
NoSQL Infrastructure
MongoDB at Server Density
•27 nodes
MongoDB at Server Density
• June 2009 - 4yrs
•27 nodes
MongoDB at Server Density
•MySQL -> MongoDB
•27 nodes
MongoDB at Server Density
• June 2009 - 4yrs
•MySQL -> MongoDB
•20TB data per month
•27 nodes
MongoDB at Server Density
• June 2009 - 4yrs
Why?
Why?
• Replication
Why?
• Replication
• Official drivers
Why?
• Replication
• Official drivers
• Easy deployment
Why?
• Replication
• Official drivers
• Easy deployment
• Fast out of the box
It’s a little different.
Picture is unrelated! Mmm, ice cream.
• Fast network
Performance
• Fast network
Performance
EC2 10 Gigabit Ethernet
- Cluster Compute
- High Memory Cluster
- Cluster GPU
- High I/O
- High Storage
• Fast network
Performance
Workload: Read/Write?
Result set size
What is being stored?
• Fast network
Performance
Use Network Throughput
Normal 0-100Mb/s
Replication (Initial Sync) Burst +100Mb/s
Replication (Oplog) 0-100Mb/s
Backup Initial Sync + Oplog
• Fast network
Performance
Inter-DC LAN
• Fast network
Performance
Inter-DC LAN
Cross USA Washington, DC - San Jose, CA
• Fast network
Performance
Location Ping RTT Latency
Within USA 40-80ms
Trans-Atlantic 100ms
Trans-Pacific 150ms
Europe - Japan 300ms
Failover
•Replica sets
Failover
•Replica sets
•Master/slave
Failover
•Replica sets
•Min 3 nodes
•Master/slave
Failover
•Replica sets
•Min 3 nodes
•Master/slave
•Automatic failover
• Replication lag
Performance
Location Ping RTT Latency
Within USA 40-80ms
Trans-Atlantic 100ms
Trans-Pacific 150ms
Europe - Japan 300ms
Replication Lag
1. Reads: eventual consistency
Replication Lag
1. Reads: eventual consistency
2. Failover: slave behind
Eventual Consistency
Stale data
Eventual Consistency
Stale data
Inconsistent data
Eventual Consistency
Stale data
Inconsistent data
Changing data
Eventual Consistency
Use Case Needs consistency?
Graphs No
User profile Yes
Statistics Depends
Alert config Yes
Replication Lag
1. Reads: eventual consistency
2. Failover: slave behind
Slave behind
Failover: out of date master
MongoDB WriteConcern
Changed Nov 27 2012
• Safe by default
>>> from pymongo import MongoClient
>>> connection = MongoClient(w=int/str)
Value Meaning
0 Unsafe
1 Primary
2 Primary + x1 secondary
3 Primary + x2 secondaries
MongoDB WriteConcern
NoSQL Infrastructure
Tags
{
_id : "someSet",
members : [
{_id : 0, host : "A", tags : {"dc": "ny"}},
{_id : 1, host : "B", tags : {"dc": "ny"}},
{_id : 2, host : "C", tags : {"dc": "sf"}},
{_id : 3, host : "D", tags : {"dc": "sf"}},
{_id : 4, host : "E", tags : {"dc": "cloud"}}
]
settings : {
getLastErrorModes : {
veryImportant : {"dc" : 3},
sortOfImportant : {"dc" : 2}
}
}
}
> db.foo.insert({x:1})
> db.runCommand({getLastError : 1, w : "veryImportant"})
{
_id : "someSet",
members : [
{_id : 0, host : "A", tags : {"dc": "ny"}},
{_id : 1, host : "B", tags : {"dc": "ny"}},
{_id : 2, host : "C", tags : {"dc": "sf"}},
{_id : 3, host : "D", tags : {"dc": "sf"}},
{_id : 4, host : "E", tags : {"dc": "cloud"}}
]
settings : {
getLastErrorModes : {
veryImportant : {"dc" : 3},
sortOfImportant : {"dc" : 2}
}
}
}
> db.foo.insert({x:1})
> db.runCommand({getLastError : 1, w : "veryImportant"})
(A or B) + (C or D) + E
Tags
{
_id : "someSet",
members : [
{_id : 0, host : "A", tags : {"dc": "ny"}},
{_id : 1, host : "B", tags : {"dc": "ny"}},
{_id : 2, host : "C", tags : {"dc": "sf"}},
{_id : 3, host : "D", tags : {"dc": "sf"}},
{_id : 4, host : "E", tags : {"dc": "cloud"}}
]
settings : {
getLastErrorModes : {
veryImportant : {"dc" : 3},
sortOfImportant : {"dc" : 2}
}
}
}
> db.foo.insert({x:1})
> db.runCommand({getLastError : 1, w : "sortOfImportant"})
(A + C) or (D + E) ...
Tags
Picture is unrelated! Mmm, ice cream.
• Fast network
•More RAM
Performance
http://www.slideshare.net/jrosoff/mongodb-on-ec2-and-ebs
http://blog.pythonisito.com/2011/12/mongodbs-write-lock.html
http://blog.pythonisito.com/2011/12/mongodbs-write-lock.html
More RAM = expensive
Performance
x2 4GB RAM 12 month Prices
RAM
SSDs
Spinning disk
Cost Speed
Softlayer disk pricing
Performance
EC2 disk/RAM pricing
Performance
$2232/m
$2520/m
$43/m
$295/m
SSD vs Spinning
Performance
SSD vs Spinning
Performance
SSD vs Spinning
Performance
Tips: rand()
•Field names
Tips: rand()
•Field names
•Covered indexes
Tips: rand()
•Field names
•Covered indexes
•Collections / databases
Backups
What is the use case?
Backups
What is the use case?
Fixing user errors?
Point in time restore?
Disaster recovery?
Backups
•Disaster recovery
Offsite
Backups
•Disaster recovery
Age
Offsite
Backups
•Disaster recovery
Age
Offsite
Restore time
Backups
Frequency
Consistency
Verification
www.flickr.com/photos/daddo83/3406962115/
Monitoring
•System
Disk i/o
Disk use
www.flickr.com/photos/daddo83/3406962115/
Monitoring
Disk i/o
Disk use
•System
Swap
www.flickr.com/photos/daddo83/3406962115/
Monitoring
Optime
State
•Replication
mongostat
Monitoring tools
Run yourself
Ganglia
Monitoring tools
www.serverdensity.com/nosql
www.serverdensity.com/nosql
David Mytton
david@serverdensity.com
@davidmytton
Woop Japan!
www.serverdensity.com/nosql

More Related Content

PDF
NoSQL Infrastructure - Late 2013
PDF
Handling 20 billion requests a month
PDF
Tweaking performance on high-load projects
PDF
JEEConf. Vanilla java
PPTX
Back to Basics Webinar 3: Introduction to Replica Sets
PPT
JVM performance options. How it works
PPTX
Performance Tuning and Optimization
PPTX
Back to Basics: My First MongoDB Application
NoSQL Infrastructure - Late 2013
Handling 20 billion requests a month
Tweaking performance on high-load projects
JEEConf. Vanilla java
Back to Basics Webinar 3: Introduction to Replica Sets
JVM performance options. How it works
Performance Tuning and Optimization
Back to Basics: My First MongoDB Application

What's hot (20)

PDF
Latinoware
ODP
MongoDB - Ekino PHP
PPTX
MongoDB-SESSION03
PPT
Introduction to MongoDB
PPTX
MongoDB Shell Tips & Tricks
PDF
mongoDB Performance
PPTX
MongoDB: Comparing WiredTiger In-Memory Engine to Redis
PPTX
Back to Basics, webinar 2: La tua prima applicazione MongoDB
PDF
MongoDB: Optimising for Performance, Scale & Analytics
PPTX
Back to Basics Webinar 5: Introduction to the Aggregation Framework
PPTX
Back to Basics Webinar 1: Introduction to NoSQL
PPTX
Getting Started with MongoDB and NodeJS
ODP
MongoDB : The Definitive Guide
PDF
Python and MongoDB
PPTX
MongoDB - External Authentication
PDF
MongoDB and Python
PPTX
High Performance Applications with MongoDB
KEY
PPTX
Back to Basics Webinar 2: Your First MongoDB Application
PPTX
MongoDB - Sharded Cluster Tutorial
Latinoware
MongoDB - Ekino PHP
MongoDB-SESSION03
Introduction to MongoDB
MongoDB Shell Tips & Tricks
mongoDB Performance
MongoDB: Comparing WiredTiger In-Memory Engine to Redis
Back to Basics, webinar 2: La tua prima applicazione MongoDB
MongoDB: Optimising for Performance, Scale & Analytics
Back to Basics Webinar 5: Introduction to the Aggregation Framework
Back to Basics Webinar 1: Introduction to NoSQL
Getting Started with MongoDB and NodeJS
MongoDB : The Definitive Guide
Python and MongoDB
MongoDB - External Authentication
MongoDB and Python
High Performance Applications with MongoDB
Back to Basics Webinar 2: Your First MongoDB Application
MongoDB - Sharded Cluster Tutorial
Ad

Viewers also liked (19)

PDF
Navigating the customer lifecycle
PDF
Puppet Camp Ghent 2013
PDF
Handling incidents
PDF
StartOps: Growing an ops team from 1 founder
PDF
Experiences from DevOps production: Deployment, performance, failure.
PDF
Puppet Camp 2012
PDF
High performance Infrastructure Oct 2013
PDF
Briefing: Containers
PDF
Remote startup - building a company from everywhere in the world
PDF
Scaling humans - Ops teams and incident management
PDF
DevOps Incident Handling - Making friends not enemies.
PDF
Why puppet? Why now?
PDF
Puppet at the centre of everything
PDF
Infrastructure choices - cloud vs colo vs bare metal
PDF
Flight training for DevOps & HumanOps - IncontroDevOps 2016
PDF
Flight training for DevOps
PDF
Content marketing @ Server Density
PDF
How to monitor NGINX
PDF
How to Monitor MySQL
Navigating the customer lifecycle
Puppet Camp Ghent 2013
Handling incidents
StartOps: Growing an ops team from 1 founder
Experiences from DevOps production: Deployment, performance, failure.
Puppet Camp 2012
High performance Infrastructure Oct 2013
Briefing: Containers
Remote startup - building a company from everywhere in the world
Scaling humans - Ops teams and incident management
DevOps Incident Handling - Making friends not enemies.
Why puppet? Why now?
Puppet at the centre of everything
Infrastructure choices - cloud vs colo vs bare metal
Flight training for DevOps & HumanOps - IncontroDevOps 2016
Flight training for DevOps
Content marketing @ Server Density
How to monitor NGINX
How to Monitor MySQL
Ad

Similar to NoSQL Infrastructure (20)

PDF
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
PPTX
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
PPTX
MongoDB 3.0
PPTX
Back tobasicswebinar part6-rev.
PPTX
Back to Basics: Build Something Big With MongoDB
KEY
Deployment Strategy
PDF
OSDC 2012 | Scaling with MongoDB by Ross Lawley
PDF
Mongo nyc nyt + mongodb
PPTX
Weather of the Century: Design and Performance
PDF
MongoDB: Advantages of an Open Source NoSQL Database
KEY
Deployment Strategies
PPTX
Mongo DB
PDF
Superficial mongo db
PPTX
MongoDB London 2013: Basic Replication in MongoDB presented by Marc Schwering...
PPTX
Python mongo db-training-europython-2011
PPTX
High Performance, Scalable MongoDB in a Bare Metal Cloud
PPT
MongoDB Pros and Cons
PDF
Mongo DB Monitoring - Become a MongoDB DBA
PDF
MongoDB: What, why, when
PDF
MongoDB.pdf
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
MongoDB 3.0
Back tobasicswebinar part6-rev.
Back to Basics: Build Something Big With MongoDB
Deployment Strategy
OSDC 2012 | Scaling with MongoDB by Ross Lawley
Mongo nyc nyt + mongodb
Weather of the Century: Design and Performance
MongoDB: Advantages of an Open Source NoSQL Database
Deployment Strategies
Mongo DB
Superficial mongo db
MongoDB London 2013: Basic Replication in MongoDB presented by Marc Schwering...
Python mongo db-training-europython-2011
High Performance, Scalable MongoDB in a Bare Metal Cloud
MongoDB Pros and Cons
Mongo DB Monitoring - Become a MongoDB DBA
MongoDB: What, why, when
MongoDB.pdf

Recently uploaded (20)

PDF
Getting started with AI Agents and Multi-Agent Systems
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PPTX
Tartificialntelligence_presentation.pptx
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
project resource management chapter-09.pdf
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
August Patch Tuesday
PPTX
Modernising the Digital Integration Hub
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPT
What is a Computer? Input Devices /output devices
Getting started with AI Agents and Multi-Agent Systems
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Module 1.ppt Iot fundamentals and Architecture
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Tartificialntelligence_presentation.pptx
O2C Customer Invoices to Receipt V15A.pptx
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Developing a website for English-speaking practice to English as a foreign la...
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
project resource management chapter-09.pdf
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Programs and apps: productivity, graphics, security and other tools
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
August Patch Tuesday
Modernising the Digital Integration Hub
A novel scalable deep ensemble learning framework for big data classification...
Group 1 Presentation -Planning and Decision Making .pptx
What is a Computer? Input Devices /output devices

NoSQL Infrastructure