SlideShare a Scribd company logo
1 of 31
https://twitter.com/mongodb




MongoDB for Content
Management
Bryan Reinero
Consulting Engineer, 10gen
Agenda
• Sample Content Management System (CMS)
 Application
• Schema Design Considerations
• Viewing the Final Product
• Building Feeds and Querying Data
• Replication, Failover, and Scaling
• Further Resources
Sample CMS
Application
CMS Application Overview
• Business news service
• Hundreds of stories per day
• Millions of website visitors per month
• Comments
• Related stories
• Tags
Viewing Stories (Web Site)
                  Headline

   Date, Byline                   Tags




      Copy

                             Related Stories



   Comments
Viewing Categories/Tags (Web
            Site)

           Headline

          Date, Byline

           Lead Text


           Headline

          Date, Byline

           Lead Text
Sample Article
            Headline
                    Byline, Date, Comments

                        Copy



                        Image




                         Related Stories
Schema Design
Considerations
Sample Relational DB Structure
story             author           tag    comment
id                id               id     Id
headline          first_name       name   storyid
copy              last_name        …      name
authorid          title                   Email
slug              …                       comment_text
…                                         …

related_story     link_story_tag
id                Id
storyid           storyid
related_storyid   tagid
…                 …
Sample Relational DB Structure
• Number of queries per page load?
• Caching layers add complexity
• Tables may grow to millions of rows
• Joins will become slower over time as db
 increases in size
• Schema changes
• Scaling database to handle more reads
MongoDB Schema Design
• “Schemaless”, however, schema design is
 important
• JSON documents
• Design for the use case and work backwards
• Do not use a relational model in MongoDB
• No joins or transactions, most related information
 should be contained in the same document
• Atomic updates on documents, equivalent of
 transaction
Sample MongoDB Schema
{
    _id: 375,
    headline: ”Apple Reports Second Quarter Earnings",
    date: ISODate("2012-07-14T01:00:00+01:00"),
    slug: “apple-reports-second-quarter-earnings”,
    byline: {
        author: “Jason Zucchetto”,
        title: “Lead Business Editor”
    },
    copy: “Apple reported second quarter revenue today…”,
    tags: [
      ”AAPL",
      ”Earnings”
    ],
    Comments: [
      { name: “Frank”, comment: “Great story!”}
    ]
}
Adding Fields Based on
Story
{
    _id: 375,
    headline: ”Apple Reports Second Quarter Earnings",
    date: ISODate("2012-07-14T01:00:00+01:00"),
    slug: “apple-reports-second-quarter-earnings”,
    byline: {
        author: “Jason Zucchetto”,
        title: “Lead Business Editor”
    },
    copy: “Apple reported second quarter revenue today…”,
    tags: [
      ”AAPL",
      ”Earnings”
    ],
    image: “/images/aapl/tim-cook.jpg”,
    ticker: “AAPL”
}
High Comment Volume
{
    _id: 375,
    headline: ”Apple Reports Second Quarter Earnings",
    date: ISODate("2012-07-14T01:00:00+01:00"),
    slug: “apple-reports-second-quarter-earnings”,
    …
    copy: “Apple reported second quarter revenue today…”,
    tags: [
      ”AAPL",
      ”Earnings”
    ],
    Last25Comments: [
      { name: “Frank”, comment: “Great story!”},
      { name: “John”, comment: “This is interesting”}
      …
    ]
}
Managing Related Stories
{
    _id: 375,
    headline: ”Apple Reports Second Quarter Earnings",
    date: ISODate("2012-07-14T01:00:00+01:00"),
    slug: “apple-reports-second-quarter-earnings”,
    …
    RelatedStories: [
      {
        headline: “Google Reports on Revenue”,
        date: ISODate("2012-07-15T01:00:00+01:00"),
        slug: “goog-revenue-third-quarter”
      }, {
        headline: “Yahoo Reports on Revenue”,
        date: ISODate("2012-07-15T01:00:00+01:00"),
        slug: “yhoo-revenue-third-quarter”
      }
    ]
}
Full Sample Schema
{ // Story Collection (sample document)
 _id: 375,
 headline: ”Apple Reports Second Quarter Earnings",
 date: ISODate("2012-07-14T01:00:00+01:00"),
 slug: “apple-reports-second-quarter-earnings”,
 byline: {
     author: “Jason Zucchetto”,
     title: “Lead Business Editor”
 },
 copy: “Apple reported second quarter revenue today…”,
 tags: [
   ”AAPL",
   ”Earnings”
 ],
 Last25Comments: [
   { name: “Frank”, comment: “Great story!”},
   { name: “John”, comment: “This is interesting”}
 ]
Full Sample Schema (Contd.)
    image: “/images/aapl/tim-cook.jpg”,
    ticker: “AAPL”,
    RelatedStories: [
      {
        headline: “Google Reports on Revenue”,
        date: ISODate("2012-07-15T01:00:00+01:00"),
        slug: “goog-revenue-third-quarter”
      }, {
        headline: “Yahoo Reports on Revenue”,
        date: ISODate("2012-07-15T01:00:00+01:00"),
        slug: “yhoo-revenue-third-quarter”
      }
    ]
}

