SlideShare a Scribd company logo
Big Data Tools Workshop
  Introduction to MongoDB
About Me
Sundar Nathikudi
  – Co-Founder & CTO , MLN Advertising
  – Former Principal Engineer , AOL Advertising
About MLN Advertising
• Baltimore based Online Advertising Startup
• MediaGlu - Cloud based Ad Platform
• Our engineers use
Why Does MediaGlu Need Big Data?-
MediaGlu takes a holistic approach to marketing and advertising - by using real data and user
   path tracking, our state of the art technology gives marketers the tools to find their
             customers wherever they are, in Search, Social & Content sites.

Data Management
Tag Management: One tag tracks all        Discover Insights
your digital assets (website, social
media, etc).                              Channel Analytics: Visualize the         Action
                                          effectiveness of your ad campaigns
                                          across media by learning what
Media Attribution: Track user actions                                              Campaign Management: Let MediaGlu
                                          interactions actually drive revenue.
and attribute them, even from sources                                              improve your media bidding and
like Facebook and Pinterest.                                                       creative scheduling in Real Time.
                                          User Analytics: Visualize the timeline
                                          in which users interact with your
Reporting: See how user actions                                                    Budget Optimization: Get reports
                                          brand.
connect across the digital space in one                                            detailing which channels are providing
intuitive interface.                                                               the most value.
                                          Predictive Analytics: Visualize how
                                          channel and user path metrics overlap
                                                                                Personalize Web/Social Experience:
                                          into predictable behavior.
                                                                                Custom tailored brand interactions
                                                                                based on known and predicted
                                                                                behavior.
Agenda
• Big Data and NoSQL Basics
• MongoDB Fundamentals
• Running MongoDB
• Lab #1 - Shell Commands
• Lab #2 - MongoDB Map /Reduce and
  Aggregation Framework
• Replication and Sharding
Era of Big Data
Era of Big Data
Era of Big Data
• Facebook
  – 2.7 billion likes made daily on and off of the
    Facebook site
  – 300 million photos uploaded
  – 500+ terabytes of new data "ingested"
• Twitter
  – 340 million tweets daily
  – 500 Million Users
Big Data - Definition
• Volumes & Volumes of data
• Data does not fit on one Rack.
• Unstructured or Semi Structured
RDBMS & Big Data
• Pros
   – Oracle, SQL server, MySql etc..
   – Good for structured data and relational model
   – Supports Partitioning
   – ACID
   – Transactions
• Cons
   – Joins make it difficult for horizontal scaling
   – Vertical scaling is limited by physics and cost
   – Hard to scale vertically in cloud.
NoSQL – Not Only Sql
• Not using the relational model (nor the SQL
  language)
• Open source
• Designed to run on large clusters
• No schema, allowing fields to be added to any
  record without controls
• Based on the needs of web 2.0 properties
• Rise of NoSQL = Polyglot Persistence
NoSQL – Data Models
• Key Value Stores
    – data is stored in Key-Value pairs
    – support get, put, and delete operations based on a primary key
    – Couchbase(membase), Redis , Riak
• Document
    – store data in structured “documents” such as JSON/XML with no support to
      relationships/joins
    – MongoDB, CouchDB, SimpleDB
• Column Family (Big Table)
    – contains columns of related data
    – HBase, Cassandra
• Graph
    – organize data into node and edge graphs; they work best for data that has
      complex relationship structures
    – Facebook social graph
    – Neo4J
NoSQL – CAP Theorem
• Consistency - all nodes should see the same data at the same
  time.
• Availability – node failures do not prevent ongoing writes
  /reads
• Partition- Tolerance – system should continue to operate
  irrespective of data loss

     Eric Brewer – “distributed system can satisfy any two
       of these guarantees at the same time, but not all
                             three”
NoSQL – Triangle of compromise
What’s a document database
• Composed of Documents – Self describing
• Schema Free
• Store arbitrary data – Collections ,trees
What is JSON??
• Java Script Object Notation
• Lightweight data-interchange format
• Elements of JSON            { "id": 1,
   – Object : K/V Pairs        "name": "Foo",
                               "price": 123,
   – Key, String               "tags": [ "Bar", "Eek" ],
   – Value                     "stock": { "warehouse": 300,
                                          "retail": 20 }
      •   Number                }
      •   String
      •   Boolean
      •   Array
      •   Object
