SlideShare a Scribd company logo
1 of 41
Introduction to MongoDB
                        A No-SQL Persistence Alternative
A   U   S   T   I   N   -   C    O   D   E   -   C   A   M   P   -   2   0   1   0




                                Chris Edwards
MongoDB Session Roadmap
             • What is the NoSQL Movement?
             • What is MongoDB?
             • Installing
             • Using the Mongo Shell
             • Accessing MongoDB via C#
                    - Basic Driver (mongodb-csharp driver)
                    - Using Linq
                    - Using NoRM for strong typing
             • Accessing MongoDB via REST
             • Replication
             • Sharding


Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
What is the No-SQL Movement?




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
What is the No-SQL Movement?

                “Next Generation Databases mostly addressing some of the points:
                being non-relational, distributed, open-source and horizontal
                scalable. ... schema-free, easy replication support, simple API,
                eventually consistent ...”
                                                                       - nosql-database.org




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
What is the No-SQL Movement?

                “Next Generation Databases mostly addressing some of the points:
                being non-relational, distributed, open-source and horizontal
                scalable. ... schema-free, easy replication support, simple API,
                eventually consistent ...”
                                                                       - nosql-database.org




                 • Non-Relational                         • Horizontally Scalable
                 • Distributed                            • Schema-Free
                 • Open-Source                            • Replication Support



Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
What is the No-SQL Movement?
             • Not all systems have the same data needs.
             • Use the right tool for the right job.
             • Sql is not always the best option, nor is it the
                  only one.




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
What is the No-SQL Movement?
             • Not all systems have the same data needs.
             • Use the right tool for the right job.
             • Sql is not always the best option, nor is it the
                  only one.



                              Not Only SQL

Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
What is the No-SQL Movement?
             • Not all systems have the same data needs.
             • Use the right tool for the right job.
             • Sql is not always the best option, nor is it the
                  only one.



                              Not Only SQL
                                             It’s not about flaming SQL.


Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
What is the No-SQL Movement?
             • Not all systems have the same data needs.
             • Use the right tool for the right job.
             • Sql is not always the best option, nor is it the
                  only one.



                              Not Only SQL
                             It’s not about flaming SQL.
                 Its about opening our minds to new technologies.

Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Session Roadmap
             • What is the NoSQL Movement?
             • What is MongoDB?
             • Installing
             • Using the Mongo Shell
             • Accessing MongoDB via C#
                    - Basic Driver (mongodb-csharp driver)
                    - Using Linq
                    - Using NoRM for strong typing
             • Accessing MongoDB via REST
             • Replication
             • Sharding


Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
What is MongoDB?
             • Document-oriented database
                    - Uses JSON (BSON actually)
             • Schema-free
             • Performance
                    -   Written in C++
                    -   Full index support
                    -   No transactions (has atomic operations)   “Mongo only pawn in game of life”
                    -   Memory-mapped files (delayed writes)
             • Scalability
                    - Replication
                    - Auto-Sharding
             • Commercially supported (10gen)
                    - Lots of documentation



Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
Other Features of MongoDB
             • Document-based queries
                    - Flexible document queries expressed in JSON/Javascript.
             • Map Reduce
                    - Flexible aggregation and data processing.
                    - Queries run in parallel on all shards.
             • GridFS
                    - Store files of any size easily.
             • Geospatial Indexing
                    - Find object based on location. (i.e. find closest n items to x)




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
Other Features of MongoDB
             • Supported Platforms
                    -   OSX
                    -   Linux
                    -   Solaris
                    -   Windows
                    -   FreeBSD




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Basic Components
             • The Database Server
             • The Interactive Shell
             • The Sharding Router




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Basic Components
             • The Database Server
             • The Interactive Shell
             • The Sharding Router


                             mongod.exe
                            The database server




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Basic Components
             • The Database Server
             • The Interactive Shell
             • The Sharding Router


                             mongod.exe            mongo.exe
                            The database server   The interactive shell




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Basic Components
             • The Database Server
             • The Interactive Shell
             • The Sharding Router


                             mongod.exe                              mongo.exe
                            The database server                     The interactive shell




                                              mongos.exe
                                              The sharding router




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Session Roadmap
             • What is the NoSQL Movement?
             • What is MongoDB?
             • Installing
             • Using the Mongo Shell
             • Accessing MongoDB via C#
                    - Basic Driver (mongodb-csharp driver)
                    - Using Linq
                    - Using NoRM for strong typing
             • Accessing MongoDB via REST
             • Replication
             • Sharding


Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
Installing MongoDB
             1. Download MongoDB.             www.mongodb.com/
                 downloads

             2. Extract it.
             3. Create the data folder.        usually /data/db -or- C:
                 datadb

             4. Run mongod.exe




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
Installing MongoDB
             1. Download MongoDB.                  www.mongodb.com/
                 downloads

             2. Extract it.
             3. Create the data folder.             usually /data/db -or- C:
                 datadb

             4. Run mongod.exe

                                             That’s it!

Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Session Roadmap
             • What is the NoSQL Movement?
             • What is MongoDB?
             • Installing
             • Using the Mongo Shell
             • Accessing MongoDB via C#
                    - Basic Driver (mongodb-csharp driver)
                    - Using Linq
                    - Using NoRM for strong typing
             • Accessing MongoDB via REST
             • Replication
             • Sharding


Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
Accessing MongoDB via the Shell
             • Inserting a document into a collection.
             • Querying a collection.
             • Modifying a document.
             • Deleting a document.




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
Accessing MongoDB via the Shell
             • Inserting a document into a collection.
             • Querying a collection.
             • Modifying a document.
             • Deleting a document.



                                             Lets do it!



Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Session Roadmap
             • What is the NoSQL Movement?
             • What is MongoDB?
             • Installing
             • Using the Mongo Shell
             • Accessing MongoDB via C#
                    - Basic Driver (mongodb-csharp driver)
                    - Using Linq
                    - Using NoRM for strong typing
             • Accessing MongoDB via REST
             • Replication
             • Sharding


Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
Accessing MongoDB via C#
             • mongodb-csharp driver
                    - Most mature driver for C#.
                    - Look at basic functionality.
                    - Then using LINQ.
             • NoRM driver
                    - Using NoRM for strongly typed access.




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
Accessing MongoDB via C#
             • mongodb-csharp driver
                    - Most mature driver for C#.
                    - Look at basic functionality.
                    - Then using LINQ.
             • NoRM driver
                    - Using NoRM for strongly typed access.



      For more information and/or drivers for other languages, check out www.mongodb.org




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
Accessing MongoDB via C#




                      Demo of using the
                    mongodb-csharp driver.



Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
Accessing MongoDB via C#




   Demo of using the NoRM driver



Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Session Roadmap
             • What is the NoSQL Movement?
             • What is MongoDB?
             • Installing
             • Using the Mongo Shell
             • Accessing MongoDB via C#
                    - Basic Driver (mongodb-csharp driver)
                    - Using Linq
                    - Using NoRM for strong typing
             • Accessing MongoDB via REST
             • Replication
             • Sharding


Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
Accessing MongoDB via REST
             • To enable basic REST interface, use --rest
                 command line.
                    - mongod.exe --rest
             • REST interface uses port +1000.
                    - http://127.0.0.1:28017/database/collection/
                    - http://127.0.0.1:28017/database/collection/?filter&Field=Value



             • Full REST support is provided by the
                 Sleepy.Mongoose lib.
                    - http://github.com/kchodorow/sleepy.mongoose




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Session Roadmap
             • What is the NoSQL Movement?
             • What is MongoDB?
             • Installing
             • Using the Mongo Shell
             • Accessing MongoDB via C#
                    - Basic Driver (mongodb-csharp driver)
                    - Using Linq
                    - Using NoRM for strong typing
             • Accessing MongoDB via REST
             • Replication
             • Sharding


Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Replication
             • Master-Slave
                    - Master - mongod.exe --master
                    - Slave - mongod.exe --source <master url>:<master port>
                    - Slave can use --slavedelay <delay in seconds> to have a rolling backup.
             • Replica Pairs (obsolete)
             • Replica Sets (to be released in 1.6)
                    - Full Failover support
                    - Supports more than 2 servers in a replica cluster
                    - Data center and rack aware
                    - Can have passive set members (slaves) that are never primary
             • Master-Master (limited)
                    - Both masters are also configured as slaves
                    - Safe for insert, delete by id, and any queries
                    - Unsafe for concurrent updates of single object

Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Session Roadmap
             • What is the NoSQL Movement?
             • What is MongoDB?
             • Installing
             • Using the Mongo Shell
             • Accessing MongoDB via C#
                    - Basic Driver (mongodb-csharp driver)
                    - Using Linq
                    - Using NoRM for strong typing
             • Accessing MongoDB via REST
             • Replication
             • Sharding


Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Auto-Sharding: Features
             • Based on a defined shard key.
             • Auto-balances as shard servers are added or
                 removed.
                    - Can go from single master to sharded system with zero downtime.
             • Failover handled through replica sets. (each shard
                 replicated)

             • Map Reduce queries are run in parallel across
                 shards.




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Auto-Sharding: Architecture
             • Shard Servers
                    - Instance of mongod.exe --shardsvr
                    - Optionally configured with a replication set for failover.

             • Config Servers
                    - Instance of mongod.exe --configsvr
                    - Usually a group of 3. System is up so long as 1 config server is
                        running.

             • Shard Routers
                    - Instance of mongos.exe --configdb <config server>:<config port>
                    - Acts like mongod.exe to clients.
                    - Can be on the same box as a shard server.
                    - Can run on appserver to reduce traffic.




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Auto-Sharding: Architecture
                                  Sample Logical Architecture




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Auto-Sharding: Architecture
                                 Sample Physical Architecture




Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Auto-Sharding: Configuration
           Startup Servers
                 • Startup Shard Servers
                         - mongod.exe --shardsvr

                 • Startup Config Servers
                         - mongod.exe --configsvr

                 • Startup Shard Routers
           Configure --configdb <config server>:<config port>
               - mongos.exe


           Cluster
                 • Add Shards to the Cluster
                         - Execute the following command for each shard using either the
                           driver or shell.
                         - db.runcommand( { addshard : “<shard server>:<shard server port>” } );

                 • Enable Sharding on the Databases to Shard
                         - db.runcommand( { enablesharding : “<dbname>” } );


Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
MongoDB Session Roadmap
             • What is the NoSQL Movement?
             • What is MongoDB?
             • Installing
             • Using the Mongo Shell
             • Accessing MongoDB via C#
                    - Basic Driver (mongodb-csharp driver)
                    - Using Linq
                    - Using NoRM for strong typing
             • Accessing MongoDB via REST
             • Replication
             • Sharding


Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0
                                             ?