{ // Comment collection (sample document)
  _id: 1891, storyid: 375, name: “Frank”, comment: “Great story!”
}
Querying and Indexing
Inserting and Updating
Stories
// Inserting new stories are easy, just submit JSON document
db.cms.insert( { headline: “Apple Reports Revenue”... });

// Adding story tags

db.cms.update( { _id : 375 }, { $addToSet : { tags : "AAPL" } } )

// Adding a comment (if embedding comments in story)
db.cms.update( { _id : 375 }, { $addToSet : { comments: {
name: „Jason‟, „comment: „Great Story‟} } } )
MongoDB Indexes for CMS


// Index on story slug
db.cms.ensureIndex( { slug : 1 });



// Index on story tags
db.cms.ensureIndex( { tags: 1 });
Querying MongoDB


// All Story information
db.cms.find( { slug : “apple-reports-second-quarter-earnings” });



// All Stories for a given tag
db.cms.find( { tags: “Earnings” });
Building Custom RSS
Feeds
Query Tags and Sort by Date


// Very simple to gather specific information for a feed
db.cms.find( { tags: { $in : [“Earnings”, “AAPL”] } }).sort(
{ date : -1 });
Replication, Failover, and
Scaling
Replication
• Extremely easy to set up
• Replica node can trail primary node and
 maintain a copy of the primary database
• Useful for disaster
 recovery, failover, backups, and specific
 workloads such as analytics
• When Primary goes down, a Secondary will
 automatically become the new Primary
Replication
Reading from Secondaries (Delayed
Consistency)




Reading from Secondaries (Delayed
Consistency)
Scaling Horizontally
• Important to keep working data set in RAM
• When working data set exceeds RAM, easy to
 add additional machines and segment data
 across machines (sharding)
Sharding with MongoDB
Additional Resources
• Use Case Tutorials:
 http://docs.mongodb.org/manual/use-cases/
• What others are doing:
 http://www.10gen.com/use-case/content-
 management
• This presentation & video recording:
 https://www.10gen.com/presentations/webinar
https://twitter.com/mongodb




Thank You
Bryan Reinero
Consulting Engineer, 10gen

More Related Content

What's hot

MongoDB et Hadoop
MongoDB et HadoopMongoDB et Hadoop
MongoDB et Hadoop
MongoDB
 
Common MongoDB Use Cases
Common MongoDB Use Cases Common MongoDB Use Cases
Common MongoDB Use Cases
MongoDB
 

What's hot (20)

MongoDB and Hadoop: Driving Business Insights
MongoDB and Hadoop: Driving Business InsightsMongoDB and Hadoop: Driving Business Insights
MongoDB and Hadoop: Driving Business Insights
 
