SlideShare uma empresa Scribd logo
1 de 40
MongoDB:  An Introduction Chris Westin Software Engineer, 10gen © Copyright 2010 10gen Inc.
Outline The Whys of Non-Relational Databases Vocabulary of the Non-Relational World MongoDB
Why did non-relational databases arise? Problems with relational databases in the web world The Whys of Non-Relational Databases
Problem - Schema Evolution Applications are evolving all the time Applications need new fields Applications need new indexes Data is growing – sometimes very fast Users need to be able to alter their schemas without making their data unavailable The web world expects 24x7 service RDBMSs can have a hard time doing this
Problem – Write Rates Replication is a solution for high read loads Sooner or later, writing becomes a bottleneck Sharding – partitioning a logical database across multiple database instances Joins and aggregation become a problem Distributed transactions are too slow for the web Manual management of shards Choosing shard partitions Rebalancing shards
An introduction to terminology you’re going to be seeing a lot Vocabulary of the Non-Relational World
Data Models A non-relational database’s data model determines the kinds of items it can contain and how they can be retrieved What 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 definition What kind of queries can you do? SQL is a manifestation of the kinds of queries that fall out of relational algebra
Non-Relational Data Models Key-value stores Document stores Column-oriented databases Graph databases
Key-Value Stores A mapping from a key to a value The store doesn’t know anything about the the key or value The store doesn’t know anything about the insides of the value Operations Set, get, or delete a key-value pair
Document Stores The store is a container for documents Documents are made up of named fields Fields may or may not have type definitions e.g. XSDs for XML stores, vs. schema-less JSON stores Can create “secondary indexes” These provide the ability to query on any document field(s) Operations: Insert and delete documents Update fields within documents
Column-Oriented Stores Like a relational store, but flipped around: all data for a column is kept together An index provides a means to get a column value for a record Operations: Get, insert, delete records; updating fields Streaming column data in and out of Hadoop
Graph Databases Stores vertex-to-vertex edges Operations: Getting and setting edges Sometimes possible to annotate vertices or edges Query languages support finding paths between vertices, subject to various constraints
Consistency Models Relational databases support transactions Can only see committed changes Commit/abort span multiple changes Read-only transaction flavors Read committed, repeatable read, etc Classic 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 Master Replication can provide arbitrary read scalability Subject to coping with read-consistency issues Sooner or later, writing becomes a bottleneck Physical limitations (seek time) Throughput of a single I/O subsystem
Sharding Paritition the primary key space via hashing Set up a duplicate system for each shard The write-rate limitation now applies to each shard Joins or aggregation across shards are problematic Can the data be re-sharded on a live system? Can shards be re-balanced on a live system?
Multi-Site Operation Failure of a single-master system’s master A new master can be chosen But what if there’s a network partition? Can the application continue in read-only mode?
Dynamo Now a generic term for multi-master systems Writes can occur to any node The same record can be updated on different nodes by different clients All writes are replicated everywhere
Dynamo – the 2nd breakdown of consistency Collisions can occur Who wins? A collision resolution strategy is required Vector clocks http://en.wikipedia.org/wiki/Vector_clock Application access must be aware of this
The Commercial OSS Landscape
Key Client Implementation Concerns Monotonic reads Can my reads go back in time? Read-your-own-writes If I issue a query immediately after an insert or update, will I see my changes? Uninterrupted writes Am I always guaranteed the ability to write? Conflict Resolution Do I need to have a conflict resolution strategy?
Using a Single-Master System What does the intermediate agent or system do for… Monotonic reads? Read-your-own-writes? Uninterrupted writes? Conflict Resolution?
Using a Multi-Master System What 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 world MongoDB’s architecture and features Some real-world users MongoDB
MongoDB is a Document Store MongoDB stores JSON objects as BSON { LastName: ‘Flintstone’, FirstName: ‘Fred’, …} Secondary Indexes db.collection.ensureIndex({LastName : 1, FirstName : 1}); Simple QBE-like query syntax db.collection.find({LastName : ‘Flintstone’}); db.collection.find({LastName : { $gte : ‘Flintstone’});
No Joins or Transactions Nested documents…. Can often be used to avoid joins Can often be used to regain atomicity
MongoDB – Advanced Queries Geo-spatial queries Create a geo index Find points near a given point, sorted by radial distance Can be planar or spherical Find points within a certain radial distance, within a bounding box, or a polygon Built-in Map-Reduce The caller provides map and reduce functions written in JavaScript
MongoDB is a Single-Master System A 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 elected Application writes get an error if there is no quorum to elect a new master Reads continue to be fulfilled
MongoDB Replica Set
MongoDB Supports Sharding A collection can be sharded Each shard is served by its own replica set New shards (each a replica set) can be added at any time Shard key ranges are automatically balanced
MongoDB – Sharded Deployment
MongoDB Storage Management Data is kept in memory-mapped files Servers should have a lot of memory Files are allocated as needed Documents in a collection are kept on a list using a geographical addressing scheme Indexes (B*-trees) point to documents using geographical addresses
MongoDB Server Management Replica set members are aware of each other A majority of votes is required to elect a new primary Members can be assigned priorities to affect the election e.g., an “invisible” replica can be created with zero priority for backup purposes
MongoDB Access Drivers are available in many languages 10gen supported C, C# (.Net), C++, Erlang, Haskell, Java, JavaScript, Perl, PHP, Python, Ruby, Scala Community supported Clojure, ColdFusion, F#, Go, Groovy, Lua, R http://www.mongodb.org/display/DOCS/Overview+-+Writing+Drivers+and+Tools
MongoDB Availability Source https://github.com/mongodb/mongo Server License:  AGPL http://www.mongodb.org/downloads Drivers License:  Apache http://www.mongodb.org/display/DOCS/Drivers
MongoDB – Hosted Services http://www.mongodb.org/display/DOCS/Hosting+Center MongoHQ, Mongo Machine, MongoLab RESTful access to collections
MongoDB Support Paid Support http://www.10gen.com/client-portal 10gen Hosted Monitoring Consulting, training Free Support http://groups.google.com/group/mongodb-user http://stackoverflow.com/questions/tagged/mongodb
MongoDB Users http://www.10gen.com/customers http://www.10gen.com/presentations craigslist: http://www.10gen.com/presentation/mongosf2011/craigslist bit.ly: http://blip.tv/mongodb/bit-ly-user-history-auto-sharded-3723147 shutterfly: http://www.10gen.com/presentation/mongosv2010/shutterfly
Mini-demo/tutorial http://try.mongodb.org/

Mais conteúdo relacionado

Mais procurados

A Seminar on NoSQL Databases.
A Seminar on NoSQL Databases.A Seminar on NoSQL Databases.
A Seminar on NoSQL Databases.Navdeep Charan
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Databasenehabsairam
 
Comparative study of modern databases
Comparative study of modern databasesComparative study of modern databases
Comparative study of modern databasesAnirban Konar
 
Chapter 7(documnet databse termininology) no sql for mere mortals
Chapter 7(documnet databse termininology) no sql for mere mortalsChapter 7(documnet databse termininology) no sql for mere mortals
Chapter 7(documnet databse termininology) no sql for mere mortalsnehabsairam
 
NOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLRamakant Soni
 
Apache big data 2016 - Speaking the language of Big Data
Apache big data 2016 - Speaking the language of Big DataApache big data 2016 - Speaking the language of Big Data
Apache big data 2016 - Speaking the language of Big Datatechmaddy
 
2009 PLANETS Vienna - MIXED migration to XML
2009 PLANETS Vienna - MIXED migration to XML2009 PLANETS Vienna - MIXED migration to XML
2009 PLANETS Vienna - MIXED migration to XMLDirk Roorda
 
Distributed Databases - Concepts & Architectures
Distributed Databases - Concepts & ArchitecturesDistributed Databases - Concepts & Architectures
Distributed Databases - Concepts & ArchitecturesDaniel Marcous
 
SQLDay2013_Denny Cherry - Table indexing for the .NET Developer
SQLDay2013_Denny Cherry - Table indexing for the .NET DeveloperSQLDay2013_Denny Cherry - Table indexing for the .NET Developer
SQLDay2013_Denny Cherry - Table indexing for the .NET DeveloperPolish SQL Server User Group
 
Dev traning 2016 databases
Dev traning 2016   databasesDev traning 2016   databases
Dev traning 2016 databasesSacheen Dhanjie
 

Mais procurados (20)

A Seminar on NoSQL Databases.
A Seminar on NoSQL Databases.A Seminar on NoSQL Databases.
A Seminar on NoSQL Databases.
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Database
 
Comparative study of modern databases
Comparative study of modern databasesComparative study of modern databases
Comparative study of modern databases
 
Chapter 7(documnet databse termininology) no sql for mere mortals
Chapter 7(documnet databse termininology) no sql for mere mortalsChapter 7(documnet databse termininology) no sql for mere mortals
Chapter 7(documnet databse termininology) no sql for mere mortals
 
NOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQL
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
My sql vs mongo
My sql vs mongoMy sql vs mongo
My sql vs mongo
 
Selecting best NoSQL
Selecting best NoSQL Selecting best NoSQL
Selecting best NoSQL
 
Why Cassandra?
Why Cassandra?Why Cassandra?
Why Cassandra?
 
No SQL
No SQLNo SQL
No SQL
 
Nosql
NosqlNosql
Nosql
 
Mongo db
Mongo dbMongo db
Mongo db
 
Apache big data 2016 - Speaking the language of Big Data
Apache big data 2016 - Speaking the language of Big DataApache big data 2016 - Speaking the language of Big Data
Apache big data 2016 - Speaking the language of Big Data
 
2009 PLANETS Vienna - MIXED migration to XML
2009 PLANETS Vienna - MIXED migration to XML2009 PLANETS Vienna - MIXED migration to XML
2009 PLANETS Vienna - MIXED migration to XML
 
Database Technologies
Database TechnologiesDatabase Technologies
Database Technologies
 
Nosql seminar
Nosql seminarNosql seminar
Nosql seminar
 
Distributed Databases - Concepts & Architectures
Distributed Databases - Concepts & ArchitecturesDistributed Databases - Concepts & Architectures
Distributed Databases - Concepts & Architectures
 
SQLDay2013_Denny Cherry - Table indexing for the .NET Developer
SQLDay2013_Denny Cherry - Table indexing for the .NET DeveloperSQLDay2013_Denny Cherry - Table indexing for the .NET Developer
SQLDay2013_Denny Cherry - Table indexing for the .NET Developer
 
Dev traning 2016 databases
Dev traning 2016   databasesDev traning 2016   databases
Dev traning 2016 databases
 

Destaque

He student profiles in 2014 15 prospectus page-13
He student profiles in 2014 15 prospectus page-13He student profiles in 2014 15 prospectus page-13
He student profiles in 2014 15 prospectus page-13bwcelearning
 
Ambari hadoop-ops-meetup-2013-09-19.final
Ambari hadoop-ops-meetup-2013-09-19.finalAmbari hadoop-ops-meetup-2013-09-19.final
Ambari hadoop-ops-meetup-2013-09-19.finalChris Westin
 
He student profiles in 2014 15 prospectus page-26
He student profiles in 2014 15 prospectus page-26He student profiles in 2014 15 prospectus page-26
He student profiles in 2014 15 prospectus page-26bwcelearning
 
How to Build High Value Relationships Under Theory Z
How to Build High Value Relationships Under Theory ZHow to Build High Value Relationships Under Theory Z
How to Build High Value Relationships Under Theory ZAnne Kohler
 
Role of Computers in HRM _ Abhilasha_Karan_Lavanya_Sanchit
Role of Computers in HRM _ Abhilasha_Karan_Lavanya_SanchitRole of Computers in HRM _ Abhilasha_Karan_Lavanya_Sanchit
Role of Computers in HRM _ Abhilasha_Karan_Lavanya_SanchitLavanya Gautam
 
02 DesmineralizacióN 2009
02 DesmineralizacióN 200902 DesmineralizacióN 2009
02 DesmineralizacióN 2009Miguel Neira
 
Presentación Crowdfunding para proyectos de innovación cultural
Presentación Crowdfunding para proyectos de innovación culturalPresentación Crowdfunding para proyectos de innovación cultural
Presentación Crowdfunding para proyectos de innovación culturalColaBoraBora
 
Crowdfunding para proyectos de innovación cultural. Karraskan/ColaBoraBora
Crowdfunding para proyectos de innovación cultural. Karraskan/ColaBoraBoraCrowdfunding para proyectos de innovación cultural. Karraskan/ColaBoraBora
Crowdfunding para proyectos de innovación cultural. Karraskan/ColaBoraBoraColaBoraBora
 
Enfermedad inflamatoria pélvica - CICAT-SALUD
Enfermedad inflamatoria pélvica - CICAT-SALUDEnfermedad inflamatoria pélvica - CICAT-SALUD
Enfermedad inflamatoria pélvica - CICAT-SALUDCICAT SALUD
 
Cronograma sierra 2015-2016.revfinal
Cronograma sierra 2015-2016.revfinalCronograma sierra 2015-2016.revfinal
Cronograma sierra 2015-2016.revfinalLuis Maigualema
 
Diploma in mechanical cadd certificate
Diploma in mechanical cadd certificateDiploma in mechanical cadd certificate
Diploma in mechanical cadd certificateMukesh Mathew
 
PEDIATRIA: Liquidos y electrolitos
PEDIATRIA: Liquidos y electrolitosPEDIATRIA: Liquidos y electrolitos
PEDIATRIA: Liquidos y electrolitosJihan Simon Hasbun
 
Introduction to PgBench
Introduction to PgBenchIntroduction to PgBench
Introduction to PgBenchJoshua Drake
 
MWF & Lube Brochure
MWF & Lube BrochureMWF & Lube Brochure
MWF & Lube BrochureBill Breault
 

Destaque (20)

Sadigh Gallery Egyptian Art Extravaganza
Sadigh Gallery Egyptian Art ExtravaganzaSadigh Gallery Egyptian Art Extravaganza
Sadigh Gallery Egyptian Art Extravaganza
 
He student profiles in 2014 15 prospectus page-13
He student profiles in 2014 15 prospectus page-13He student profiles in 2014 15 prospectus page-13
He student profiles in 2014 15 prospectus page-13
 
Ambari hadoop-ops-meetup-2013-09-19.final
Ambari hadoop-ops-meetup-2013-09-19.finalAmbari hadoop-ops-meetup-2013-09-19.final
Ambari hadoop-ops-meetup-2013-09-19.final
 
He student profiles in 2014 15 prospectus page-26
He student profiles in 2014 15 prospectus page-26He student profiles in 2014 15 prospectus page-26
He student profiles in 2014 15 prospectus page-26
 
Sadigh Gallery Holiday Art Deals 2015
Sadigh Gallery Holiday Art Deals 2015Sadigh Gallery Holiday Art Deals 2015
Sadigh Gallery Holiday Art Deals 2015
 
How to Build High Value Relationships Under Theory Z
How to Build High Value Relationships Under Theory ZHow to Build High Value Relationships Under Theory Z
How to Build High Value Relationships Under Theory Z
 
Gripshort
GripshortGripshort
Gripshort
 
Role of Computers in HRM _ Abhilasha_Karan_Lavanya_Sanchit
Role of Computers in HRM _ Abhilasha_Karan_Lavanya_SanchitRole of Computers in HRM _ Abhilasha_Karan_Lavanya_Sanchit
Role of Computers in HRM _ Abhilasha_Karan_Lavanya_Sanchit
 
02 DesmineralizacióN 2009
02 DesmineralizacióN 200902 DesmineralizacióN 2009
02 DesmineralizacióN 2009
 
Presentación Crowdfunding para proyectos de innovación cultural
Presentación Crowdfunding para proyectos de innovación culturalPresentación Crowdfunding para proyectos de innovación cultural
Presentación Crowdfunding para proyectos de innovación cultural
 
Explain explain
Explain explainExplain explain
Explain explain
 
Crowdfunding para proyectos de innovación cultural. Karraskan/ColaBoraBora
Crowdfunding para proyectos de innovación cultural. Karraskan/ColaBoraBoraCrowdfunding para proyectos de innovación cultural. Karraskan/ColaBoraBora
Crowdfunding para proyectos de innovación cultural. Karraskan/ColaBoraBora
 
pediatria
  pediatria  pediatria
pediatria
 
Enfermedad inflamatoria pélvica - CICAT-SALUD
Enfermedad inflamatoria pélvica - CICAT-SALUDEnfermedad inflamatoria pélvica - CICAT-SALUD
Enfermedad inflamatoria pélvica - CICAT-SALUD
 
Cronograma sierra 2015-2016.revfinal
Cronograma sierra 2015-2016.revfinalCronograma sierra 2015-2016.revfinal
Cronograma sierra 2015-2016.revfinal
 
Diploma in mechanical cadd certificate
Diploma in mechanical cadd certificateDiploma in mechanical cadd certificate
Diploma in mechanical cadd certificate
 
PEDIATRIA: Liquidos y electrolitos
PEDIATRIA: Liquidos y electrolitosPEDIATRIA: Liquidos y electrolitos
PEDIATRIA: Liquidos y electrolitos
 
Asociación Española de Crowdfunding
Asociación Española de CrowdfundingAsociación Española de Crowdfunding
Asociación Española de Crowdfunding
 
Introduction to PgBench
Introduction to PgBenchIntroduction to PgBench
Introduction to PgBench
 
MWF & Lube Brochure
MWF & Lube BrochureMWF & Lube Brochure
MWF & Lube Brochure
 

Semelhante a MongoDB: An Introduction - July 2011

MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011Chris Westin
 
Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesJon Meredith
 
CS 542 Parallel DBs, NoSQL, MapReduce
CS 542 Parallel DBs, NoSQL, MapReduceCS 542 Parallel DBs, NoSQL, MapReduce
CS 542 Parallel DBs, NoSQL, MapReduceJ Singh
 
2010 mongo berlin-scaling
2010 mongo berlin-scaling2010 mongo berlin-scaling
2010 mongo berlin-scalingMongoDB
 
Overview of MongoDB and Other Non-Relational Databases
Overview of MongoDB and Other Non-Relational DatabasesOverview of MongoDB and Other Non-Relational Databases
Overview of MongoDB and Other Non-Relational DatabasesAndrew Kandels
 
NOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdfNOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdfajajkhan16
 
MongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of viewMongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of viewPierre Baillet
 
05 No SQL Sudarshan.ppt
05 No SQL Sudarshan.ppt05 No SQL Sudarshan.ppt
05 No SQL Sudarshan.pptAnandKonj1
 
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'sankarapu posibabu
 
No SQL Databases.ppt
No SQL Databases.pptNo SQL Databases.ppt
No SQL Databases.pptssuser8c8fc1
 
NoSQL Introduction, Theory, Implementations
NoSQL Introduction, Theory, ImplementationsNoSQL Introduction, Theory, Implementations
NoSQL Introduction, Theory, ImplementationsFirat Atagun
 
Performance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBasePerformance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBaseSindhujanDhayalan
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databasesJames Serra
 
Scaling MongoDB - Presentation at MTP
Scaling MongoDB - Presentation at MTPScaling MongoDB - Presentation at MTP
Scaling MongoDB - Presentation at MTPdarkdata
 
Klevis Mino: MongoDB
Klevis Mino: MongoDBKlevis Mino: MongoDB
Klevis Mino: MongoDBCarlo Vaccari
 

Semelhante a MongoDB: An Introduction - July 2011 (20)

MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011
 
MongoDB
MongoDBMongoDB
MongoDB
 
Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL Databases
 
CS 542 Parallel DBs, NoSQL, MapReduce
CS 542 Parallel DBs, NoSQL, MapReduceCS 542 Parallel DBs, NoSQL, MapReduce
CS 542 Parallel DBs, NoSQL, MapReduce
 
2010 mongo berlin-scaling
2010 mongo berlin-scaling2010 mongo berlin-scaling
2010 mongo berlin-scaling
 
Overview of MongoDB and Other Non-Relational Databases
Overview of MongoDB and Other Non-Relational DatabasesOverview of MongoDB and Other Non-Relational Databases
Overview of MongoDB and Other Non-Relational Databases
 
NOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdfNOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdf
 
MongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of viewMongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of view
 
05 No SQL Sudarshan.ppt
05 No SQL Sudarshan.ppt05 No SQL Sudarshan.ppt
05 No SQL Sudarshan.ppt
 
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
 
No SQL Databases.ppt
No SQL Databases.pptNo SQL Databases.ppt
No SQL Databases.ppt
 
Open source Technology
Open source TechnologyOpen source Technology
Open source Technology
 
MongoDb - Details on the POC
MongoDb - Details on the POCMongoDb - Details on the POC
MongoDb - Details on the POC
 
NoSQL Introduction, Theory, Implementations
NoSQL Introduction, Theory, ImplementationsNoSQL Introduction, Theory, Implementations
NoSQL Introduction, Theory, Implementations
 
MongoDB
MongoDBMongoDB
MongoDB
 
NoSql Databases
NoSql DatabasesNoSql Databases
NoSql Databases
 
Performance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBasePerformance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBase
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
 
Scaling MongoDB - Presentation at MTP
Scaling MongoDB - Presentation at MTPScaling MongoDB - Presentation at MTP
Scaling MongoDB - Presentation at MTP
 
Klevis Mino: MongoDB
Klevis Mino: MongoDBKlevis Mino: MongoDB
Klevis Mino: MongoDB
 

Mais de Chris Westin

Data torrent meetup-productioneng
Data torrent meetup-productionengData torrent meetup-productioneng
Data torrent meetup-productionengChris Westin
 
Cluster management and automation with cloudera manager
Cluster management and automation with cloudera managerCluster management and automation with cloudera manager
Cluster management and automation with cloudera managerChris Westin
 
Building low latency java applications with ehcache
Building low latency java applications with ehcacheBuilding low latency java applications with ehcache
Building low latency java applications with ehcacheChris Westin
 
SDN/OpenFlow #lspe
SDN/OpenFlow #lspeSDN/OpenFlow #lspe
SDN/OpenFlow #lspeChris Westin
 
cfengine3 at #lspe
cfengine3 at #lspecfengine3 at #lspe
cfengine3 at #lspeChris Westin
 
mongodb-aggregation-may-2012
mongodb-aggregation-may-2012mongodb-aggregation-may-2012
mongodb-aggregation-may-2012Chris Westin
 
Nimbula lspe-2012-04-19
Nimbula lspe-2012-04-19Nimbula lspe-2012-04-19
Nimbula lspe-2012-04-19Chris Westin
 
mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012Chris Westin
 
Stingray - Riverbed Technology
Stingray - Riverbed TechnologyStingray - Riverbed Technology
Stingray - Riverbed TechnologyChris Westin
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkChris Westin
 
Replication and replica sets
Replication and replica setsReplication and replica sets
Replication and replica setsChris Westin
 
Architecting a Scale Out Cloud Storage Solution
Architecting a Scale Out Cloud Storage SolutionArchitecting a Scale Out Cloud Storage Solution
Architecting a Scale Out Cloud Storage SolutionChris Westin
 
Practical Replication June-2011
Practical Replication June-2011Practical Replication June-2011
Practical Replication June-2011Chris Westin
 
Ganglia Overview-v2
Ganglia Overview-v2Ganglia Overview-v2
Ganglia Overview-v2Chris Westin
 
MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011Chris Westin
 
Mysql Proxy Presentation Yahoo
Mysql Proxy Presentation YahooMysql Proxy Presentation Yahoo
Mysql Proxy Presentation YahooChris Westin
 
Mysql proxy presentation_yahoo
Mysql proxy presentation_yahooMysql proxy presentation_yahoo
Mysql proxy presentation_yahooChris Westin
 
CI in the Enterprise: Lessons Learned
CI in the Enterprise:  Lessons LearnedCI in the Enterprise:  Lessons Learned
CI in the Enterprise: Lessons LearnedChris Westin
 

Mais de Chris Westin (20)

Data torrent meetup-productioneng
Data torrent meetup-productionengData torrent meetup-productioneng
Data torrent meetup-productioneng
 
Cluster management and automation with cloudera manager
Cluster management and automation with cloudera managerCluster management and automation with cloudera manager
Cluster management and automation with cloudera manager
 
Building low latency java applications with ehcache
Building low latency java applications with ehcacheBuilding low latency java applications with ehcache
Building low latency java applications with ehcache
 
SDN/OpenFlow #lspe
SDN/OpenFlow #lspeSDN/OpenFlow #lspe
SDN/OpenFlow #lspe
 
cfengine3 at #lspe
cfengine3 at #lspecfengine3 at #lspe
cfengine3 at #lspe
 
mongodb-aggregation-may-2012
mongodb-aggregation-may-2012mongodb-aggregation-may-2012
mongodb-aggregation-may-2012
 
Nimbula lspe-2012-04-19
Nimbula lspe-2012-04-19Nimbula lspe-2012-04-19
Nimbula lspe-2012-04-19
 
mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012
 
Stingray - Riverbed Technology
Stingray - Riverbed TechnologyStingray - Riverbed Technology
Stingray - Riverbed Technology
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation framework
 
Replication and replica sets
Replication and replica setsReplication and replica sets
Replication and replica sets
 
Architecting a Scale Out Cloud Storage Solution
Architecting a Scale Out Cloud Storage SolutionArchitecting a Scale Out Cloud Storage Solution
Architecting a Scale Out Cloud Storage Solution
 
FlashCache
FlashCacheFlashCache
FlashCache
 
Large Scale Cacti
Large Scale CactiLarge Scale Cacti
Large Scale Cacti
 
Practical Replication June-2011
Practical Replication June-2011Practical Replication June-2011
Practical Replication June-2011
 
Ganglia Overview-v2
Ganglia Overview-v2Ganglia Overview-v2
Ganglia Overview-v2
 
MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011
 
Mysql Proxy Presentation Yahoo
Mysql Proxy Presentation YahooMysql Proxy Presentation Yahoo
Mysql Proxy Presentation Yahoo
 
Mysql proxy presentation_yahoo
Mysql proxy presentation_yahooMysql proxy presentation_yahoo
Mysql proxy presentation_yahoo
 
CI in the Enterprise: Lessons Learned
CI in the Enterprise:  Lessons LearnedCI in the Enterprise:  Lessons Learned
CI in the Enterprise: Lessons Learned
 

Último

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

MongoDB: An Introduction - July 2011

  • 1. MongoDB: An Introduction Chris Westin Software Engineer, 10gen © Copyright 2010 10gen Inc.
  • 2. Outline The Whys of Non-Relational Databases Vocabulary of the Non-Relational World MongoDB
  • 3. Why did non-relational databases arise? Problems with relational databases in the web world The Whys of Non-Relational Databases
  • 4. Problem - Schema Evolution Applications are evolving all the time Applications need new fields Applications need new indexes Data is growing – sometimes very fast Users need to be able to alter their schemas without making their data unavailable The web world expects 24x7 service RDBMSs can have a hard time doing this
  • 5. Problem – Write Rates Replication is a solution for high read loads Sooner or later, writing becomes a bottleneck Sharding – partitioning a logical database across multiple database instances Joins and aggregation become a problem Distributed transactions are too slow for the web Manual management of shards Choosing shard partitions Rebalancing shards
  • 6. An introduction to terminology you’re going to be seeing a lot Vocabulary of the Non-Relational World
  • 7. Data Models A non-relational database’s data model determines the kinds of items it can contain and how they can be retrieved What 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 definition What 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 Models Key-value stores Document stores Column-oriented databases Graph databases
  • 9. Key-Value Stores A mapping from a key to a value The store doesn’t know anything about the the key or value The store doesn’t know anything about the insides of the value Operations Set, get, or delete a key-value pair
  • 10. Document Stores The store is a container for documents Documents are made up of named fields Fields may or may not have type definitions e.g. XSDs for XML stores, vs. schema-less JSON stores Can create “secondary indexes” These provide the ability to query on any document field(s) Operations: Insert and delete documents Update fields within documents
  • 11. Column-Oriented Stores Like a relational store, but flipped around: all data for a column is kept together An index provides a means to get a column value for a record Operations: Get, insert, delete records; updating fields Streaming column data in and out of Hadoop
  • 12. Graph Databases Stores vertex-to-vertex edges Operations: Getting and setting edges Sometimes possible to annotate vertices or edges Query languages support finding paths between vertices, subject to various constraints
  • 13. Consistency Models Relational databases support transactions Can only see committed changes Commit/abort span multiple changes Read-only transaction flavors Read committed, repeatable read, etc Classic 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 Master Replication can provide arbitrary read scalability Subject to coping with read-consistency issues Sooner or later, writing becomes a bottleneck Physical limitations (seek time) Throughput of a single I/O subsystem
  • 16. Sharding Paritition the primary key space via hashing Set up a duplicate system for each shard The write-rate limitation now applies to each shard Joins or aggregation across shards are problematic Can the data be re-sharded on a live system? Can shards be re-balanced on a live system?
  • 17. Multi-Site Operation Failure of a single-master system’s master A new master can be chosen But what if there’s a network partition? Can the application continue in read-only mode?
  • 18. Dynamo Now a generic term for multi-master systems Writes can occur to any node The same record can be updated on different nodes by different clients All writes are replicated everywhere
  • 19. Dynamo – the 2nd breakdown of consistency Collisions can occur Who wins? A collision resolution strategy is required Vector clocks http://en.wikipedia.org/wiki/Vector_clock Application access must be aware of this
  • 20. The Commercial OSS Landscape
  • 21. Key Client Implementation Concerns Monotonic reads Can my reads go back in time? Read-your-own-writes If I issue a query immediately after an insert or update, will I see my changes? Uninterrupted writes Am I always guaranteed the ability to write? Conflict Resolution Do I need to have a conflict resolution strategy?
  • 22. Using a Single-Master System What does the intermediate agent or system do for… Monotonic reads? Read-your-own-writes? Uninterrupted writes? Conflict Resolution?
  • 23. Using a Multi-Master System What 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 world MongoDB’s architecture and features Some real-world users MongoDB
  • 25. MongoDB is a Document Store MongoDB stores JSON objects as BSON { LastName: ‘Flintstone’, FirstName: ‘Fred’, …} Secondary Indexes db.collection.ensureIndex({LastName : 1, FirstName : 1}); Simple QBE-like query syntax db.collection.find({LastName : ‘Flintstone’}); db.collection.find({LastName : { $gte : ‘Flintstone’});
  • 26. No Joins or Transactions Nested documents…. Can often be used to avoid joins Can often be used to regain atomicity
  • 27. MongoDB – Advanced Queries Geo-spatial queries Create a geo index Find points near a given point, sorted by radial distance Can be planar or spherical Find points within a certain radial distance, within a bounding box, or a polygon Built-in Map-Reduce The caller provides map and reduce functions written in JavaScript
  • 28. MongoDB is a Single-Master System A 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 elected Application writes get an error if there is no quorum to elect a new master Reads continue to be fulfilled
  • 30. MongoDB Supports Sharding A collection can be sharded Each shard is served by its own replica set New shards (each a replica set) can be added at any time Shard key ranges are automatically balanced
  • 31. MongoDB – Sharded Deployment
  • 32. MongoDB Storage Management Data is kept in memory-mapped files Servers should have a lot of memory Files are allocated as needed Documents in a collection are kept on a list using a geographical addressing scheme Indexes (B*-trees) point to documents using geographical addresses
  • 33. MongoDB Server Management Replica set members are aware of each other A majority of votes is required to elect a new primary Members can be assigned priorities to affect the election e.g., an “invisible” replica can be created with zero priority for backup purposes
  • 34. MongoDB Access Drivers are available in many languages 10gen supported C, C# (.Net), C++, Erlang, Haskell, Java, JavaScript, Perl, PHP, Python, Ruby, Scala Community supported Clojure, ColdFusion, F#, Go, Groovy, Lua, R http://www.mongodb.org/display/DOCS/Overview+-+Writing+Drivers+and+Tools
  • 35. MongoDB Availability Source https://github.com/mongodb/mongo Server License: AGPL http://www.mongodb.org/downloads Drivers License: Apache http://www.mongodb.org/display/DOCS/Drivers
  • 36. MongoDB – Hosted Services http://www.mongodb.org/display/DOCS/Hosting+Center MongoHQ, Mongo Machine, MongoLab RESTful access to collections
  • 37. MongoDB Support Paid Support http://www.10gen.com/client-portal 10gen Hosted Monitoring Consulting, training Free Support http://groups.google.com/group/mongodb-user http://stackoverflow.com/questions/tagged/mongodb
  • 38. MongoDB Users http://www.10gen.com/customers http://www.10gen.com/presentations craigslist: http://www.10gen.com/presentation/mongosf2011/craigslist bit.ly: http://blip.tv/mongodb/bit-ly-user-history-auto-sharded-3723147 shutterfly: http://www.10gen.com/presentation/mongosv2010/shutterfly
  • 39.