About Me
          Chris Edwards
          Developer at BancVue Ltd
            Email: ChrisEdwards357@gmail.com
            Blog: http://
           chrisedwards.dreamhosters.com
            Twitter: @cedwards
            Github: http://github.com/chrisedwards

           BancVue
            Web: www.bancvue.com
            Phone: 877.342.2557

           We are hiring C# developers:

Introduction to MongoDB
          A No-SQL Persistence Alternative
A U S T I N - C O D E - C A M P - 2 0 1 0

More Related Content

What's hot

Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Dbchriskite
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architectureBishal Khanal
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo dbRohit Bishnoi
 
Introducción a NoSQL
Introducción a NoSQLIntroducción a NoSQL
Introducción a NoSQLMongoDB
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)Uwe Printz
 
MongoDB World 2016: Poster Sessions eBook
MongoDB World 2016: Poster Sessions eBookMongoDB World 2016: Poster Sessions eBook
MongoDB World 2016: Poster Sessions eBookMongoDB
 
Conceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónConceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónMongoDB
 
Common MongoDB Use Cases
Common MongoDB Use CasesCommon MongoDB Use Cases
Common MongoDB Use CasesDATAVERSITY
 
Mysql to mongo
Mysql to mongoMysql to mongo
Mysql to mongoAlex Sharp
 
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcriptfoliba
 