The What and Why of NoSql
The What and Why of NoSqlThe What and Why of NoSql
The What and Why of NoSql
 
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 .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 et Hadoop
MongoDB et HadoopMongoDB et Hadoop
MongoDB et Hadoop
 
Webinar: Elevate Your Enterprise Architecture with In-Memory Computing
Webinar: Elevate Your Enterprise Architecture with In-Memory ComputingWebinar: Elevate Your Enterprise Architecture with In-Memory Computing
Webinar: Elevate Your Enterprise Architecture with In-Memory Computing
 
The Fine Art of Schema Design in MongoDB: Dos and Don'ts
The Fine Art of Schema Design in MongoDB: Dos and Don'tsThe Fine Art of Schema Design in MongoDB: Dos and Don'ts
The Fine Art of Schema Design in MongoDB: Dos and Don'ts
 
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
 
Jumpstart: Introduction to MongoDB
Jumpstart: Introduction to MongoDBJumpstart: Introduction to MongoDB
Jumpstart: Introduction to MongoDB
 
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
 
Tutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB StitchTutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB Stitch
 
Common MongoDB Use Cases
Common MongoDB Use Cases Common MongoDB Use Cases
Common MongoDB Use Cases
 
Blazing Fast Analytics with MongoDB & Spark
Blazing Fast Analytics with MongoDB & SparkBlazing Fast Analytics with MongoDB & Spark
Blazing Fast Analytics with MongoDB & Spark
 
MongoDB + Spring
MongoDB + SpringMongoDB + Spring
MongoDB + Spring
 
[MongoDB.local Bengaluru 2018] Jumpstart: Introduction to Schema Design
[MongoDB.local Bengaluru 2018] Jumpstart: Introduction to Schema Design[MongoDB.local Bengaluru 2018] Jumpstart: Introduction to Schema Design
[MongoDB.local Bengaluru 2018] Jumpstart: Introduction to Schema Design
 
MongoDB on Azure
MongoDB on AzureMongoDB on Azure
MongoDB on Azure
 
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
 
Key note big data analytics ecosystem strategy
Key note   big data analytics ecosystem strategyKey note   big data analytics ecosystem strategy
Key note big data analytics ecosystem strategy
 
MongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
MongoDB Evenings DC: MongoDB - The New Default Database for Giant IdeasMongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
MongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
 
Building an unstructured data management solution with elastic search and ama...
Building an unstructured data management solution with elastic search and ama...Building an unstructured data management solution with elastic search and ama...
Building an unstructured data management solution with elastic search and ama...
 

Viewers also liked

Schema Design
Schema DesignSchema Design
Schema Design
MongoDB
 
Evgeniy Karelin. Mongo DB integration example solving performance and high lo...
Evgeniy Karelin. Mongo DB integration example solving performance and high lo...Evgeniy Karelin. Mongo DB integration example solving performance and high lo...
Evgeniy Karelin. Mongo DB integration example solving performance and high lo...
Vlad Savitsky
 
MongoDB Performance Tuning and Monitoring
MongoDB Performance Tuning and MonitoringMongoDB Performance Tuning and Monitoring
MongoDB Performance Tuning and Monitoring
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
 

Viewers also liked (20)

Content Management Systems and MongoDB
Content Management Systems and MongoDBContent Management Systems and MongoDB
Content Management Systems and MongoDB
 
MongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World Examples
 
Schema Design
Schema DesignSchema Design
Schema Design
 
Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012
 
Constructing Web APIs with Rack, Sinatra and MongoDB
Constructing Web APIs with Rack, Sinatra and MongoDBConstructing Web APIs with Rack, Sinatra and MongoDB
Constructing Web APIs with Rack, Sinatra and MongoDB
 
