MongoDB
AGENDA • Introduction • NoSQL • MongoDB • Concepts/Fundamentals • Working with MongoDB (hands-on)
WHO AM I? • Software Developer/Architect/Consultant for 15 years. • Working in the .NET stack (mainly in the web space) since 2001. • Started getting interested in MongoDB about 2-3 years ago. David Green @davidjeet about.me/davidgreen24
WHERE DOES THIS TALK FIT IN?
CLASSIC N-TIER ARCHITECTURE User Interface (UI) Business Layer/Service You Are Here Data Layer
AGENDA • Introduction • NoSQL • MongoDB • Concepts/Fundamentals • Working with MongoDB (hands-on)
WHAT IS NOSQL?
All Databases Relational Databases (Oracle, mySQL, Postgres, SQL Server) NoSQL (MongoDB, Redis, Neo4J, Cassandra, Hbase)
What is NoSQL? Martin Fowler: Some characteristics are common amongst these databases, but none are definitional. Model not using the SQL language) Designed to run on large clusters Not using the relational model Open source No schema enforced
NoSQL Database Families* Key-value Columnar • HBase • Cassandra • Hypertable Document • MongoDB • CouchDB • RavenDB • • • • Redis Riak Memcached Voldemort Graph • Neo4J • GiraffeDB • InfiniteGraph * “Seven Databases in Seven Weeks”, Eric Redmond and Jim R. Wilson
memCached X MongoDB X SQL Server X
WHO USES THIS NOSQL STUFF?
AGENDA • Introduction • NoSQL • MongoDB • Concepts/Fundamentals • Working with MongoDB (hands-on)
WHAT IS MONGODB?
WHAT IS MONGODB? Open source NoSQL database Documentoriented Stores JSON-like documents (dynamic schemas) Includes a strong query language (Javascript) Powerful, flexible indexing (including geospatial) Sharding and replication Cross-Platform (many drivers – e.g. C#, Java, Python, Ruby)
Why MongoDB? 1. Open Source - no licensing fees. 2. Relatively developer friendly and easy to ramp up. 3. Fast reads.
MongoDB Search Trends – Google
WHEN NOT TO USE MONGODB When one or more of the following are insurmountable even after modeling: • Relationships/Join • Transactions • Write Safety (High volume of writes/sec. scenarios)
AGENDA • Introduction • NoSQL • MongoDB • Concepts/Fundamentals • Working with MongoDB (hands-on)
MONGODB FUNDAMENTALS
10GEN QUICK REFERENCE CARD
MONGODB - JSON & BSON  JSON  Number  String  Boolean  Array  Object  null  BSON = JSON +   DateTime  Byte Arrays  GeoSpatial
EXAMPLE BSON DOCUMENT { } "_id" : ObjectId("5218282429f4a04648f64870"), "Title": "What's new in MongoDB 2.4", "Content" : "MongoDB 2.4 represents hundreds of improvements and features driven by user requests...", "Author" : { "FirstName" : "David", "LastName" : "Green" }, "CreatedOn" : ISODate("2013-07-19T01:30:52Z"), "LastModifiedOn" : ISODate("2013-08-24T03:27:32Z"), "Comments" : [], "Tags" : [ ”Databases", ”Features", "NoSQL", "MongoDB" ]
INSTALLING MONGO
MONGODB DATABASE INSTALL Starting Up the Server
USING THE CONSOLE
AGENDA • Introduction • NoSQL • MongoDB • Concepts/Fundamentals • Working with MongoDB (hands-on)
https://github.com/davidjeet/OpenDataDay/
THE END

Mongodb open data day 2014