MongoDB NYC Python
MongoDB NYC PythonMongoDB NYC Python
MongoDB NYC PythonMike Dirolf
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBNodeXperts
 
Mongodb
MongodbMongodb
Mongodbfoliba
 

What's hot (20)

Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
 
Introduction to mongodb
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
 
MongoDB
MongoDBMongoDB
MongoDB
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architecture
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo db
 
Mongodb @ vrt
Mongodb @ vrtMongodb @ vrt
Mongodb @ vrt
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
Introducción a NoSQL
Introducción a NoSQLIntroducción a NoSQL
Introducción a NoSQL
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)
 
MongoDB World 2016: Poster Sessions eBook
MongoDB World 2016: Poster Sessions eBookMongoDB World 2016: Poster Sessions eBook
MongoDB World 2016: Poster Sessions eBook
 
Conceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónConceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producción
 
Common MongoDB Use Cases
Common MongoDB Use CasesCommon MongoDB Use Cases
Common MongoDB Use Cases
 
Mysql to mongo
Mysql to mongoMysql to mongo
Mysql to mongo
 
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcript
 
Mongo db
Mongo dbMongo db
Mongo db
 
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
 
MongoDB NYC Python
MongoDB NYC PythonMongoDB NYC Python
MongoDB NYC Python
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Mongodb
MongodbMongodb
Mongodb
 