MongoDB Days UK: Jumpstart: Schema Design
MongoDB Days UK: Jumpstart: Schema DesignMongoDB Days UK: Jumpstart: Schema Design
MongoDB Days UK: Jumpstart: Schema Design
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 
Evgeniy Karelin. Mongo DB integration example solving performance and high lo...
Evgeniy Karelin. Mongo DB integration example solving performance and high lo...Evgeniy Karelin. Mongo DB integration example solving performance and high lo...
Evgeniy Karelin. Mongo DB integration example solving performance and high lo...
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
MongoDB Performance Tuning and Monitoring
MongoDB Performance Tuning and MonitoringMongoDB Performance Tuning and Monitoring
MongoDB Performance Tuning and Monitoring
 
Getting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.jsGetting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.js
 
MongoDB & Machine Learning
MongoDB & Machine LearningMongoDB & Machine Learning
MongoDB & Machine Learning
 
MongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDBMongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDB
 
MongoDB IoT CITY Tour EINDHOVEN: Bosch & Tech Mahindra: Industrial Internet, ...
MongoDB IoT CITY Tour EINDHOVEN: Bosch & Tech Mahindra: Industrial Internet, ...MongoDB IoT CITY Tour EINDHOVEN: Bosch & Tech Mahindra: Industrial Internet, ...
MongoDB IoT CITY Tour EINDHOVEN: Bosch & Tech Mahindra: Industrial Internet, ...
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 
MongoDB IoT City Tour LONDON: Industrial Internet, Industry 4.0, Smart Factor...
MongoDB IoT City Tour LONDON: Industrial Internet, Industry 4.0, Smart Factor...MongoDB IoT City Tour LONDON: Industrial Internet, Industry 4.0, Smart Factor...
MongoDB IoT City Tour LONDON: Industrial Internet, Industry 4.0, Smart Factor...
 
Optimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at LocalyticsOptimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at Localytics
 
MongoDB Advanced Schema Design - Inboxes
MongoDB Advanced Schema Design - InboxesMongoDB Advanced Schema Design - Inboxes
MongoDB Advanced Schema Design - Inboxes
 
Building a Social Network with MongoDB
  Building a Social Network with MongoDB  Building a Social Network with MongoDB
Building a Social Network with MongoDB
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
 

Similar to Webinar: MongoDB for Content Management

Webinar: Build an Application Series - Session 2 - Getting Started
Webinar: Build an Application Series - Session 2 - Getting StartedWebinar: Build an Application Series - Session 2 - Getting Started
Webinar: Build an Application Series - Session 2 - Getting Started
MongoDB
 
Mongo db eveningschemadesign
Mongo db eveningschemadesignMongo db eveningschemadesign
Mongo db eveningschemadesign
MongoDB APAC
 
Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
	Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...	Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
hannonhill
 
S01 e01 schema-design
S01 e01 schema-designS01 e01 schema-design
S01 e01 schema-design
MongoDB
 
MongoDB Tick Data Presentation
MongoDB Tick Data PresentationMongoDB Tick Data Presentation
MongoDB Tick Data Presentation
MongoDB
 

Similar to Webinar: MongoDB for Content Management (20)

Webinar: Build an Application Series - Session 2 - Getting Started
Webinar: Build an Application Series - Session 2 - Getting StartedWebinar: Build an Application Series - Session 2 - Getting Started
Webinar: Build an Application Series - Session 2 - Getting Started
 
Frontend APIs powering fast paced product iterations
Frontend APIs powering fast paced product iterationsFrontend APIs powering fast paced product iterations
Frontend APIs powering fast paced product iterations
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrienCustomizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRails
 
The emerging world of mongo db csp
The emerging world of mongo db   cspThe emerging world of mongo db   csp
The emerging world of mongo db csp
 
CCCDjango2010.pdf
CCCDjango2010.pdfCCCDjango2010.pdf
CCCDjango2010.pdf
 
Managing Social Content with MongoDB
Managing Social Content with MongoDBManaging Social Content with MongoDB
Managing Social Content with MongoDB
 
Building LinkedIn's Learning Platform with MongoDB
Building LinkedIn's Learning Platform with MongoDBBuilding LinkedIn's Learning Platform with MongoDB
Building LinkedIn's Learning Platform with MongoDB
 
Starting with MongoDB
Starting with MongoDBStarting with MongoDB
Starting with MongoDB
 
