Your SlideShare is downloading. ×
HandsOn MongoDB
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

HandsOn MongoDB

4,622

Published on

deck from

deck from

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,622
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
120
Comments
0
Likes
5
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
  • 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
  • Transcript

    • 1. Hands On Lynn Langit April 2013 – for BigData Tech Con – Boston, MA
    • 2. 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
    • 3. 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 )
    • 4. DemoONLINE TUTORIAL - TRY IT OUT
    • 5. Get MongoDB and Driver(s)• Quick download, zero install• Also get your driver (C# for us)
    • 6. Use 10gen Quick Reference Cards
    • 7. DemoQUICKSTART - SETUP MONGODB
    • 8. Starting up MongoDB
    • 9. Using the console
    • 10. Demo -- Using MongoVue
    • 11. Understanding MongoVue
    • 12. MongoDB in the Cloud - MongoLab
    • 13. Adding Data• Data must be in JSON format - converter• “Insert” CREATES a collection if needed
    • 14. DemoADDING DATA TO MONGODB
    • 15. Importing data…using MongoVue
    • 16. Viewing Collection Data
    • 17. DemoQUERY MONGODB DATA
    • 18. Using FindFind, Fields, Sort, Count, Skip, Limit, Visualize or Export
    • 19. Comparing…
    • 20. Simple Query Translations
    • 21. More Query Translations
    • 22. What is Grouping?• Similar to T-SQL ‘Group By’• Written in javascript
    • 23. About the Aggregation Framework• New in MongoDB 2.2• Layer on top to facilitate easier query-writing
    • 24. 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
    • 25. 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)
    • 26. MapReduce in MongoVue - I
    • 27. MapReduce in MongoVue - II
    • 28. DemoMAPREDUCE IN MONGODB
    • 29. What is GridFS?• Used to hold objects larger than 4 MB
    • 30. DemoUSING GRIDFS
    • 31. Data Visualization
    • 32. 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
    • 33. Update Query Translations
    • 34. Using Update
    • 35. 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
    • 36. What about Joins? Can use Arrays No Can De-normalize traditional Can use Embedded schema joins in Documents MongoDB Can use DBRef
    • 37. Understanding Explain• Query execution detail plan• Review number of scanned objects
    • 38. DemoADD INDEXES TO MONGODB
    • 39. 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
    • 40. DemoCONNECTING TO MONGODB WITHC#
    • 41. Programming against MongoDB
    • 42. 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
    • 43. 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
    • 44. 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
    • 45. Why use MongoDB?Data Structure• Document-like• Semi-structured• Few Joins• GeospatialData Volume• Large or Huge• Distributed• Unpredictable
    • 46. MongoDB Scenarios Document E-commerce Archiving / Management (catalog portion event logging systems only) Real timeanalytics (based Gaming Geospatial on logging) Mobile
    • 47. 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
    • 48. The Changing Data Landscape Other ServicesRDBMS NoSQL
    • 49. • recipes)www.TeachingKidsProgramming.org• Free Courseware (• Do a Recipe  Teach a Kid (Ages 10 ++)• Java or Microsoft SmallBasic 
    • 50. 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

    ×