Viewers also liked

MongoDB For C++ Developers
MongoDB For C++ DevelopersMongoDB For C++ Developers
MongoDB For C++ DevelopersYnon Perek
 
Mango Database - Web Development
Mango Database - Web DevelopmentMango Database - Web Development
Mango Database - Web Developmentmssaman
 
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web ApplicationsWhat Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web ApplicationsTodd Hoff
 
The Alchemy of Open: Ideas, Discovery and Action
The Alchemy of Open: Ideas, Discovery and ActionThe Alchemy of Open: Ideas, Discovery and Action
The Alchemy of Open: Ideas, Discovery and ActionStephDK
 
AngularJS für .NET-Entwickler
AngularJS für .NET-EntwicklerAngularJS für .NET-Entwickler
AngularJS für .NET-EntwicklerPeter Hecker
 
13. Boletín digital desde el espacio Agosto - Septiembre 2014
13. Boletín digital desde el espacio Agosto - Septiembre 201413. Boletín digital desde el espacio Agosto - Septiembre 2014
13. Boletín digital desde el espacio Agosto - Septiembre 2014EspacioJovenAvila
 
Implementer grant technology camp january 9, 2012 final blue
Implementer grant technology camp january 9, 2012 final blueImplementer grant technology camp january 9, 2012 final blue
Implementer grant technology camp january 9, 2012 final blueJulie Gahimer
 
8 de marzo, Encuentro con autor
8 de marzo, Encuentro con autor8 de marzo, Encuentro con autor
8 de marzo, Encuentro con autorKARMENLISKA
 
Hashing out Hashrates - Sydney Bitcoin Meetup - December 2014
Hashing out Hashrates - Sydney Bitcoin Meetup - December 2014Hashing out Hashrates - Sydney Bitcoin Meetup - December 2014
Hashing out Hashrates - Sydney Bitcoin Meetup - December 2014Hass McCook
 
Video strategy to meet business objectives
Video strategy to meet business objectivesVideo strategy to meet business objectives
Video strategy to meet business objectivesJimmy Flores
 
Terminales de caja md
Terminales de caja mdTerminales de caja md
Terminales de caja mdOtec Fecs
 
Acd25 2013
Acd25 2013Acd25 2013
Acd25 2013san_van
 
IQuantum Online Marketing Strategy
IQuantum  Online Marketing StrategyIQuantum  Online Marketing Strategy
IQuantum Online Marketing Strategysandhya.p
 
Internados de investigación de verano para estudiantes subgraduados
Internados de investigación de verano para estudiantes subgraduadosInternados de investigación de verano para estudiantes subgraduados
Internados de investigación de verano para estudiantes subgraduadosCésar E. Concepción
 
Towards the Formalization of Interaction Semantics
Towards the Formalization of Interaction SemanticsTowards the Formalization of Interaction Semantics
Towards the Formalization of Interaction SemanticsIrene Celino
 

Viewers also liked (19)

MongoDB For C++ Developers
MongoDB For C++ DevelopersMongoDB For C++ Developers
MongoDB For C++ Developers
 
Mango Database - Web Development
Mango Database - Web DevelopmentMango Database - Web Development
Mango Database - Web Development
 
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web ApplicationsWhat Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications
 