No SQL and MongoDB - Hyderabad Scalability Meetup
No SQL and MongoDB - Hyderabad Scalability MeetupNo SQL and MongoDB - Hyderabad Scalability Meetup
No SQL and MongoDB - Hyderabad Scalability Meetup
 
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
 
Big Data Analytics from Azure Cloud to Power BI Mobile
Big Data Analytics from Azure Cloud to Power BI MobileBig Data Analytics from Azure Cloud to Power BI Mobile
Big Data Analytics from Azure Cloud to Power BI Mobile
 
Mongo db eveningschemadesign
Mongo db eveningschemadesignMongo db eveningschemadesign
Mongo db eveningschemadesign
 
Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
	Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...	Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
 
moma-django overview --> Django + MongoDB: building a custom ORM layer
moma-django overview --> Django + MongoDB: building a custom ORM layermoma-django overview --> Django + MongoDB: building a custom ORM layer
moma-django overview --> Django + MongoDB: building a custom ORM layer
 
S01 e01 schema-design
S01 e01 schema-designS01 e01 schema-design
S01 e01 schema-design
 
SEO dataLayer 2: Entity Wars
SEO dataLayer 2: Entity WarsSEO dataLayer 2: Entity Wars
SEO dataLayer 2: Entity Wars
 
Workshop supermodel munich
Workshop supermodel munichWorkshop supermodel munich
Workshop supermodel munich
 
MongoDB Tick Data Presentation
MongoDB Tick Data PresentationMongoDB Tick Data Presentation
MongoDB Tick Data Presentation
 

More from MongoDB

