SlideShare a Scribd company logo
MongoDB:  An IntroductionChris WestinSoftware Engineer, 10gen© Copyright 2010 10gen Inc.
OutlineThe Whys of Non-Relational DatabasesVocabulary of the Non-Relational WorldMongoDB
Why did non-relational databases arise?Problems with relational databases in the web worldThe Whys of Non-Relational Databases
Problem - Schema EvolutionApplications are evolving all the timeApplications need new fieldsApplications need new indexesData is growing – sometimes very fastUsers need to be able to alter their schemas without making their data unavailableThe web world expects 24x7 serviceRDBMSs can have a hard time doing this
Problem – Write RatesReplication is a solution for high read loadsSooner or later, writing becomes a bottleneckSharding – partitioning a logical database across multiple database instancesJoins and aggregation become a problemDistributed transactions are too slow for the webManual management of shardsChoosing shard partitionsRebalancing shards
An introduction to terminology you’re going to be seeing a lotVocabulary of the Non-Relational World
Data ModelsA non-relational database’s data model determines the kinds of items it can contain and how they can be retrievedWhat can the system store, and what does it know about what it contains?The relational data model is about storing records made up of named, scalar-valued fields, as specified by a schema, or type definitionWhat kind of queries can you do?SQL is a manifestation of the kinds of queries that fall out of relational algebra
Non-Relational Data ModelsKey-value storesDocument storesColumn-oriented databasesGraph databases
Key-Value StoresA mapping from a key to a valueThe store doesn’t know anything about the the key or valueThe store doesn’t know anything about the insides of the valueOperationsSet, get, or delete a key-value pair
Document StoresThe store is a container for documentsDocuments are made up of named fieldsFields may or may not have type definitionse.g. XSDs for XML stores, vs. schema-less JSON storesCan create “secondary indexes”These provide the ability to query on any document field(s)Operations:Insert and delete documentsUpdate fields within documents
Column-Oriented StoresLike a relational store, but flipped around: all data for a column is kept togetherAn index provides a means to get a column value for a recordOperations:Get, insert, delete records; updating fieldsStreaming column data in and out of Hadoop
Graph DatabasesStores vertex-to-vertex edgesOperations:Getting and setting edgesSometimes possible to annotate vertices or edgesQuery languages support finding paths between vertices, subject to various constraints
Consistency ModelsRelational databases support transactionsCan only see committed changesCommit/abort span multiple changesRead-only transaction flavorsRead committed, repeatable read, etcClassic assumption: “I’m querying the one-and-only database”Scaling reads and writes introduce different problems
Replication - The 1st Breakdown of Consistency
Limitations of a Single MasterReplication can provide arbitrary read scalabilitySubject to coping with read-consistency issuesSooner or later, writing becomes a bottleneckPhysical limitations (seek time)Throughput of a single I/O subsystem
ShardingParitition the primary key space via hashingSet up a duplicate system for each shardThe write-rate limitation now applies to each shardJoins or aggregation across shards are problematicCan the data be re-sharded on a live system?Can shards be re-balanced on a live system?
Multi-Site OperationFailure of a single-master system’s masterA new master can be chosenBut what if there’s a network partition?Can the application continue in read-only mode?
DynamoNow a generic term for multi-master systemsWrites can occur to any nodeThe same record can be updated on different nodes by different clientsAll writes are replicated everywhere
Dynamo – the 2nd breakdown of consistencyCollisions can occurWho wins?A collision resolution strategy is requiredVector clockshttp://en.wikipedia.org/wiki/Vector_clockApplication access must be aware of this
The Commercial Landscape
Key Client Implementation ConcernsMonotonic readsCan my reads go back in time?Read-your-own-writesIf I issue a query immediately after an insert or update, will I see my changes?Uninterrupted writesAm I always guaranteed the ability to write?Conflict ResolutionDo I need to have a conflict resolution strategy?
Using a Single-Master SystemWhat does the intermediate agent or system do for…Monotonic reads?Read-your-own-writes?Uninterrupted writes?Conflict Resolution?
Using a Multi-Master SystemWhat does the intermediate agent or system do for…Monotonic reads?Read-your-own-writes?Uninterrupted writes?Conflict Resolution?
Where MongoDB fits in the non-relational worldMongoDB’s architecture and featuresSome real-world usersMongoDB
MongoDB is a Document StoreMongoDB stores JSON objects as BSON{ LastName: ‘Flintstone’, FirstName: ‘Fred’, …}Secondary Indexesdb.collection.ensureIndex({LastName : 1, FirstName : 1});Simple QBE-like query syntaxdb.collection.find({LastName : ‘Flintstone’});db.collection.find({LastName : { $gte : ‘Flintstone’});
MongoDB – Advanced QueriesGeo-spatial queriesCreate a geo indexFind points near a given point, sorted by radial distanceCan be planar or sphericalFind points within a certain radial distance, within a bounding box, or a polygonBuilt-in Map-ReduceThe caller provides map and reduce functions written in JavaScript
MongoDB is a Single-Master SystemA database is served by members of a “replica set”The system elects a primary (master)Failure of the master is detected, and a new master is electedApplication writes get an error if there is no quorum to elect a new masterReads continue to be fulfilled
MongoDB Replica Set
MongoDB Supports ShardingA collection can be shardedEach shard is served by its own replica setNew shards (each a replica set) can be added at any timeShard key ranges are automatically balanced
MongoDB – Sharded Deployment
MongoDB Storage ManagementData is kept in memory-mapped filesServers should have a lot of memoryFiles are allocated as neededDocuments in a collection are kept on a list using a geographical addressing schemeIndexes (B*-trees) point to documents using geographical addresses
MongoDB Server ManagementReplica set members are aware of each otherA majority of votes is required to elect a new primaryMembers can be assigned priorities to affect the electione.g., an “invisible” replica can be created with zero priority for backup purposes
MongoDB AccessDrivers are available in many languages10gen supportedC, C# (.Net), C++, Erlang, Haskell, Java, JavaScript, Perl, PHP, Python, Ruby, ScalaCommunity supportedClojure, ColdFusion, F#, Go, Groovy, Lua, Rhttp://www.mongodb.org/display/DOCS/Overview+-+Writing+Drivers+and+Tools
MongoDB AvailabilitySourcehttps://github.com/mongodb/mongoServerLicense:  AGPLhttp://www.mongodb.org/downloadsDriversLicense:  Apachehttp://www.mongodb.org/display/DOCS/Drivers
MongoDB – Hosted Serviceshttp://www.mongodb.org/display/DOCS/Hosting+CenterMongoHQ, Mongo Machine, MongoLabRESTful access to collections
MongoDB SupportPaid Supporthttp://www.10gen.com/client-portal10gen Hosted MonitoringConsulting, trainingFree Supporthttp://groups.google.com/group/mongodb-userhttp://stackoverflow.com/questions/tagged/mongodb
MongoDB Usershttp://www.10gen.com/customershttp://www.10gen.com/presentationscraigslist: http://www.10gen.com/presentation/mongosf2011/craigslistbit.ly: http://blip.tv/mongodb/bit-ly-user-history-auto-sharded-3723147shutterfly: http://www.10gen.com/presentation/mongosv2010/shutterfly
MongoDB:  An Introduction - june-2011
Mini-demo/tutorialhttp://try.mongodb.org/

More Related Content

What's hot (20)

PDF
An introduction to MongoDB
César Trigo
 
PPTX
An Introduction To NoSQL & MongoDB
Lee Theobald
 
PPTX
MongoDB
nikhil2807
 
KEY
Mongodb intro
christkv
 
PPTX
Webinar: What's new in the .NET Driver
MongoDB
 
PDF
Mongodb tutorial at Easylearning Guru
KCC Software Ltd. & Easylearning.guru
 
PDF
Introduction to MongoDB
Mike Dirolf
 
PPTX
Top 10 frameworks of node js
HabileLabs
 
PPT
Introduction to mongoDB
Cuelogic Technologies Pvt. Ltd.
 
PPTX
Basics of MongoDB
HabileLabs
 
PPTX
MongoDB
Tharun Srinivasa
 
PPTX
Introduction to MongoDB
NodeXperts
 
PDF
Mongo db dhruba
Dhrubaji Mandal ♛
 
PPTX
Mongo db
Akshay Mathur
 
PPT
MongoDB Pros and Cons
johnrjenson
 
PPTX
Mongodb basics and architecture
Bishal Khanal
 
PDF
Intro to NoSQL and MongoDB
DATAVERSITY
 
PDF
Non Relational Databases
Chris Baglieri
 
PPTX
Mongo DB
Karan Kukreja
 
An introduction to MongoDB
César Trigo
 
An Introduction To NoSQL & MongoDB
Lee Theobald
 
MongoDB
nikhil2807
 
Mongodb intro
christkv
 
Webinar: What's new in the .NET Driver
MongoDB
 
Mongodb tutorial at Easylearning Guru
KCC Software Ltd. & Easylearning.guru
 
Introduction to MongoDB
Mike Dirolf
 
Top 10 frameworks of node js
HabileLabs
 
Introduction to mongoDB
Cuelogic Technologies Pvt. Ltd.
 
Basics of MongoDB
HabileLabs
 
Introduction to MongoDB
NodeXperts
 
Mongo db dhruba
Dhrubaji Mandal ♛
 
Mongo db
Akshay Mathur
 
MongoDB Pros and Cons
johnrjenson
 
Mongodb basics and architecture
Bishal Khanal
 
Intro to NoSQL and MongoDB
DATAVERSITY
 
Non Relational Databases
Chris Baglieri
 
Mongo DB
Karan Kukreja
 

Viewers also liked (6)

PPTX
Webinar: Introduction to MongoDB 3.0
MongoDB
 
PDF
Introduction to Mongodb
Harun Yardımcı
 
PPTX
SAP ASE 16 SP02 Performance Features
SAP Technology
 
PDF
SpringPeople Introduction to MongoDB Administration
SpringPeople
 
PDF
Mongo DB
Edureka!
 
PDF
Intro To MongoDB
Alex Sharp
 
Webinar: Introduction to MongoDB 3.0
MongoDB
 
Introduction to Mongodb
Harun Yardımcı
 
SAP ASE 16 SP02 Performance Features
SAP Technology
 
SpringPeople Introduction to MongoDB Administration
SpringPeople
 
Mongo DB
Edureka!
 
Intro To MongoDB
Alex Sharp
 
Ad

Similar to MongoDB: An Introduction - june-2011 (20)

PPTX
MongoDB: An Introduction - July 2011
Chris Westin
 
ODP
Front Range PHP NoSQL Databases
Jon Meredith
 
PPTX
MongoDB
Bembeng Arifin
 
PPTX
No sq lv2
Nusrat Sharmin
 
PPTX
CS 542 Parallel DBs, NoSQL, MapReduce
J Singh
 
PPT
2010 mongo berlin-scaling
MongoDB
 
PPTX
Overview of MongoDB and Other Non-Relational Databases
Andrew Kandels
 
PDF
Open source Technology
Amardeep Vishwakarma
 
KEY
MongoDB vs Mysql. A devops point of view
Pierre Baillet
 
PPTX
NoSQL Introduction, Theory, Implementations
Firat Atagun
 
PPT
No SQL Databases as modern database concepts
debasisdas225831
 
PDF
NOSQL in big data is the not only structure langua.pdf
ajajkhan16
 
PDF
NOSQL- Presentation on NoSQL
Ramakant Soni
 
PPTX
MongoDB
fsbrooke
 
PPT
NoSql Databases
Nimat Khattak
 
PPT
05 No SQL Sudarshan.ppt
AnandKonj1
 
PPT
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
sankarapu posibabu
 
PPT
No SQL Databases.ppt
ssuser8c8fc1
 
PPT
MongoDb - Details on the POC
Amardeep Vishwakarma
 
PPTX
No SQL - MongoDB
Mirza Asif
 
MongoDB: An Introduction - July 2011
Chris Westin
 
Front Range PHP NoSQL Databases
Jon Meredith
 
No sq lv2
Nusrat Sharmin
 
CS 542 Parallel DBs, NoSQL, MapReduce
J Singh
 
2010 mongo berlin-scaling
MongoDB
 
Overview of MongoDB and Other Non-Relational Databases
Andrew Kandels
 
Open source Technology
Amardeep Vishwakarma
 
MongoDB vs Mysql. A devops point of view
Pierre Baillet
 
NoSQL Introduction, Theory, Implementations
Firat Atagun
 
No SQL Databases as modern database concepts
debasisdas225831
 
NOSQL in big data is the not only structure langua.pdf
ajajkhan16
 
NOSQL- Presentation on NoSQL
Ramakant Soni
 
MongoDB
fsbrooke
 
NoSql Databases
Nimat Khattak
 
05 No SQL Sudarshan.ppt
AnandKonj1
 
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
sankarapu posibabu
 
No SQL Databases.ppt
ssuser8c8fc1
 
MongoDb - Details on the POC
Amardeep Vishwakarma
 
No SQL - MongoDB
Mirza Asif
 
Ad

More from Chris Westin (20)

PDF
Data torrent meetup-productioneng
Chris Westin
 
PDF
Gripshort
Chris Westin
 
PPTX
Ambari hadoop-ops-meetup-2013-09-19.final
Chris Westin
 
PDF
Cluster management and automation with cloudera manager
Chris Westin
 
PDF
Building low latency java applications with ehcache
Chris Westin
 
PDF
SDN/OpenFlow #lspe
Chris Westin
 
ODP
cfengine3 at #lspe
Chris Westin
 
PPTX
mongodb-aggregation-may-2012
Chris Westin
 
PDF
Nimbula lspe-2012-04-19
Chris Westin
 
PPTX
mongodb-brief-intro-february-2012
Chris Westin
 
PDF
Stingray - Riverbed Technology
Chris Westin
 
PPTX
MongoDB's New Aggregation framework
Chris Westin
 
PPTX
Replication and replica sets
Chris Westin
 
PPTX
Architecting a Scale Out Cloud Storage Solution
Chris Westin
 
PPTX
FlashCache
Chris Westin
 
PPTX
Large Scale Cacti
Chris Westin
 
PPTX
Practical Replication June-2011
Chris Westin
 
PPT
Ganglia Overview-v2
Chris Westin
 
PPTX
MongoDB Aggregation MongoSF May 2011
Chris Westin
 
ODP
Mysql Proxy Presentation Yahoo
Chris Westin
 
Data torrent meetup-productioneng
Chris Westin
 
Gripshort
Chris Westin
 
Ambari hadoop-ops-meetup-2013-09-19.final
Chris Westin
 
Cluster management and automation with cloudera manager
Chris Westin
 
Building low latency java applications with ehcache
Chris Westin
 
SDN/OpenFlow #lspe
Chris Westin
 
cfengine3 at #lspe
Chris Westin
 
mongodb-aggregation-may-2012
Chris Westin
 
Nimbula lspe-2012-04-19
Chris Westin
 
mongodb-brief-intro-february-2012
Chris Westin
 
Stingray - Riverbed Technology
Chris Westin
 
MongoDB's New Aggregation framework
Chris Westin
 
Replication and replica sets
Chris Westin
 
Architecting a Scale Out Cloud Storage Solution
Chris Westin
 
FlashCache
Chris Westin
 
Large Scale Cacti
Chris Westin
 
Practical Replication June-2011
Chris Westin
 
Ganglia Overview-v2
Chris Westin
 
MongoDB Aggregation MongoSF May 2011
Chris Westin
 
Mysql Proxy Presentation Yahoo
Chris Westin
 

Recently uploaded (20)

PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 

MongoDB: An Introduction - june-2011

  • 1. MongoDB: An IntroductionChris WestinSoftware Engineer, 10gen© Copyright 2010 10gen Inc.
  • 2. OutlineThe Whys of Non-Relational DatabasesVocabulary of the Non-Relational WorldMongoDB
  • 3. Why did non-relational databases arise?Problems with relational databases in the web worldThe Whys of Non-Relational Databases
  • 4. Problem - Schema EvolutionApplications are evolving all the timeApplications need new fieldsApplications need new indexesData is growing – sometimes very fastUsers need to be able to alter their schemas without making their data unavailableThe web world expects 24x7 serviceRDBMSs can have a hard time doing this
  • 5. Problem – Write RatesReplication is a solution for high read loadsSooner or later, writing becomes a bottleneckSharding – partitioning a logical database across multiple database instancesJoins and aggregation become a problemDistributed transactions are too slow for the webManual management of shardsChoosing shard partitionsRebalancing shards
  • 6. An introduction to terminology you’re going to be seeing a lotVocabulary of the Non-Relational World
  • 7. Data ModelsA non-relational database’s data model determines the kinds of items it can contain and how they can be retrievedWhat can the system store, and what does it know about what it contains?The relational data model is about storing records made up of named, scalar-valued fields, as specified by a schema, or type definitionWhat kind of queries can you do?SQL is a manifestation of the kinds of queries that fall out of relational algebra
  • 8. Non-Relational Data ModelsKey-value storesDocument storesColumn-oriented databasesGraph databases
  • 9. Key-Value StoresA mapping from a key to a valueThe store doesn’t know anything about the the key or valueThe store doesn’t know anything about the insides of the valueOperationsSet, get, or delete a key-value pair
  • 10. Document StoresThe store is a container for documentsDocuments are made up of named fieldsFields may or may not have type definitionse.g. XSDs for XML stores, vs. schema-less JSON storesCan create “secondary indexes”These provide the ability to query on any document field(s)Operations:Insert and delete documentsUpdate fields within documents
  • 11. Column-Oriented StoresLike a relational store, but flipped around: all data for a column is kept togetherAn index provides a means to get a column value for a recordOperations:Get, insert, delete records; updating fieldsStreaming column data in and out of Hadoop
  • 12. Graph DatabasesStores vertex-to-vertex edgesOperations:Getting and setting edgesSometimes possible to annotate vertices or edgesQuery languages support finding paths between vertices, subject to various constraints
  • 13. Consistency ModelsRelational databases support transactionsCan only see committed changesCommit/abort span multiple changesRead-only transaction flavorsRead committed, repeatable read, etcClassic assumption: “I’m querying the one-and-only database”Scaling reads and writes introduce different problems
  • 14. Replication - The 1st Breakdown of Consistency
  • 15. Limitations of a Single MasterReplication can provide arbitrary read scalabilitySubject to coping with read-consistency issuesSooner or later, writing becomes a bottleneckPhysical limitations (seek time)Throughput of a single I/O subsystem
  • 16. ShardingParitition the primary key space via hashingSet up a duplicate system for each shardThe write-rate limitation now applies to each shardJoins or aggregation across shards are problematicCan the data be re-sharded on a live system?Can shards be re-balanced on a live system?
  • 17. Multi-Site OperationFailure of a single-master system’s masterA new master can be chosenBut what if there’s a network partition?Can the application continue in read-only mode?
  • 18. DynamoNow a generic term for multi-master systemsWrites can occur to any nodeThe same record can be updated on different nodes by different clientsAll writes are replicated everywhere
  • 19. Dynamo – the 2nd breakdown of consistencyCollisions can occurWho wins?A collision resolution strategy is requiredVector clockshttp://en.wikipedia.org/wiki/Vector_clockApplication access must be aware of this
  • 21. Key Client Implementation ConcernsMonotonic readsCan my reads go back in time?Read-your-own-writesIf I issue a query immediately after an insert or update, will I see my changes?Uninterrupted writesAm I always guaranteed the ability to write?Conflict ResolutionDo I need to have a conflict resolution strategy?
  • 22. Using a Single-Master SystemWhat does the intermediate agent or system do for…Monotonic reads?Read-your-own-writes?Uninterrupted writes?Conflict Resolution?
  • 23. Using a Multi-Master SystemWhat does the intermediate agent or system do for…Monotonic reads?Read-your-own-writes?Uninterrupted writes?Conflict Resolution?
  • 24. Where MongoDB fits in the non-relational worldMongoDB’s architecture and featuresSome real-world usersMongoDB
  • 25. MongoDB is a Document StoreMongoDB stores JSON objects as BSON{ LastName: ‘Flintstone’, FirstName: ‘Fred’, …}Secondary Indexesdb.collection.ensureIndex({LastName : 1, FirstName : 1});Simple QBE-like query syntaxdb.collection.find({LastName : ‘Flintstone’});db.collection.find({LastName : { $gte : ‘Flintstone’});
  • 26. MongoDB – Advanced QueriesGeo-spatial queriesCreate a geo indexFind points near a given point, sorted by radial distanceCan be planar or sphericalFind points within a certain radial distance, within a bounding box, or a polygonBuilt-in Map-ReduceThe caller provides map and reduce functions written in JavaScript
  • 27. MongoDB is a Single-Master SystemA database is served by members of a “replica set”The system elects a primary (master)Failure of the master is detected, and a new master is electedApplication writes get an error if there is no quorum to elect a new masterReads continue to be fulfilled
  • 29. MongoDB Supports ShardingA collection can be shardedEach shard is served by its own replica setNew shards (each a replica set) can be added at any timeShard key ranges are automatically balanced
  • 30. MongoDB – Sharded Deployment
  • 31. MongoDB Storage ManagementData is kept in memory-mapped filesServers should have a lot of memoryFiles are allocated as neededDocuments in a collection are kept on a list using a geographical addressing schemeIndexes (B*-trees) point to documents using geographical addresses
  • 32. MongoDB Server ManagementReplica set members are aware of each otherA majority of votes is required to elect a new primaryMembers can be assigned priorities to affect the electione.g., an “invisible” replica can be created with zero priority for backup purposes
  • 33. MongoDB AccessDrivers are available in many languages10gen supportedC, C# (.Net), C++, Erlang, Haskell, Java, JavaScript, Perl, PHP, Python, Ruby, ScalaCommunity supportedClojure, ColdFusion, F#, Go, Groovy, Lua, Rhttp://www.mongodb.org/display/DOCS/Overview+-+Writing+Drivers+and+Tools
  • 34. MongoDB AvailabilitySourcehttps://github.com/mongodb/mongoServerLicense: AGPLhttp://www.mongodb.org/downloadsDriversLicense: Apachehttp://www.mongodb.org/display/DOCS/Drivers
  • 35. MongoDB – Hosted Serviceshttp://www.mongodb.org/display/DOCS/Hosting+CenterMongoHQ, Mongo Machine, MongoLabRESTful access to collections
  • 36. MongoDB SupportPaid Supporthttp://www.10gen.com/client-portal10gen Hosted MonitoringConsulting, trainingFree Supporthttp://groups.google.com/group/mongodb-userhttp://stackoverflow.com/questions/tagged/mongodb
  • 37. MongoDB Usershttp://www.10gen.com/customershttp://www.10gen.com/presentationscraigslist: http://www.10gen.com/presentation/mongosf2011/craigslistbit.ly: http://blip.tv/mongodb/bit-ly-user-history-auto-sharded-3723147shutterfly: http://www.10gen.com/presentation/mongosv2010/shutterfly