The Alchemy of Open: Ideas, Discovery and Action
The Alchemy of Open: Ideas, Discovery and ActionThe Alchemy of Open: Ideas, Discovery and Action
The Alchemy of Open: Ideas, Discovery and Action
 
AngularJS für .NET-Entwickler
AngularJS für .NET-EntwicklerAngularJS für .NET-Entwickler
AngularJS für .NET-Entwickler
 
13. Boletín digital desde el espacio Agosto - Septiembre 2014
13. Boletín digital desde el espacio Agosto - Septiembre 201413. Boletín digital desde el espacio Agosto - Septiembre 2014
13. Boletín digital desde el espacio Agosto - Septiembre 2014
 
Implementer grant technology camp january 9, 2012 final blue
Implementer grant technology camp january 9, 2012 final blueImplementer grant technology camp january 9, 2012 final blue
Implementer grant technology camp january 9, 2012 final blue
 
8 de marzo, Encuentro con autor
8 de marzo, Encuentro con autor8 de marzo, Encuentro con autor
8 de marzo, Encuentro con autor
 
1. sistemas informáticos
1. sistemas informáticos1. sistemas informáticos
1. sistemas informáticos
 
Hashing out Hashrates - Sydney Bitcoin Meetup - December 2014
Hashing out Hashrates - Sydney Bitcoin Meetup - December 2014Hashing out Hashrates - Sydney Bitcoin Meetup - December 2014
Hashing out Hashrates - Sydney Bitcoin Meetup - December 2014
 
Futbol luis y moises 8º
Futbol luis y moises 8ºFutbol luis y moises 8º
Futbol luis y moises 8º
 
Video strategy to meet business objectives
Video strategy to meet business objectivesVideo strategy to meet business objectives
Video strategy to meet business objectives
 
Katalog wineo purline_bioboden
Katalog wineo purline_biobodenKatalog wineo purline_bioboden
Katalog wineo purline_bioboden
 
Terminales de caja md
Terminales de caja mdTerminales de caja md
Terminales de caja md
 
Acd25 2013
Acd25 2013Acd25 2013
Acd25 2013
 
IS.SP.16.1980
IS.SP.16.1980IS.SP.16.1980
IS.SP.16.1980
 
IQuantum Online Marketing Strategy
IQuantum  Online Marketing StrategyIQuantum  Online Marketing Strategy
IQuantum Online Marketing Strategy
 
Internados de investigación de verano para estudiantes subgraduados
Internados de investigación de verano para estudiantes subgraduadosInternados de investigación de verano para estudiantes subgraduados
Internados de investigación de verano para estudiantes subgraduados
 
Towards the Formalization of Interaction Semantics
Towards the Formalization of Interaction SemanticsTowards the Formalization of Interaction Semantics
Towards the Formalization of Interaction Semantics
 

Similar to Introduction to MongoDB (from Austin Code Camp)

Big Data, NoSQL with MongoDB and Cassasdra
Big Data, NoSQL with MongoDB and CassasdraBig Data, NoSQL with MongoDB and Cassasdra
Big Data, NoSQL with MongoDB and CassasdraBrian Enochson
 
Mongodb open data day 2014
Mongodb open data day 2014Mongodb open data day 2014
Mongodb open data day 2014David Green
 
NoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionNoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionBrian Enochson
 
Monogo db in-action
Monogo db in-actionMonogo db in-action
Monogo db in-actionChi Lee
 
mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012Chris Westin
 
Munching the mongo
Munching the mongoMunching the mongo
Munching the mongoVulcanMinds
 
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...Hariharan Ganesan
 
MongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseMongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseSudhir Patil
 
Scaling with mongo db (with notes)
Scaling with mongo db (with notes)Scaling with mongo db (with notes)
Scaling with mongo db (with notes)emiltamas
 
Solr cloud the 'search first' nosql database extended deep dive
Solr cloud the 'search first' nosql database   extended deep diveSolr cloud the 'search first' nosql database   extended deep dive
Solr cloud the 'search first' nosql database extended deep divelucenerevolution
 
Mongo db first steps with csharp
Mongo db first steps with csharpMongo db first steps with csharp
Mongo db first steps with csharpSerdar Buyuktemiz
 
Jumpstart: Your Introduction to MongoDB
Jumpstart: Your Introduction to MongoDBJumpstart: Your Introduction to MongoDB
Jumpstart: Your Introduction to MongoDBMongoDB
 