More from MongoDB (20)

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 SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
 
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 SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Webinar: MongoDB for Content Management

  • 2. Agenda • Sample Content Management System (CMS) Application • Schema Design Considerations • Viewing the Final Product • Building Feeds and Querying Data • Replication, Failover, and Scaling • Further Resources
  • 4. CMS Application Overview • Business news service • Hundreds of stories per day • Millions of website visitors per month • Comments • Related stories • Tags
  • 5. Viewing Stories (Web Site) Headline Date, Byline Tags Copy Related Stories Comments
  • 6. Viewing Categories/Tags (Web Site) Headline Date, Byline Lead Text Headline Date, Byline Lead Text
  • 7. Sample Article Headline Byline, Date, Comments Copy Image Related Stories
  • 9. Sample Relational DB Structure story author tag comment id id id Id headline first_name name storyid copy last_name … name authorid title Email slug … comment_text … … related_story link_story_tag id Id storyid storyid related_storyid tagid … …
  • 10. Sample Relational DB Structure • Number of queries per page load? • Caching layers add complexity • Tables may grow to millions of rows • Joins will become slower over time as db increases in size • Schema changes • Scaling database to handle more reads
  • 11. MongoDB Schema Design • “Schemaless”, however, schema design is important • JSON documents • Design for the use case and work backwards • Do not use a relational model in MongoDB • No joins or transactions, most related information should be contained in the same document • Atomic updates on documents, equivalent of transaction
  • 12. Sample MongoDB Schema { _id: 375, headline: ”Apple Reports Second Quarter Earnings", date: ISODate("2012-07-14T01:00:00+01:00"), slug: “apple-reports-second-quarter-earnings”, byline: { author: “Jason Zucchetto”, title: “Lead Business Editor” }, copy: “Apple reported second quarter revenue today…”, tags: [ ”AAPL", ”Earnings” ], Comments: [ { name: “Frank”, comment: “Great story!”} ] }
  • 13. Adding Fields Based on Story { _id: 375, headline: ”Apple Reports Second Quarter Earnings", date: ISODate("2012-07-14T01:00:00+01:00"), slug: “apple-reports-second-quarter-earnings”, byline: { author: “Jason Zucchetto”, title: “Lead Business Editor” }, copy: “Apple reported second quarter revenue today…”, tags: [ ”AAPL", ”Earnings” ], image: “/images/aapl/tim-cook.jpg”, ticker: “AAPL” }
  • 14. High Comment Volume { _id: 375, headline: ”Apple Reports Second Quarter Earnings", date: ISODate("2012-07-14T01:00:00+01:00"), slug: “apple-reports-second-quarter-earnings”, … copy: “Apple reported second quarter revenue today…”, tags: [ ”AAPL", ”Earnings” ], Last25Comments: [ { name: “Frank”, comment: “Great story!”}, { name: “John”, comment: “This is interesting”} … ] }
  • 15. Managing Related Stories { _id: 375, headline: ”Apple Reports Second Quarter Earnings", date: ISODate("2012-07-14T01:00:00+01:00"), slug: “apple-reports-second-quarter-earnings”, … RelatedStories: [ { headline: “Google Reports on Revenue”, date: ISODate("2012-07-15T01:00:00+01:00"), slug: “goog-revenue-third-quarter” }, { headline: “Yahoo Reports on Revenue”, date: ISODate("2012-07-15T01:00:00+01:00"), slug: “yhoo-revenue-third-quarter” } ] }
  • 16. Full Sample Schema { // Story Collection (sample document) _id: 375, headline: ”Apple Reports Second Quarter Earnings", date: ISODate("2012-07-14T01:00:00+01:00"), slug: “apple-reports-second-quarter-earnings”, byline: { author: “Jason Zucchetto”, title: “Lead Business Editor” }, copy: “Apple reported second quarter revenue today…”, tags: [ ”AAPL", ”Earnings” ], Last25Comments: [ { name: “Frank”, comment: “Great story!”}, { name: “John”, comment: “This is interesting”} ]
  • 17. Full Sample Schema (Contd.) image: “/images/aapl/tim-cook.jpg”, ticker: “AAPL”, RelatedStories: [ { headline: “Google Reports on Revenue”, date: ISODate("2012-07-15T01:00:00+01:00"), slug: “goog-revenue-third-quarter” }, { headline: “Yahoo Reports on Revenue”, date: ISODate("2012-07-15T01:00:00+01:00"), slug: “yhoo-revenue-third-quarter” } ] } { // Comment collection (sample document) _id: 1891, storyid: 375, name: “Frank”, comment: “Great story!” }
  • 19. Inserting and Updating Stories // Inserting new stories are easy, just submit JSON document db.cms.insert( { headline: “Apple Reports Revenue”... }); // Adding story tags db.cms.update( { _id : 375 }, { $addToSet : { tags : "AAPL" } } ) // Adding a comment (if embedding comments in story) db.cms.update( { _id : 375 }, { $addToSet : { comments: { name: „Jason‟, „comment: „Great Story‟} } } )
  • 20. MongoDB Indexes for CMS // Index on story slug db.cms.ensureIndex( { slug : 1 }); // Index on story tags db.cms.ensureIndex( { tags: 1 });
  • 21. Querying MongoDB // All Story information db.cms.find( { slug : “apple-reports-second-quarter-earnings” }); // All Stories for a given tag db.cms.find( { tags: “Earnings” });
  • 23. Query Tags and Sort by Date // Very simple to gather specific information for a feed db.cms.find( { tags: { $in : [“Earnings”, “AAPL”] } }).sort( { date : -1 });
  • 25. Replication • Extremely easy to set up • Replica node can trail primary node and maintain a copy of the primary database • Useful for disaster recovery, failover, backups, and specific workloads such as analytics • When Primary goes down, a Secondary will automatically become the new Primary
  • 27. Reading from Secondaries (Delayed Consistency) Reading from Secondaries (Delayed Consistency)
  • 28. Scaling Horizontally • Important to keep working data set in RAM • When working data set exceeds RAM, easy to add additional machines and segment data across machines (sharding)
  • 30. Additional Resources • Use Case Tutorials: http://docs.mongodb.org/manual/use-cases/ • What others are doing: http://www.10gen.com/use-case/content- management • This presentation & video recording: https://www.10gen.com/presentations/webinar