Your SlideShare is downloading. ×
  • Like
  • Save
MongoDB for the SQL Server
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

MongoDB for the SQL Server

  • 290 views
Published

MongoDB for the SQL Server

MongoDB for the SQL Server

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
290
On SlideShare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • Source - http://www.10gen.com/what-is-mongodb
  • https://www.youtube.com/watch?v=k2YFy5IQu1M
  • http://www.mongodb.org/downloads
    https://github.com/mongodb/mongo-csharp-driver/downloads
  • http://www.mongovue.com/
  • http://amitpiplani.blogspot.com/2010/05/u-pick-2-selection-for-nosql-providers.html

  • http://docs.mongodb.org/manual/faq/developers/#how-do-i-do-transactions-and-locking-in-mongodb
  • http://www.10gen.com/reference
  • http://www.mongodb.org/display/DOCS/Use+Cases
  • http://www.mongodb.org/display/DOCS/Use+Cases
  • Free conversion (CSV to JSON) - http://www.cparker15.com/code/utilities/csv-to-json/
  • http://rickosborne.org/download/SQL-to-MongoDB.pdf
  • http://www.mongovue.com/2010/06/29/find/
  • http://api.mongodb.org/wiki/current/Aggregation.html
  • http://docs.mongodb.org/manual/aggregation/
    And http://docs.mongodb.org/manual/reference/sql-aggregation-comparison/
  • http://www.mongovue.com/2010/09/14/updating-collections/
  • http://learnmongo.com/posts/getting-started-with-mongodb-gridfs/
    Example: http://stackoverflow.com/questions/4988436/mongodb-gridfs-with-c-how-to-store-files-such-as-images/10645816#10645816
    Default chunk size is 256kb

    Db.fs.files
    Fs.chunk
    Upload.date.date()
  • https://www.youtube.com/watch?v=NCp4n6xWw68
  • http://www.youtube.com/watch?v=NCp4n6xWw68

Transcript

  • 1. MongoDB for the SQL Server Pro
  • 2. What is MongoDB? • Open source NoSQL database • Document-oriented • Stores JSON-like documents (dynamic schemas) • Includes a strong query language (javascript) • Powerful, flexible indexing (including geospatial) • Sharding and replication • Cross-Platform (many drivers )
  • 3. QUICKSTART - SETUP MONGODB Demo
  • 4. Get MongoDB and Driver(s) • Quick download, zero install • Also get your driver (C# for us)
  • 5. Starting up MongoDB
  • 6. Using the Console
  • 7. Using MongoVue
  • 8. Connecting with MongoVue
  • 9. Using MongoVue
  • 10. COMPARING DOCUMENT DATABASES TO RDBMS SYSTEMS Understanding more..
  • 11. So which type of NoSQL? CAP… Consistency Availability Partition Tolerance CP = noSQL/column Hadoop Big Table H-base MemCacheDB (graph)? CA = SQL/RDBMS SQL Sever / SQL Azure Oracle MySQL AP = noSQL/document or key/value MongoDB DynamoDB CouchDB Cassandra Voldemort
  • 12. DB Features for MongoDB & SQL Server primary keys and indexes queries with models for sorting / limiting results a strong typing system aggregations like SUM(), COUNT(), etc… Large object support
  • 13. DB Features unique to Document DBs Collections, not Tables Query language, not T-SQL Idrefs, not Joins No pre-defined Schema • Aggregation Framework • Grouping or MapReduce Aggregations • No multi-document transactions No Transactions No Full-text search
  • 14. Use 10gen Quick Reference Cards
  • 15. DB Features of note in MongoDB • BSON supports more complex types (date, geo-spatial, etc…) • Supports dynamic queries via proprietary query language – Uses “find()” which returns a [lazy] cursor – Multi-key indexes can be created • Scalability via Replication and Sharding
  • 16. Why use MongoDB? • Document-like • Semi-structured • Few Joins • Geospatial Data Structure • Large or Huge • Distributed • Unpredictable Data Volume
  • 17. MongoDB Scenarios Document Management systems E-commerce (catalog portion only) Archiving / event logging Real time analytics (based on logging) Gaming Geospatial Mobile
  • 18. IMPORTING DATA TO MONGODB Demo
  • 19. Adding Data • Data must be in JSON format - converter • “Insert” CREATES a collection if needed
  • 20. Importing data…using MongoVue
  • 21. Viewing Collection Data
  • 22. USING VELOCITY FOR MODELING Demo
  • 23. Modeling Use short names • each name is saved for each document • can save up to 30% storage Keep collections small • Can create non- default (narrower) key • Document size maximum is 4 MB Use GridFS for BLOBs
  • 24. Comparing…
  • 25. QUERY MONGODB DATA Demo
  • 26. Using Find Find, Fields, Sort, Count, Skip, Limit, Visualize or Export
  • 27. Data Visualization
  • 28. Queries
  • 29. Queries 2 …
  • 30. Queries 3…
  • 31. What is Grouping? • Similar to T-SQL ‘Group By’ • Written in javascript
  • 32. What about Joins? No traditional joins in MongoDB Can use Arrays Can use Embedded Documents Can use DBRef Can De- normalize schema
  • 33. About the Aggregation Framework • New in MongoDB 2.2 • Layer on top to facilitate easier query-writing
  • 34. Query Tuning • Use best indexes – Evaluate use of _id – Add columns to index (specificity) – Multiple columns, most specific first – Can use fully covered indexing (indexOnly:true) – Test to make sure indexes are being used • Qty scanned s/b same as QTY returned • Use .explain
  • 35. Understanding Explain • Query execution detail plan • Review number of scanned objects
  • 36. ADD INDEXES TO MONGODB Understanding more
  • 37. Modifying Data Update • alone does a replace Update w/ $set • does an update Update w/ $inc • increments Upserts • must be enabled • then insert if new, update if existing Multiple field updates • occur by default
  • 38. Using Update
  • 39. USING GRIDFS Understanding more…
  • 40. What is GridFS? • Used to hold objects larger than 16 MB
  • 41. CONNECTING TO MONGODB WITH C# Demo
  • 42. Programming against MongoDB
  • 43. More Information • MongoDB – http://www.mongodb.org • 10gen – http://www.10gen.com/contact – info@10gen.com • YouTube videos (from Lynn Langit) – MongoDB Playlist - https://www.youtube.com/playlist?list=PLCE5902FB1D284880 &feature=view_all • MongoDB LA UG - http://www.meetup.com/Los-Angeles- MongoDB-User-Group
  • 44. The Changing Data Landscape NoSQL RDBMS Other Services