FULL stack -> MEAN stack
FULL stack -> MEAN stackFULL stack -> MEAN stack
FULL stack -> MEAN stackAshok Raj
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB Habilelabs
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDBMongoDB
 
MongoDB Replication fundamentals - Desert Code Camp - October 2014
MongoDB Replication fundamentals - Desert Code Camp - October 2014MongoDB Replication fundamentals - Desert Code Camp - October 2014
MongoDB Replication fundamentals - Desert Code Camp - October 2014Avinash Ramineni
 

Similar to Introduction to MongoDB (from Austin Code Camp) (20)

Big Data, NoSQL with MongoDB and Cassasdra
Big Data, NoSQL with MongoDB and CassasdraBig Data, NoSQL with MongoDB and Cassasdra
Big Data, NoSQL with MongoDB and Cassasdra
 
Mongodb open data day 2014
Mongodb open data day 2014Mongodb open data day 2014
Mongodb open data day 2014
 
NoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionNoSQL and MongoDB Introdction
NoSQL and MongoDB Introdction
 
Monogo db in-action
Monogo db in-actionMonogo db in-action
Monogo db in-action
 
mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012
 
Munching the mongo
Munching the mongoMunching the mongo
Munching the mongo
 
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
 
MongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseMongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql Database
 
Scaling with mongo db (with notes)
Scaling with mongo db (with notes)Scaling with mongo db (with notes)
Scaling with mongo db (with notes)
 
Solr cloud the 'search first' nosql database extended deep dive
Solr cloud the 'search first' nosql database   extended deep diveSolr cloud the 'search first' nosql database   extended deep dive
Solr cloud the 'search first' nosql database extended deep dive
 
Mongo db first steps with csharp
Mongo db first steps with csharpMongo db first steps with csharp
Mongo db first steps with csharp
 
Jumpstart: Your Introduction to MongoDB
Jumpstart: Your Introduction to MongoDBJumpstart: Your Introduction to MongoDB
Jumpstart: Your Introduction to MongoDB
 
Mongo db
Mongo dbMongo db
Mongo db
 
Mean stack
Mean stackMean stack
Mean stack
 
FULL stack -> MEAN stack
FULL stack -> MEAN stackFULL stack -> MEAN stack
FULL stack -> MEAN stack
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDB
 
Oracle's Take On NoSQL
Oracle's Take On NoSQLOracle's Take On NoSQL
Oracle's Take On NoSQL
 
MongoDB Replication fundamentals - Desert Code Camp - October 2014
MongoDB Replication fundamentals - Desert Code Camp - October 2014MongoDB Replication fundamentals - Desert Code Camp - October 2014
MongoDB Replication fundamentals - Desert Code Camp - October 2014
 
MongoDB
MongoDBMongoDB
MongoDB
 

Recently uploaded

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

