HandsOn MongoDB
Upcoming SlideShare
Loading in...5
×
 

HandsOn MongoDB

on

  • 4,908 views

deck from

deck from

Statistics

Views

Total Views
4,908
Views on SlideShare
2,715
Embed Views
2,193

Actions

Likes
5
Downloads
111
Comments
0

5 Embeds 2,193

http://lynnlangit.com 2135
https://twitter.com 46
http://tweetedtimes.com 9
http://reader.aol.com 2
http://www.newsblur.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

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
  • Source - http://www.10gen.com/what-is-mongodb
  • http://www.mongodb.org/downloadshttps://github.com/mongodb/mongo-csharp-driver/downloads
  • http://www.10gen.com/reference
  • https://www.youtube.com/watch?v=k2YFy5IQu1M
  • http://www.mongovue.com/
  • Free conversion (CSV to JSON) - http://www.cparker15.com/code/utilities/csv-to-json/
  • http://www.mongovue.com/2010/06/29/find/
  • http://rickosborne.org/download/SQL-to-MongoDB.pdf
  • 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://blog.mongovue.com/2010/11/03/yet-another-mongodb-map-reduce-tutorial/
  • http://www.mongovue.com/2010/11/03/yet-another-mongodb-map-reduce-tutorial/Link to download source data - http://www.geobytes.com/freeservices.htm
  • 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#10645816Default chunk size is 256kbDb.fs.filesFs.chunkUpload.date.date()
  • http://www.mongovue.com/2010/09/14/updating-collections/
  • https://www.youtube.com/watch?v=NCp4n6xWw68
  • http://www.youtube.com/watch?v=NCp4n6xWw68
  • http://docs.mongodb.org/manual/faq/developers/#how-do-i-do-transactions-and-locking-in-mongodb
  • http://www.mongodb.org/display/DOCS/Use+Cases
  • http://www.mongodb.org/display/DOCS/Use+Cases
  • Lynn

HandsOn MongoDB HandsOn MongoDB Presentation Transcript

  • Hands On Lynn Langit April 2013 – for BigData Tech Con – Boston, MA
  • Data Expertise / Lynn Langit• Industry awards – Microsoft – MVP for SQL Server – Google – GDE for Cloud Platform – 10Gen – Master for MongoDB• Practicing Architect• Technical author / trainer – Pluralsight – Google Cloud Series – DevelopMentor – SQL Server Series – 2 books on SQL Server BI• Former MSFT FTE – 4 years
  • What is MongoDB? Stores JSON-like Open source Document- documentsNoSQL database oriented (dynamic schemas)Includes a strong Powerful, flexible Sharding and query language indexing (including replication (javascript) geospatial) Cross-Platform (many drivers )
  • DemoONLINE TUTORIAL - TRY IT OUT
  • Get MongoDB and Driver(s)• Quick download, zero install• Also get your driver (C# for us)
  • Use 10gen Quick Reference Cards
  • DemoQUICKSTART - SETUP MONGODB
  • Starting up MongoDB
  • Using the console
  • Demo -- Using MongoVue
  • Understanding MongoVue
  • MongoDB in the Cloud - MongoLab
  • Adding Data• Data must be in JSON format - converter• “Insert” CREATES a collection if needed
  • DemoADDING DATA TO MONGODB
  • Importing data…using MongoVue
  • Viewing Collection Data
  • DemoQUERY MONGODB DATA
  • Using FindFind, Fields, Sort, Count, Skip, Limit, Visualize or Export
  • Comparing…
  • Simple Query Translations
  • More Query Translations
  • What is Grouping?• Similar to T-SQL ‘Group By’• Written in javascript
  • About the Aggregation Framework• New in MongoDB 2.2• Layer on top to facilitate easier query-writing
  • MapReduce in MongoDB Map Reduce Optional Post- • Transforms input • Transform ProcessingOptional Pre- and emits key => key/values to • Finalize Processing value pairs output via • Filters • These K/V pairs will aggregation be reduced
  • Using MapReduce• Example: find the 2 closest cities in each country, except in United States• Using SQL Server (T-SQL) vs.• Using MongoDB (MapReduce in JavaScript)
  • MapReduce in MongoVue - I
  • MapReduce in MongoVue - II
  • DemoMAPREDUCE IN MONGODB
  • What is GridFS?• Used to hold objects larger than 4 MB
  • DemoUSING GRIDFS
  • Data Visualization
  • Modifying DataUpdate Update w/ $set Update w/ $inc• alone does a replace • does an update • increments Upserts Multiple field • must be enabled updates • then insert if • occur by default new, update if existing
  • Update Query Translations
  • Using Update
  • Modeling Use GridFS for BLOBs Keep collections smallUse short names • Can create non- default (narrower) key• each name is saved • Document size for each document maximum is 16 MB• can save up to 30% storage
  • What about Joins? Can use Arrays No Can De-normalize traditional Can use Embedded schema joins in Documents MongoDB Can use DBRef
  • Understanding Explain• Query execution detail plan• Review number of scanned objects
  • DemoADD INDEXES TO MONGODB
  • Index Tuning Best Practices • Non _id • Add columns to index (specificity) Create best indexes • Multiple columns, most specific first • Based on query workloads Test newindexes for use
  • DemoCONNECTING TO MONGODB WITHC#
  • Programming against MongoDB
  • DB Features for MongoDB & SQL Serverprimary keys and indexes queries with models for sorting / limiting results a strong typing system aggregations like SUM(), COUNT(), etc… Geospatial or Text search
  • DB Features unique to Document DBs Collections • not Tables Query language • not T-SQL Idrefs • not JoinsNo pre-defined Schema • Nesting is common • Aggregation Framework Aggregations • Grouping or MapReduce • Within same document Transactions • No multi-document transactions
  • 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• Role-based and Kerberos Security• Scalability via Replication/Sharding – including hashed sharding
  • Why use MongoDB?Data Structure• Document-like• Semi-structured• Few Joins• GeospatialData Volume• Large or Huge• Distributed• Unpredictable
  • MongoDB Scenarios Document E-commerce Archiving / Management (catalog portion event logging systems only) Real timeanalytics (based Gaming Geospatial on logging) Mobile
  • 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
  • The Changing Data Landscape Other ServicesRDBMS NoSQL
  • • recipes)www.TeachingKidsProgramming.org• Free Courseware (• Do a Recipe  Teach a Kid (Ages 10 ++)• Java or Microsoft SmallBasic 
  • Toward Data Craftsmanship… Follow me @LynnLangit RSS my blog www.LynnLangit.com Hire me • To help build your BI/Big Data solution • To teach your team next gen BI • To learn more about using NoSQL solutions