MongoDB - Overview
• BSON – Bin-ary-en-coded seri-al-iz-a-tion of
  JSON-like doc-u-ments(more at
  http://bsonspec.org/)
• Schema Less
• Embedded documents and arrays reduce need
  for joins
• Scalable – Replication and Sharding
• Best features of key /value store, document
  and relational databases in one .
MongoDB - Overview
• Name stems from humongous
• 10 gen
• Written in C++
• Understands Java script
• Spider Monkey Java script Engine for server-
  side Javascript execution
• Lots of language drivers available
Languages Supported
Blog Post - Relational Model
Blog Post - Document Model
{ _id: 1234,
 author: { name: "Bob Davis", email : "bob@bob.com" },
 post: "In these troubled times I like to …",
 date: { $date: "2010-07-12 13:23UTC" },
 location: [ -121.2322, 42.1223222 ],
 rating: 2.2,
 comments: [ { user: "jgs32@hotmail.com", upVotes: 22, downVotes: 14, text:
                     "Great point! I agree" },
               { user: "holly.davidson@gmail.com", upVotes: 421, downVotes:
                     22, text: "You are an idiot" } ],
 tags: [ "Politics", "Virginia" ]
}
No SQL vs. RDBMS terminology
  MySql         NoSQL
  Database      Database
  Table         Collection
  Index         Index
  Row           Document
  Column        Field
  Join          Embedding and Linking
  Primary Key   _id field
  Group By      Aggregation
Installing Mongo DB
• Mongo Distributions
  – OS X, Linux , Windows, Solaris
  – Runs on commodity hardware
Installing Mongo DB
• Download Mongo DB server
  – http://www.mongodb.org/downloads
  – http://www.mlnsitelabs.com/mongodb
  – Extract the bin folder to C:MongoDB
• Create Data Folder - C:MongoDbData
• To Start from command line
  – Run Mongo.Bat
• To install as a window service
  – Run MongoService.bat from command line.
Installing MongoVue GUI
• Download MongoVue GUI tool
  – http://www.mongovue.com/downloads/
  – http://www.mlnsitelabs.com/mongodb
System components


mongod.exe                            mongo.exe
 database server                         shell




                   mongos.exe
                    sharding router
Learning MongoDB Shell
• Interactive java script Shell
• Use online browser shell
  – http://try.mongodb.org/
• Or run from command line
  – mongo http://localhost:27017
Learning Shell Commands
• Create Database
  – use student;
  – db.student.scores.find();



• Inserting a document into collection
  –   var student = {name: 'Jim', scores: [75, 99, 87.2]};
  –   db.scores.save(student);
  –   var student = {name: 'John', scores: [35, 45, 55]};
  –   db.scores.save(student);
Learning Shell Commands
• Querying a collection
  – db.scores.find();
  – db.scores.find({scores: {'$gt': 15}});

• Updating a document
  – db.scores.update({name : 'Jim'},{name: 'Jim', scores: [92,34,54]});



• Deleting a document
  – db.scores.remove({name: Jim'});
Lab #1 - Shell Commands
• http://www.mlnsitelabs.com/mongodb/Labs/
  Lab1


            Lets Do it!!
Data Types
•   string
•   integer
•   boolean
•   double
•   null
•   array
•   object
•   binary data
•   regular expression
Query Selectors
• Selectors
  – $ne
  – $lt
  – $lte
  – $gt
  – $gte
  – $in
  – $nin
  – $all
Learning Shell Commands
• Creating an index
  – db.scores.ensureIndex(“{name:1}”)
Indexes
• What is an Index??
  – structure that allows you to quickly locate
    documents based on the values stored in certain
    specified fields.
• Indexes enhance query performance
Indexes
• Mongo DB Indexes
  – defines indexes on a per-collection level.
  – B-Tree Indexes
  – Compound indexes with multiple fields
     • db.scores.ensureIndex(“{ name: 1, id: 1 }”};
  – Unique Index
     • db.addresses.ensureIndex( { "user_id": 1 }, { unique: true } )
  – Sparse Index
     • db.addresses.ensureIndex( { "xmpp_id": 1 }, { sparse: true } )
Map Reduce
• Pattern to allow computations to be
  parallelized over a cluster.
• Group By in SQL
Map Reduce
• Write two functions – Map and Reduce
• Write them in Java script
• Map Function :
   – Called once per document – returns key and values
• Reduce Function
   – Called Once per key emitted, with an array of values
• Finalize (optional)
   – Allowing rounding up of the reduced data set.
Map Reduce
• User Profile
{
    "_id" : ObjectId("505e717a6794e396ac493e37"),
    "UserId" : NumberLong(5209704),
    "Browser" : "Microsoft Internet Explorer",
    "Gender" : "M",
    "CountryCode" : "US",
    "State" : "FL",
    "City" : "Spring Hill"
}

• Count the users from california by Browser and Gender
Map Reduce
• Map Function
   – function() {
                var key = { Browser:this.Browser, Gender:this.Gender };
                emit(key, { Count:1 });
             }

• Reduce Function
  •   function(key, values) {
                       var cnt = 0;
                       values.forEach(function(value) {
                           cnt += value.Count;
                       });
                       return { Count:cnt };
                   }
Lab#2 – Map/Reduce
• CSV file– user profile information
• Count the users by Browser and Gender
• Download
  • http://www.mlnsitelabs.com/mongodb/Labs/Lab2
Aggregation Framework
• Map/Reduce is a big hammer
  – Sum, Average
  – Avoid java script overhead if you can
• Aggregation Framework
  – Specify a pipeline
  – Pipeline = series of operations
  – Collections run through a pipeline to produce
    aggregated result
Aggregation Framework
• $match
  – Uses query predicate
• $project
  – Uses a sample document to determine the result
• $unwind
  – Hands out the array elements one at a time
• $group
  – Aggregates items into group defined by a key
Aggregation Framework
• $sort
  – sort the result
• $limit
  – Limit the number of documents to pass
• $skip
  – Skip over the specified number of documents
Lab#3 – Aggregation framework
• CSV file– user profile information
• { aggregate : ‘UserProfileInfo',
      pipeline : [
      { $match : {State:'CA'}},
     { $group: {_id: {Browser : '$Browser', Gender :
            '$Gender'}, Count:{$sum: 1 } }},
     { $project : { _id :0, Browser : '$_id.Browser',
  Gender : '$_id.Gender', Count: 1}
  ]}
Replication
•   Data Redundancy
•   Automated Failover /HA
•   Read Scaling
•   Master – Slave Replication
    – Master handles writes
    – Slave handles reads
Replication

Slave                       Slave




         Master


                   Writes


          Client
Sharding
• Partitioning of data among multiple machines
• Enables Horizontal Scaling – writes per second
• Partition a collection, specify a shard key – ex:
  _id, timestamp
Sharding

         Config
                    Shard 1




Client   Router     Shard 2
          mongos




                     Shard 3
GridFS
• Specification for storing large files in
  MongoDB
• BSON object in MongoDB are limited to 16MB
  Size
• GridFS – Divide large files among multiple
  documents
References
• Mongo Cookbook
  – http://cookbook.mongodb.org/
• NoSQL Distilled: A Brief Guide to the Emerging
  World of Polyglot Persistence
  – http://www.amazon.com/NoSQL-Distilled-
    Emerging-Polyglot-Persistence/dp/0321826620
• Seven Databases in Seven Weeks
  – http://www.amazon.com/Seven-Databases-
    Weeks-Modern-Movement/dp/1934356921
Contacts
{
    name : “Sundar Nathikudi”
    mail: mln@mlnadvertising.com
    website: http://www.mlnadvertising.com
    }
Thank You

More Related Content

What's hot

Practical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo DbPractical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo Db
Alex Sharp
 
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB Tutorial
Steven Francia
 
Database Trends for Modern Applications: Why the Database You Choose Matters
Database Trends for Modern Applications: Why the Database You Choose Matters Database Trends for Modern Applications: Why the Database You Choose Matters
Database Trends for Modern Applications: Why the Database You Choose Matters
MongoDB
 
OSCON 2011 Learning CouchDB
OSCON 2011 Learning CouchDBOSCON 2011 Learning CouchDB
OSCON 2011 Learning CouchDB
Bradley Holt
 
MongoDB .local Munich 2019: Still Haven't Found What You Are Looking For? Use...
MongoDB .local Munich 2019: Still Haven't Found What You Are Looking For? Use...MongoDB .local Munich 2019: Still Haven't Found What You Are Looking For? Use...
MongoDB .local Munich 2019: Still Haven't Found What You Are Looking For? Use...
MongoDB
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDB
Nate Abele
 
MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...
MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...
MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...
MongoDB
 
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
Phil Windley
 
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDBMongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB
 
MongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and ImplicationsMongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and Implications
MongoDB
 
MongoDB and Schema Design
MongoDB and Schema DesignMongoDB and Schema Design
MongoDB and Schema Design
Matias Cascallares
 
Content Management with MongoDB by Mark Helmstetter
 Content Management with MongoDB by Mark Helmstetter Content Management with MongoDB by Mark Helmstetter
Content Management with MongoDB by Mark Helmstetter
MongoDB
 
Building a Social Network with MongoDB
  Building a Social Network with MongoDB  Building a Social Network with MongoDB
Building a Social Network with MongoDB
Fred Chu
 
MongoDB Launchpad 2016: What’s New in the 3.4 Server
MongoDB Launchpad 2016: What’s New in the 3.4 ServerMongoDB Launchpad 2016: What’s New in the 3.4 Server
MongoDB Launchpad 2016: What’s New in the 3.4 Server
MongoDB
 
Entity Relationships in a Document Database at CouchConf Boston
Entity Relationships in a Document Database at CouchConf BostonEntity Relationships in a Document Database at CouchConf Boston
Entity Relationships in a Document Database at CouchConf Boston
Bradley Holt
 
Transitioning from SQL to MongoDB
Transitioning from SQL to MongoDBTransitioning from SQL to MongoDB
Transitioning from SQL to MongoDB
MongoDB
 
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your MindsetMongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 

What's hot (20)

Practical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo DbPractical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo Db
 
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB Tutorial
 
Database Trends for Modern Applications: Why the Database You Choose Matters
Database Trends for Modern Applications: Why the Database You Choose Matters Database Trends for Modern Applications: Why the Database You Choose Matters
Database Trends for Modern Applications: Why the Database You Choose Matters
 
OSCON 2011 Learning CouchDB
OSCON 2011 Learning CouchDBOSCON 2011 Learning CouchDB
OSCON 2011 Learning CouchDB
 
MongoDB .local Munich 2019: Still Haven't Found What You Are Looking For? Use...
MongoDB .local Munich 2019: Still Haven't Found What You Are Looking For? Use...MongoDB .local Munich 2019: Still Haven't Found What You Are Looking For? Use...
MongoDB .local Munich 2019: Still Haven't Found What You Are Looking For? Use...
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDB
 
MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...
MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...
MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...
 
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
 
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDBMongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
 
MongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and ImplicationsMongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and Implications
 
MongoDB and Schema Design
MongoDB and Schema DesignMongoDB and Schema Design
MongoDB and Schema Design
 
Content Management with MongoDB by Mark Helmstetter
 Content Management with MongoDB by Mark Helmstetter Content Management with MongoDB by Mark Helmstetter
Content Management with MongoDB by Mark Helmstetter
 
Building a Social Network with MongoDB
  Building a Social Network with MongoDB  Building a Social Network with MongoDB
Building a Social Network with MongoDB
 
MongoDB Launchpad 2016: What’s New in the 3.4 Server
MongoDB Launchpad 2016: What’s New in the 3.4 ServerMongoDB Launchpad 2016: What’s New in the 3.4 Server
MongoDB Launchpad 2016: What’s New in the 3.4 Server
 
Entity Relationships in a Document Database at CouchConf Boston
Entity Relationships in a Document Database at CouchConf BostonEntity Relationships in a Document Database at CouchConf Boston
Entity Relationships in a Document Database at CouchConf Boston
 
Transitioning from SQL to MongoDB
Transitioning from SQL to MongoDBTransitioning from SQL to MongoDB
Transitioning from SQL to MongoDB
 
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your MindsetMongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
 

Viewers also liked

Mongo db tutorials
Mongo db tutorialsMongo db tutorials
Mongo db tutorials
Anuj Jain
 
Administration (Eliot Horowitz)
Administration (Eliot Horowitz)Administration (Eliot Horowitz)
Administration (Eliot Horowitz)
MongoSF
 
Shankar's mongo db presentation
Shankar's mongo db presentationShankar's mongo db presentation
Shankar's mongo db presentation
Shankar Kamble
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
Harischandra M K
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
Dhaval Mistry
 
Connecting NodeJS & MongoDB
Connecting NodeJS & MongoDBConnecting NodeJS & MongoDB
Connecting NodeJS & MongoDB
Enoch Joshua
 
NOSQL Overview
NOSQL OverviewNOSQL Overview
NOSQL Overview
Tobias Lindaaker
 
NoSQL databases - An introduction
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introduction
Pooyan Mehrparvar
 
Mongo DB
Mongo DB Mongo DB
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
SpringPeople
 
Mongo db
Mongo dbMongo db
Mongo db
Noman Ellahi
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
Harri Kauhanen
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for Beginners
Enoch Joshua
 
Mongo DB
Mongo DBMongo DB
Mongo DB
Karan Kukreja
 
Mongo db
Mongo dbMongo db
Mongo db
Akshay Mathur
 
IOT Based Home Automation using Raspberry Pi-3
IOT Based Home Automation using Raspberry Pi-3IOT Based Home Automation using Raspberry Pi-3
IOT Based Home Automation using Raspberry Pi-3
Mohammad Qasim Malik
 
Mongo DB
Mongo DBMongo DB
Mongo DB
Edureka!
 
MongoDB-Beginner tutorial explaining basic operation via mongo shell
MongoDB-Beginner tutorial explaining basic operation via mongo shellMongoDB-Beginner tutorial explaining basic operation via mongo shell
MongoDB-Beginner tutorial explaining basic operation via mongo shell
Priti Solanki
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
Alex Sharp
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Ravi Teja
 

Viewers also liked (20)

Mongo db tutorials
Mongo db tutorialsMongo db tutorials
Mongo db tutorials
 
Administration (Eliot Horowitz)
Administration (Eliot Horowitz)Administration (Eliot Horowitz)
Administration (Eliot Horowitz)
 
Shankar's mongo db presentation
Shankar's mongo db presentationShankar's mongo db presentation
Shankar's mongo db presentation
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
Connecting NodeJS & MongoDB
Connecting NodeJS & MongoDBConnecting NodeJS & MongoDB
Connecting NodeJS & MongoDB
 
NOSQL Overview
NOSQL OverviewNOSQL Overview
NOSQL Overview
 
NoSQL databases - An introduction
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introduction
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
 
Mongo db
Mongo dbMongo db
Mongo db
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for Beginners
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
Mongo db
Mongo dbMongo db
Mongo db
 
IOT Based Home Automation using Raspberry Pi-3
IOT Based Home Automation using Raspberry Pi-3IOT Based Home Automation using Raspberry Pi-3
IOT Based Home Automation using Raspberry Pi-3
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
MongoDB-Beginner tutorial explaining basic operation via mongo shell
MongoDB-Beginner tutorial explaining basic operation via mongo shellMongoDB-Beginner tutorial explaining basic operation via mongo shell
MongoDB-Beginner tutorial explaining basic operation via mongo shell
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 

Similar to MediaGlu and Mongo DB

Accra MongoDB User Group
Accra MongoDB User GroupAccra MongoDB User Group
Accra MongoDB User Group
MongoDB
 
MongoDB Tick Data Presentation
MongoDB Tick Data PresentationMongoDB Tick Data Presentation
MongoDB Tick Data Presentation
MongoDB
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
Rajesh Kumar
 
MongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlMongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behl
TO THE NEW | Technology
 
Nosql Now 2012: MongoDB Use Cases
Nosql Now 2012: MongoDB Use CasesNosql Now 2012: MongoDB Use Cases
Nosql Now 2012: MongoDB Use Cases
MongoDB
 
QuerySurge Slide Deck for Big Data Testing Webinar
QuerySurge Slide Deck for Big Data Testing WebinarQuerySurge Slide Deck for Big Data Testing Webinar
QuerySurge Slide Deck for Big Data Testing Webinar
RTTS
 
NoSQL Simplified: Schema vs. Schema-less
NoSQL Simplified: Schema vs. Schema-lessNoSQL Simplified: Schema vs. Schema-less
NoSQL Simplified: Schema vs. Schema-less
InfiniteGraph
 
Mongo db 3.4 Overview
Mongo db 3.4 OverviewMongo db 3.4 Overview
Mongo db 3.4 Overview
Norberto Leite
 
Introduction to MongoDB Basics from SQL to NoSQL
Introduction to MongoDB Basics from SQL to NoSQLIntroduction to MongoDB Basics from SQL to NoSQL
Introduction to MongoDB Basics from SQL to NoSQL
Mayur Patil
 
Scalable Architectures - Microsoft Finland DevDays 2014
Scalable Architectures - Microsoft Finland DevDays 2014Scalable Architectures - Microsoft Finland DevDays 2014
Scalable Architectures - Microsoft Finland DevDays 2014
Kallex
 
NoSQL for SQL Users
NoSQL for SQL UsersNoSQL for SQL Users
NoSQL for SQL Users
IBM Cloud Data Services
 
Introducing DocumentDB
Introducing DocumentDB Introducing DocumentDB
Introducing DocumentDB
James Serra
 
Socialite, the Open Source Status Feed
Socialite, the Open Source Status FeedSocialite, the Open Source Status Feed
Socialite, the Open Source Status Feed
MongoDB
 
Creating a Modern Data Architecture for Digital Transformation
Creating a Modern Data Architecture for Digital TransformationCreating a Modern Data Architecture for Digital Transformation
Creating a Modern Data Architecture for Digital Transformation
MongoDB
 
MongoDB 3.4 webinar
MongoDB 3.4 webinarMongoDB 3.4 webinar
MongoDB 3.4 webinar
Andrew Morgan
 
Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
 Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
MongoDB
 
NoSQL for the SQL Server Pro
NoSQL for the SQL Server ProNoSQL for the SQL Server Pro
NoSQL for the SQL Server Pro
Lynn Langit
 
Intresting changes in mongo 2.6
Intresting changes in mongo 2.6Intresting changes in mongo 2.6
Intresting changes in mongo 2.6
David Murphy
 
MongoDB 3.4: Deep Dive on Views, Zones, and MongoDB Compass
MongoDB 3.4: Deep Dive on Views, Zones, and MongoDB CompassMongoDB 3.4: Deep Dive on Views, Zones, and MongoDB Compass
MongoDB 3.4: Deep Dive on Views, Zones, and MongoDB Compass
MongoDB
 
Validations in javascript in ReactJs concepts
Validations in javascript in ReactJs conceptsValidations in javascript in ReactJs concepts
Validations in javascript in ReactJs concepts
rajkumarmech801
 

Similar to MediaGlu and Mongo DB (20)

Accra MongoDB User Group
Accra MongoDB User GroupAccra MongoDB User Group
Accra MongoDB User Group
 
MongoDB Tick Data Presentation
MongoDB Tick Data PresentationMongoDB Tick Data Presentation
MongoDB Tick Data Presentation
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
 
MongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlMongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behl
 
Nosql Now 2012: MongoDB Use Cases
Nosql Now 2012: MongoDB Use CasesNosql Now 2012: MongoDB Use Cases
Nosql Now 2012: MongoDB Use Cases
 
QuerySurge Slide Deck for Big Data Testing Webinar
QuerySurge Slide Deck for Big Data Testing WebinarQuerySurge Slide Deck for Big Data Testing Webinar
QuerySurge Slide Deck for Big Data Testing Webinar
 
NoSQL Simplified: Schema vs. Schema-less
NoSQL Simplified: Schema vs. Schema-lessNoSQL Simplified: Schema vs. Schema-less
NoSQL Simplified: Schema vs. Schema-less
 
Mongo db 3.4 Overview
Mongo db 3.4 OverviewMongo db 3.4 Overview
Mongo db 3.4 Overview
 
Introduction to MongoDB Basics from SQL to NoSQL
Introduction to MongoDB Basics from SQL to NoSQLIntroduction to MongoDB Basics from SQL to NoSQL
Introduction to MongoDB Basics from SQL to NoSQL
 
Scalable Architectures - Microsoft Finland DevDays 2014
Scalable Architectures - Microsoft Finland DevDays 2014Scalable Architectures - Microsoft Finland DevDays 2014
Scalable Architectures - Microsoft Finland DevDays 2014
 
NoSQL for SQL Users
NoSQL for SQL UsersNoSQL for SQL Users
NoSQL for SQL Users
 
Introducing DocumentDB
Introducing DocumentDB Introducing DocumentDB
Introducing DocumentDB
 
Socialite, the Open Source Status Feed
Socialite, the Open Source Status FeedSocialite, the Open Source Status Feed
Socialite, the Open Source Status Feed
 
Creating a Modern Data Architecture for Digital Transformation
Creating a Modern Data Architecture for Digital TransformationCreating a Modern Data Architecture for Digital Transformation
Creating a Modern Data Architecture for Digital Transformation
 
MongoDB 3.4 webinar
MongoDB 3.4 webinarMongoDB 3.4 webinar
MongoDB 3.4 webinar
 
Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
 Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
 
NoSQL for the SQL Server Pro
NoSQL for the SQL Server ProNoSQL for the SQL Server Pro
NoSQL for the SQL Server Pro
 
Intresting changes in mongo 2.6
Intresting changes in mongo 2.6Intresting changes in mongo 2.6
Intresting changes in mongo 2.6
 
MongoDB 3.4: Deep Dive on Views, Zones, and MongoDB Compass
MongoDB 3.4: Deep Dive on Views, Zones, and MongoDB CompassMongoDB 3.4: Deep Dive on Views, Zones, and MongoDB Compass
MongoDB 3.4: Deep Dive on Views, Zones, and MongoDB Compass
 
Validations in javascript in ReactJs concepts
Validations in javascript in ReactJs conceptsValidations in javascript in ReactJs concepts
Validations in javascript in ReactJs concepts
 

Recently uploaded

TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 

Recently uploaded (20)

TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 

MediaGlu and Mongo DB

  • 1. Big Data Tools Workshop Introduction to MongoDB
  • 2. About Me Sundar Nathikudi – Co-Founder & CTO , MLN Advertising – Former Principal Engineer , AOL Advertising
  • 3. About MLN Advertising • Baltimore based Online Advertising Startup • MediaGlu - Cloud based Ad Platform • Our engineers use
  • 4. Why Does MediaGlu Need Big Data?- MediaGlu takes a holistic approach to marketing and advertising - by using real data and user path tracking, our state of the art technology gives marketers the tools to find their customers wherever they are, in Search, Social & Content sites. Data Management Tag Management: One tag tracks all Discover Insights your digital assets (website, social media, etc). Channel Analytics: Visualize the Action effectiveness of your ad campaigns across media by learning what Media Attribution: Track user actions Campaign Management: Let MediaGlu interactions actually drive revenue. and attribute them, even from sources improve your media bidding and like Facebook and Pinterest. creative scheduling in Real Time. User Analytics: Visualize the timeline in which users interact with your Reporting: See how user actions Budget Optimization: Get reports brand. connect across the digital space in one detailing which channels are providing intuitive interface. the most value. Predictive Analytics: Visualize how channel and user path metrics overlap Personalize Web/Social Experience: into predictable behavior. Custom tailored brand interactions based on known and predicted behavior.
  • 5. Agenda • Big Data and NoSQL Basics • MongoDB Fundamentals • Running MongoDB • Lab #1 - Shell Commands • Lab #2 - MongoDB Map /Reduce and Aggregation Framework • Replication and Sharding
  • 6. Era of Big Data
  • 7. Era of Big Data
  • 8. Era of Big Data • Facebook – 2.7 billion likes made daily on and off of the Facebook site – 300 million photos uploaded – 500+ terabytes of new data "ingested" • Twitter – 340 million tweets daily – 500 Million Users
  • 9. Big Data - Definition • Volumes & Volumes of data • Data does not fit on one Rack. • Unstructured or Semi Structured
  • 10. RDBMS & Big Data • Pros – Oracle, SQL server, MySql etc.. – Good for structured data and relational model – Supports Partitioning – ACID – Transactions • Cons – Joins make it difficult for horizontal scaling – Vertical scaling is limited by physics and cost – Hard to scale vertically in cloud.
  • 11. NoSQL – Not Only Sql • Not using the relational model (nor the SQL language) • Open source • Designed to run on large clusters • No schema, allowing fields to be added to any record without controls • Based on the needs of web 2.0 properties • Rise of NoSQL = Polyglot Persistence
  • 12. NoSQL – Data Models • Key Value Stores – data is stored in Key-Value pairs – support get, put, and delete operations based on a primary key – Couchbase(membase), Redis , Riak • Document – store data in structured “documents” such as JSON/XML with no support to relationships/joins – MongoDB, CouchDB, SimpleDB • Column Family (Big Table) – contains columns of related data – HBase, Cassandra • Graph – organize data into node and edge graphs; they work best for data that has complex relationship structures – Facebook social graph – Neo4J
  • 13. NoSQL – CAP Theorem • Consistency - all nodes should see the same data at the same time. • Availability – node failures do not prevent ongoing writes /reads • Partition- Tolerance – system should continue to operate irrespective of data loss Eric Brewer – “distributed system can satisfy any two of these guarantees at the same time, but not all three”
  • 14. NoSQL – Triangle of compromise
  • 15. What’s a document database • Composed of Documents – Self describing • Schema Free • Store arbitrary data – Collections ,trees
  • 16. What is JSON?? • Java Script Object Notation • Lightweight data-interchange format • Elements of JSON { "id": 1, – Object : K/V Pairs "name": "Foo", "price": 123, – Key, String "tags": [ "Bar", "Eek" ], – Value "stock": { "warehouse": 300, "retail": 20 } • Number } • String • Boolean • Array • Object
  • 17. MongoDB - Overview • BSON – Bin-ary-en-coded seri-al-iz-a-tion of JSON-like doc-u-ments(more at http://bsonspec.org/) • Schema Less • Embedded documents and arrays reduce need for joins • Scalable – Replication and Sharding • Best features of key /value store, document and relational databases in one .
  • 18. MongoDB - Overview • Name stems from humongous • 10 gen • Written in C++ • Understands Java script • Spider Monkey Java script Engine for server- side Javascript execution • Lots of language drivers available
  • 20. Blog Post - Relational Model
  • 21. Blog Post - Document Model { _id: 1234, author: { name: "Bob Davis", email : "bob@bob.com" }, post: "In these troubled times I like to …", date: { $date: "2010-07-12 13:23UTC" }, location: [ -121.2322, 42.1223222 ], rating: 2.2, comments: [ { user: "jgs32@hotmail.com", upVotes: 22, downVotes: 14, text: "Great point! I agree" }, { user: "holly.davidson@gmail.com", upVotes: 421, downVotes: 22, text: "You are an idiot" } ], tags: [ "Politics", "Virginia" ] }
  • 22. No SQL vs. RDBMS terminology MySql NoSQL Database Database Table Collection Index Index Row Document Column Field Join Embedding and Linking Primary Key _id field Group By Aggregation
  • 23. Installing Mongo DB • Mongo Distributions – OS X, Linux , Windows, Solaris – Runs on commodity hardware
  • 24. Installing Mongo DB • Download Mongo DB server – http://www.mongodb.org/downloads – http://www.mlnsitelabs.com/mongodb – Extract the bin folder to C:MongoDB • Create Data Folder - C:MongoDbData • To Start from command line – Run Mongo.Bat • To install as a window service – Run MongoService.bat from command line.
  • 25. Installing MongoVue GUI • Download MongoVue GUI tool – http://www.mongovue.com/downloads/ – http://www.mlnsitelabs.com/mongodb
  • 26. System components mongod.exe mongo.exe database server shell mongos.exe sharding router
  • 27. Learning MongoDB Shell • Interactive java script Shell • Use online browser shell – http://try.mongodb.org/ • Or run from command line – mongo http://localhost:27017
  • 28. Learning Shell Commands • Create Database – use student; – db.student.scores.find(); • Inserting a document into collection – var student = {name: 'Jim', scores: [75, 99, 87.2]}; – db.scores.save(student); – var student = {name: 'John', scores: [35, 45, 55]}; – db.scores.save(student);
  • 29. Learning Shell Commands • Querying a collection – db.scores.find(); – db.scores.find({scores: {'$gt': 15}}); • Updating a document – db.scores.update({name : 'Jim'},{name: 'Jim', scores: [92,34,54]}); • Deleting a document – db.scores.remove({name: Jim'});
  • 30. Lab #1 - Shell Commands • http://www.mlnsitelabs.com/mongodb/Labs/ Lab1 Lets Do it!!
  • 31. Data Types • string • integer • boolean • double • null • array • object • binary data • regular expression
  • 32. Query Selectors • Selectors – $ne – $lt – $lte – $gt – $gte – $in – $nin – $all
  • 33. Learning Shell Commands • Creating an index – db.scores.ensureIndex(“{name:1}”)
  • 34. Indexes • What is an Index?? – structure that allows you to quickly locate documents based on the values stored in certain specified fields. • Indexes enhance query performance
  • 35. Indexes • Mongo DB Indexes – defines indexes on a per-collection level. – B-Tree Indexes – Compound indexes with multiple fields • db.scores.ensureIndex(“{ name: 1, id: 1 }”}; – Unique Index • db.addresses.ensureIndex( { "user_id": 1 }, { unique: true } ) – Sparse Index • db.addresses.ensureIndex( { "xmpp_id": 1 }, { sparse: true } )
  • 36. Map Reduce • Pattern to allow computations to be parallelized over a cluster. • Group By in SQL
  • 37. Map Reduce • Write two functions – Map and Reduce • Write them in Java script • Map Function : – Called once per document – returns key and values • Reduce Function – Called Once per key emitted, with an array of values • Finalize (optional) – Allowing rounding up of the reduced data set.
  • 38. Map Reduce • User Profile { "_id" : ObjectId("505e717a6794e396ac493e37"), "UserId" : NumberLong(5209704), "Browser" : "Microsoft Internet Explorer", "Gender" : "M", "CountryCode" : "US", "State" : "FL", "City" : "Spring Hill" } • Count the users from california by Browser and Gender
  • 39. Map Reduce • Map Function – function() { var key = { Browser:this.Browser, Gender:this.Gender }; emit(key, { Count:1 }); } • Reduce Function • function(key, values) { var cnt = 0; values.forEach(function(value) { cnt += value.Count; }); return { Count:cnt }; }
  • 40. Lab#2 – Map/Reduce • CSV file– user profile information • Count the users by Browser and Gender • Download • http://www.mlnsitelabs.com/mongodb/Labs/Lab2
  • 41. Aggregation Framework • Map/Reduce is a big hammer – Sum, Average – Avoid java script overhead if you can • Aggregation Framework – Specify a pipeline – Pipeline = series of operations – Collections run through a pipeline to produce aggregated result
  • 42. Aggregation Framework • $match – Uses query predicate • $project – Uses a sample document to determine the result • $unwind – Hands out the array elements one at a time • $group – Aggregates items into group defined by a key
  • 43. Aggregation Framework • $sort – sort the result • $limit – Limit the number of documents to pass • $skip – Skip over the specified number of documents
  • 44. Lab#3 – Aggregation framework • CSV file– user profile information • { aggregate : ‘UserProfileInfo', pipeline : [ { $match : {State:'CA'}}, { $group: {_id: {Browser : '$Browser', Gender : '$Gender'}, Count:{$sum: 1 } }}, { $project : { _id :0, Browser : '$_id.Browser', Gender : '$_id.Gender', Count: 1} ]}
  • 45. Replication • Data Redundancy • Automated Failover /HA • Read Scaling • Master – Slave Replication – Master handles writes – Slave handles reads
  • 46. Replication Slave Slave Master Writes Client
  • 47. Sharding • Partitioning of data among multiple machines • Enables Horizontal Scaling – writes per second • Partition a collection, specify a shard key – ex: _id, timestamp
  • 48. Sharding Config Shard 1 Client Router Shard 2 mongos Shard 3
  • 49. GridFS • Specification for storing large files in MongoDB • BSON object in MongoDB are limited to 16MB Size • GridFS – Divide large files among multiple documents
  • 50. References • Mongo Cookbook – http://cookbook.mongodb.org/ • NoSQL Distilled: A Brief Guide to the Emerging World of Polyglot Persistence – http://www.amazon.com/NoSQL-Distilled- Emerging-Polyglot-Persistence/dp/0321826620 • Seven Databases in Seven Weeks – http://www.amazon.com/Seven-Databases- Weeks-Modern-Movement/dp/1934356921
  • 51. Contacts { name : “Sundar Nathikudi” mail: mln@mlnadvertising.com website: http://www.mlnadvertising.com }