Introduction to MongoDB (from Austin Code Camp)

  • 1. Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0 Chris Edwards
  • 2. MongoDB Session Roadmap • What is the NoSQL Movement? • What is MongoDB? • Installing • Using the Mongo Shell • Accessing MongoDB via C# - Basic Driver (mongodb-csharp driver) - Using Linq - Using NoRM for strong typing • Accessing MongoDB via REST • Replication • Sharding Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 3. What is the No-SQL Movement? Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 4. What is the No-SQL Movement? “Next Generation Databases mostly addressing some of the points: being non-relational, distributed, open-source and horizontal scalable. ... schema-free, easy replication support, simple API, eventually consistent ...” - nosql-database.org Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 5. What is the No-SQL Movement? “Next Generation Databases mostly addressing some of the points: being non-relational, distributed, open-source and horizontal scalable. ... schema-free, easy replication support, simple API, eventually consistent ...” - nosql-database.org • Non-Relational • Horizontally Scalable • Distributed • Schema-Free • Open-Source • Replication Support Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 6. What is the No-SQL Movement? • Not all systems have the same data needs. • Use the right tool for the right job. • Sql is not always the best option, nor is it the only one. Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 7. What is the No-SQL Movement? • Not all systems have the same data needs. • Use the right tool for the right job. • Sql is not always the best option, nor is it the only one. Not Only SQL Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 8. What is the No-SQL Movement? • Not all systems have the same data needs. • Use the right tool for the right job. • Sql is not always the best option, nor is it the only one. Not Only SQL It’s not about flaming SQL. Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 9. What is the No-SQL Movement? • Not all systems have the same data needs. • Use the right tool for the right job. • Sql is not always the best option, nor is it the only one. Not Only SQL It’s not about flaming SQL. Its about opening our minds to new technologies. Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 10. MongoDB Session Roadmap • What is the NoSQL Movement? • What is MongoDB? • Installing • Using the Mongo Shell • Accessing MongoDB via C# - Basic Driver (mongodb-csharp driver) - Using Linq - Using NoRM for strong typing • Accessing MongoDB via REST • Replication • Sharding Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 11. What is MongoDB? • Document-oriented database - Uses JSON (BSON actually) • Schema-free • Performance - Written in C++ - Full index support - No transactions (has atomic operations) “Mongo only pawn in game of life” - Memory-mapped files (delayed writes) • Scalability - Replication - Auto-Sharding • Commercially supported (10gen) - Lots of documentation Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 12. Other Features of MongoDB • Document-based queries - Flexible document queries expressed in JSON/Javascript. • Map Reduce - Flexible aggregation and data processing. - Queries run in parallel on all shards. • GridFS - Store files of any size easily. • Geospatial Indexing - Find object based on location. (i.e. find closest n items to x) Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 13. Other Features of MongoDB • Supported Platforms - OSX - Linux - Solaris - Windows - FreeBSD Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 14. MongoDB Basic Components • The Database Server • The Interactive Shell • The Sharding Router Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 15. MongoDB Basic Components • The Database Server • The Interactive Shell • The Sharding Router mongod.exe The database server Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 16. MongoDB Basic Components • The Database Server • The Interactive Shell • The Sharding Router mongod.exe mongo.exe The database server The interactive shell Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 17. MongoDB Basic Components • The Database Server • The Interactive Shell • The Sharding Router mongod.exe mongo.exe The database server The interactive shell mongos.exe The sharding router Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 18. MongoDB Session Roadmap • What is the NoSQL Movement? • What is MongoDB? • Installing • Using the Mongo Shell • Accessing MongoDB via C# - Basic Driver (mongodb-csharp driver) - Using Linq - Using NoRM for strong typing • Accessing MongoDB via REST • Replication • Sharding Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 19. Installing MongoDB 1. Download MongoDB. www.mongodb.com/ downloads 2. Extract it. 3. Create the data folder. usually /data/db -or- C: datadb 4. Run mongod.exe Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 20. Installing MongoDB 1. Download MongoDB. www.mongodb.com/ downloads 2. Extract it. 3. Create the data folder. usually /data/db -or- C: datadb 4. Run mongod.exe That’s it! Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 21. MongoDB Session Roadmap • What is the NoSQL Movement? • What is MongoDB? • Installing • Using the Mongo Shell • Accessing MongoDB via C# - Basic Driver (mongodb-csharp driver) - Using Linq - Using NoRM for strong typing • Accessing MongoDB via REST • Replication • Sharding Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 22. Accessing MongoDB via the Shell • Inserting a document into a collection. • Querying a collection. • Modifying a document. • Deleting a document. Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 23. Accessing MongoDB via the Shell • Inserting a document into a collection. • Querying a collection. • Modifying a document. • Deleting a document. Lets do it! Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 24. MongoDB Session Roadmap • What is the NoSQL Movement? • What is MongoDB? • Installing • Using the Mongo Shell • Accessing MongoDB via C# - Basic Driver (mongodb-csharp driver) - Using Linq - Using NoRM for strong typing • Accessing MongoDB via REST • Replication • Sharding Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 25. Accessing MongoDB via C# • mongodb-csharp driver - Most mature driver for C#. - Look at basic functionality. - Then using LINQ. • NoRM driver - Using NoRM for strongly typed access. Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 26. Accessing MongoDB via C# • mongodb-csharp driver - Most mature driver for C#. - Look at basic functionality. - Then using LINQ. • NoRM driver - Using NoRM for strongly typed access. For more information and/or drivers for other languages, check out www.mongodb.org Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 27. Accessing MongoDB via C# Demo of using the mongodb-csharp driver. Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 28. Accessing MongoDB via C# Demo of using the NoRM driver Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 29. MongoDB Session Roadmap • What is the NoSQL Movement? • What is MongoDB? • Installing • Using the Mongo Shell • Accessing MongoDB via C# - Basic Driver (mongodb-csharp driver) - Using Linq - Using NoRM for strong typing • Accessing MongoDB via REST • Replication • Sharding Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 30. Accessing MongoDB via REST • To enable basic REST interface, use --rest command line. - mongod.exe --rest • REST interface uses port +1000. - http://127.0.0.1:28017/database/collection/ - http://127.0.0.1:28017/database/collection/?filter&Field=Value • Full REST support is provided by the Sleepy.Mongoose lib. - http://github.com/kchodorow/sleepy.mongoose Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 31. MongoDB Session Roadmap • What is the NoSQL Movement? • What is MongoDB? • Installing • Using the Mongo Shell • Accessing MongoDB via C# - Basic Driver (mongodb-csharp driver) - Using Linq - Using NoRM for strong typing • Accessing MongoDB via REST • Replication • Sharding Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 32. MongoDB Replication • Master-Slave - Master - mongod.exe --master - Slave - mongod.exe --source <master url>:<master port> - Slave can use --slavedelay <delay in seconds> to have a rolling backup. • Replica Pairs (obsolete) • Replica Sets (to be released in 1.6) - Full Failover support - Supports more than 2 servers in a replica cluster - Data center and rack aware - Can have passive set members (slaves) that are never primary • Master-Master (limited) - Both masters are also configured as slaves - Safe for insert, delete by id, and any queries - Unsafe for concurrent updates of single object Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 33. MongoDB Session Roadmap • What is the NoSQL Movement? • What is MongoDB? • Installing • Using the Mongo Shell • Accessing MongoDB via C# - Basic Driver (mongodb-csharp driver) - Using Linq - Using NoRM for strong typing • Accessing MongoDB via REST • Replication • Sharding Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 34. MongoDB Auto-Sharding: Features • Based on a defined shard key. • Auto-balances as shard servers are added or removed. - Can go from single master to sharded system with zero downtime. • Failover handled through replica sets. (each shard replicated) • Map Reduce queries are run in parallel across shards. Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 35. MongoDB Auto-Sharding: Architecture • Shard Servers - Instance of mongod.exe --shardsvr - Optionally configured with a replication set for failover. • Config Servers - Instance of mongod.exe --configsvr - Usually a group of 3. System is up so long as 1 config server is running. • Shard Routers - Instance of mongos.exe --configdb <config server>:<config port> - Acts like mongod.exe to clients. - Can be on the same box as a shard server. - Can run on appserver to reduce traffic. Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 36. MongoDB Auto-Sharding: Architecture Sample Logical Architecture Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 37. MongoDB Auto-Sharding: Architecture Sample Physical Architecture Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 38. MongoDB Auto-Sharding: Configuration Startup Servers • Startup Shard Servers - mongod.exe --shardsvr • Startup Config Servers - mongod.exe --configsvr • Startup Shard Routers Configure --configdb <config server>:<config port> - mongos.exe Cluster • Add Shards to the Cluster - Execute the following command for each shard using either the driver or shell. - db.runcommand( { addshard : “<shard server>:<shard server port>” } ); • Enable Sharding on the Databases to Shard - db.runcommand( { enablesharding : “<dbname>” } ); Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 39. MongoDB Session Roadmap • What is the NoSQL Movement? • What is MongoDB? • Installing • Using the Mongo Shell • Accessing MongoDB via C# - Basic Driver (mongodb-csharp driver) - Using Linq - Using NoRM for strong typing • Accessing MongoDB via REST • Replication • Sharding Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0
  • 40. Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0 ?
  • 41. About Me Chris Edwards Developer at BancVue Ltd Email: ChrisEdwards357@gmail.com Blog: http:// chrisedwards.dreamhosters.com Twitter: @cedwards Github: http://github.com/chrisedwards BancVue Web: www.bancvue.com Phone: 877.342.2557 We are hiring C# developers: Introduction to MongoDB A No-SQL Persistence Alternative A U S T I N - C O D E - C A M P - 2 0 1 0

Editor's Notes

  1. This is a test note