Introduction to MongoDB (Version 1)
Upcoming SlideShare
Loading in...5
×
 

Introduction to MongoDB (Version 1)

on

  • 339 views

 

Statistics

Views

Total Views
339
Views on SlideShare
339
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Introduction to MongoDB (Version 1) Presentation Transcript

  • 1. MongoDB Introduction to MongoDB
  • 2. What is NoSQL? A NoSQL database provides a mechanism for storage and retrieval of data that uses looser consistency models than traditional relational databases. -Wikipedia
  • 3. CAP Theorem
  • 4. Database Objects ● ● ● ● Database Collection Document Index
  • 5. Map it! MongoDB SQL Server Database Database Collections Tables Document Row
  • 6. What is the document here? { { _id : 1, _id : 1, name : “Sam Walton”, name : “Sam Walton”, age : 74, age : 74, company : company : { [ name : ”walmart” “Walmart”,”Walton Five” } ] } } In MongoDB we use JSON to represent our data. Document is more like a record in Relational Databases.
  • 7. Data Type ObjectID - 12bytes Number String Boolean Date/Time null
  • 8. Designing Denormalizing is ok? Foreign keys? NO Then How? Is it same for all NoSQL databases?
  • 9. DEMO
  • 10. Indexing Can I create Secondary indexes? Lots of indexes ? NO? Full text search ?
  • 11. Authentication By default authentication is turned off in MongoDB. (So we have to turn it on!) Users/Roles SSL Schema Injection
  • 12. WriteConcern Journaling (j) Basically log mechanism for durability w option You can have -1,0,1... for this value. majority, n, tags -1 - No errors will be returned. 0 - Server error will not be returned. But Network,Socket errors would be reported.
  • 13. Anything else? SlaveOk Sharding
  • 14. Sample C# Code using MongoDB.Bson; using MongoDB.Driver; String connectionString = "mongodb://localhost"; MongoClient client = new MongoClient(connectionString); MongoDatabase database = server.GetDatabase("blogging"); MongoCollection collection = database.GetCollection("blogs"); BsonDocument document = new BsonDocument(); document.Add("name", “Walton”); document.Add("age", 74); collection.Insert(document);
  • 15. Connection String http://docs.mongodb. org/manual/reference/connection-string/ mongodb://sysop:moon@example1.com,example2.com,example3.com/?w=2&wtimeoutMS=2000
  • 16. DEMO
  • 17. Thank you!