SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
MongoDB Tokyo 2012

             Nomura Research Institute
                         OpenStandia
                       Shoken Fujisaki
                        Dec. 12, 2012


1
About me
• Shoken Fujisaki (@syokenz)
• syokenz@gmail.com
• Technical Engineer
• Leader of Marunouchi MongoDB
    http://syokenz.github.com/marunouchi-mongodb

• Write a series of MongoDB articles in gihyo.jp
    http://gihyo.jp/dev/serial/01/mongodb




2
About company
• Nomura Research Institute ( NRI )
     • 野村総合研究所
• System Integrator
• Department : Open Source Solution Department
• Team: OpenStandia http://openstandia.jp
• Mission:
     • System development using OSS
     • Support for OSS
        • MongoDB (In preparation. contact : ossc@nri.co.jp)
• Assigned: Research and Development for OSS
3
Agenda

    1.Meetup MongoDB in Marunouchi Tokyo

    2.XML Search App on MongoDB

    3.Hybrid MySQL and MongoDB

    4.Summary




4
Agenda

    1.Meetup MongoDB in Marunouchi Tokyo

    2.XML Search App on MongoDB

    3.Hybrid MySQL and MongoDB

    4.Summary




5
Meetup MongoDB in Marunouchi Tokyo
• Site : http://syokenz.github.com/marunouchi-mongodb
• “Marunouchi” is near Tokyo Station.      marunouchi mongodb

• Held once a month.
• Done four times, next fifth on Dec 18.
• Features of this meetup
     • Free
     • Hands-On
     • Open old documents and source code in Github.
       http://github.com/syokenz/marunouchi-mongodb



6
Meetup MongoDB in Marunouchi Tokyo
• Theme #1 - #5
     •   #1. Learn a query on MongoDB compared to SQL
     •   #2. Sharding on each participant’s PC.
     •   #3. “v2.2 new futures” and “Replica Sets hands-on”
     •   #4. “Make sample app using REST I/F” and “Configuration File Options”
     •   #5. “Source code reading”, “Custom building” and “Operation Tips”
                                                                                 Next
• Future                                                                         Dec 18
     •   GridFS, Geo-indexing, Performance tuning, etc…




7
Articles in Web
• Writie a series of MongoDB in gihyo.jp.
     • gihyo.jp is website of 技術評論社.
     • http://gihyo.jp/dev/serial/01/mongodb
• This article is output of Meetup Marunouchi MongoDB.




8
Agenda

    1.Meetup MongoDB in Marunouchi Tokyo

    2.XML Search App on MongoDB

    3.Hybrid MySQL and MongoDB

    4.Summary




9
XML Search App on MongoDB
• Purpose
     • Learning “When should we consider using MongoDB?”


• Existing Problem
     • How do we store XML to DB?


• Solution
     • Schema-less




10
XML Sample Data
                 CD                                      BOOK                                         PC
 <?xml version="1.0" encoding=“UTF-8" ?>   <?xml version="1.0" encoding=“UTF-8" ?>   <?xml version="1.0" encoding=“UTF-8" ?>
 <items>                                   <items>                                   <items>
    <category>music cd</category>             <category>book</category>                 <category>pc</category>
    <title>jazz collection</ title >          <title>guide of mongodb</ title >         <name>let’s book air</ name>
    <stock>10</stock>                         <stock>10</stock>                         <stock>10</stock>
    <price>1000</price>                       <price>1200</price>                       <price>120000</price>
    <artist>nomura band</artist>              <ISBN>4797327421</ISBN>                   <software>
 </items>                                     <publish>                                   <os>windows 7 pro</os>
                                                <company>nomura pub</company>             <option>Office 2010</option>
           search conditions                    <url>http://nomura.pub</url>            </software>
           ex.                                  <address>….</address>                   <hardware>
           select count(*) from items         </publish>                                  <cpu>Intell core i 7</cpu>
           where stock > 10                </items>                                       ….
                                                                                     </items>


 • Each XML schema is different.
 • If add “FOOD category”                      CD         BOOK            PC         FOOD


 • In RDB, Create FOOD table?
           • => It takes a lot of cost and not scale out.
           • RDB is not good extending the Schema.
11
XML Sample Data
                 CD                                      BOOK                                         PC
 <?xml version="1.0" encoding=“UTF-8" ?>   <?xml version="1.0" encoding=“UTF-8" ?>   <?xml version="1.0" encoding=“UTF-8" ?>
 <items>                                   <items>                                   <items>
    <category>music cd</category>             <category>book</category>                 <category>pc</category>
    <title>jazz collection</ title >          <title>guide of mongodb</ title >         <name>let’s book air</ name>
    <stock>10</stock>                         <stock>10</stock>                         <stock>10</stock>
    <price>1000</price>                       <price>1200</price>                       <price>120000</price>
    <artist>nomura band</artist>              <ISBN>4797327421</ISBN>                   <software>
 </items>                                     <publish>                                   <os>windows 7 pro</os>
                                                <company>nomura pub</company>             <option>Office 2010</option>
           search conditions                    <url>http://nomura.pub</url>            </software>
           ex.                                  <address>….</address>                   <hardware>
           select count(*) from items         </publish>                                  <cpu>Intell core i 7</cpu>
           where stock > 10                </items>                                       ….
                                                                                     </items>


 • MongoDB is Schema-less.
           • MongoDB can save any XML Data in one collection.
           • Search on any element.
             ex. db.items.find( {‚stock‛:        {$gt: 10} } ); // where stock > 10
                        db.items.find( {‚title‛: /^jazz/ } ); // where title like ‘jazz%’

           • Scalable
12
Architecture

                      Search by Web browser.         WebUI
                                                    (Node.js)



                       Insert multi type XML data
                       into MongoDB by batch.
     XML type1

       XML type2

          XML type3

                                                    MongoDB




13
Demo




     Search xml “IR” data




14
Insert multi type XML




                  The code to insert the multi
                  type XML data to MongoDB
                  is 10 lines !




15
Agenda

     1.Meetup MongoDB in Marunouchi Tokyo

     2.XML Search App on MongoDB

     3.Hybrid MySQL and MongoDB

     4.Summary




16
Hybrid MySQL and MongoDB

     • Use case in NRI
       • Working SNS Service for financial business since
         Apr.2012
       • MySQL (and Java)


          SNS Service




         MySQL

17
Hybrid MySQL and MongoDB

     • Use case in NRI
       • Working SNS Service for financial business since
         Apr.2012
       • MySQL (and Java)
       • Add CRM system with MongoDB

          SNS Service


                 CRM



         MySQL    MongoDB

18
Extended fields for each user on MongoDB

     • Requirements
       • Defines extended fields BY user.
       • Extended fields type is text, list or check box.
       • Search with extended fields.                                          Customers



           SNS Service                       Search
                                             salses_level = 3
                                                                               Customer Fields
                                                                               -name
                  CRM                                                          -email
                                       Customer Fields
                                                                   User A      -address
                                       -name                                   -sales_level
                                       -email                                  -industry
                                       -address                                -…

          MySQL   MongoDB
                              User B   -interests
                                       -assets                  Extended fields
                                       -…                       depents on the user
19
Schema Design


                   MongoDB

                      CRM
     extended_definition     extended_values
          collection             collection

                    user
                       user
                  collection
                        user
                   collection
                     collection




20
Schema Design


                   MongoDB

                      CRM
     extended_definition     extended_values
          collection             collection

                    user
                       user
                  collection
                        user
                   collection
                     collection




21
Schema Design
                                            Defined for each user
 extended_definition collection
 {
 ‚_id‛:ObjectID(‚50ad9b3976c25eb2096dd1da‛),
 ‚userId‛: 12233,
 ‚extendedItems‛:[
                   {‚name‛ : ‚sales_level‛, ‚type‛: 1,‚selectValues‛ : [1,2,3,4,5]},
                   {‚name‛ : ‚industry‛,     ‚type‛: 2,‚selectValues‛ : [‚food‛,‚IT‛,‚vendor‛,‚retail‛]}
                 ]
 }                                                           type
 …                                                           =0 : text
 extended_values collection                                  =1 : list
 {                                                           =2 : check box
   ‚_id‛:ObjectID(‚50ad9b3976c27eb2096dd100‛),
   ‚userId‛: 12233,
   ‚name‛:‛Atsushi Sato‛,
   ‚email‛:‛a@a-example.com‛,
   ‚extendedValues‛:[
                      {‚name‛ : ‚sales_level‛,   ‚value‛: [ 3 ]},
                      {‚name‛ : ‚industry‛,      ‚value‛: [‚1‛,‛3‛,‚5‛]}
                    ]
   }
   {
   ‚_id‛:ObjectID(‚50ad9b3976c26eb2096dd101‛),
   ‚userId‛: 12233,
   ‚name‛:‛Bunta Suzuki‛,
   ‚email‛:‛b@b-example.com‛,
   ‚extendedValues‛:[
                      {‚name‛ : ‚sales_level‛,   ‚value‛: [ 2 ]},
                      {‚name‛ : ‚industry‛,      ‚value‛: [‚1‛]}
                    ]
22 }
   …
Agenda

     1.Meetup MongoDB in Marunouchi Tokyo

     2.XML Search App on MongoDB

     3.Hybrid MySQL and MongoDB

     4.Summary




23
Summary

     • MongoDB can meet various kinds of customer
       requirements, especially for large system.
       • Schema-less
       • Search like SQL
       • Scalable
     • We can add MongoDB to the system using
       MySQL.
       • Hybrid MySQL and MongoDB
       • Select database depending on the data
         characteristic
24
All product names mentioned are trademarks or
            registered trademarks of the respective companies.




            Thank You



     ossc@nri.co.jp               http://openstandia.jp/




25

Weitere ähnliche Inhalte

Kürzlich hochgeladen

COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"DianaGray10
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...Daniel Zivkovic
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
The Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementThe Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementNuwan Dias
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdfPaige Cruz
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 

Kürzlich hochgeladen (20)

COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
The Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementThe Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API Management
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 

Empfohlen

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Empfohlen (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

MongoDB_Tokyo_2012-NRI_OpenStandia

  • 1. MongoDB Tokyo 2012 Nomura Research Institute OpenStandia Shoken Fujisaki Dec. 12, 2012 1
  • 2. About me • Shoken Fujisaki (@syokenz) • syokenz@gmail.com • Technical Engineer • Leader of Marunouchi MongoDB http://syokenz.github.com/marunouchi-mongodb • Write a series of MongoDB articles in gihyo.jp http://gihyo.jp/dev/serial/01/mongodb 2
  • 3. About company • Nomura Research Institute ( NRI ) • 野村総合研究所 • System Integrator • Department : Open Source Solution Department • Team: OpenStandia http://openstandia.jp • Mission: • System development using OSS • Support for OSS • MongoDB (In preparation. contact : ossc@nri.co.jp) • Assigned: Research and Development for OSS 3
  • 4. Agenda 1.Meetup MongoDB in Marunouchi Tokyo 2.XML Search App on MongoDB 3.Hybrid MySQL and MongoDB 4.Summary 4
  • 5. Agenda 1.Meetup MongoDB in Marunouchi Tokyo 2.XML Search App on MongoDB 3.Hybrid MySQL and MongoDB 4.Summary 5
  • 6. Meetup MongoDB in Marunouchi Tokyo • Site : http://syokenz.github.com/marunouchi-mongodb • “Marunouchi” is near Tokyo Station. marunouchi mongodb • Held once a month. • Done four times, next fifth on Dec 18. • Features of this meetup • Free • Hands-On • Open old documents and source code in Github. http://github.com/syokenz/marunouchi-mongodb 6
  • 7. Meetup MongoDB in Marunouchi Tokyo • Theme #1 - #5 • #1. Learn a query on MongoDB compared to SQL • #2. Sharding on each participant’s PC. • #3. “v2.2 new futures” and “Replica Sets hands-on” • #4. “Make sample app using REST I/F” and “Configuration File Options” • #5. “Source code reading”, “Custom building” and “Operation Tips” Next • Future Dec 18 • GridFS, Geo-indexing, Performance tuning, etc… 7
  • 8. Articles in Web • Writie a series of MongoDB in gihyo.jp. • gihyo.jp is website of 技術評論社. • http://gihyo.jp/dev/serial/01/mongodb • This article is output of Meetup Marunouchi MongoDB. 8
  • 9. Agenda 1.Meetup MongoDB in Marunouchi Tokyo 2.XML Search App on MongoDB 3.Hybrid MySQL and MongoDB 4.Summary 9
  • 10. XML Search App on MongoDB • Purpose • Learning “When should we consider using MongoDB?” • Existing Problem • How do we store XML to DB? • Solution • Schema-less 10
  • 11. XML Sample Data CD BOOK PC <?xml version="1.0" encoding=“UTF-8" ?> <?xml version="1.0" encoding=“UTF-8" ?> <?xml version="1.0" encoding=“UTF-8" ?> <items> <items> <items> <category>music cd</category> <category>book</category> <category>pc</category> <title>jazz collection</ title > <title>guide of mongodb</ title > <name>let’s book air</ name> <stock>10</stock> <stock>10</stock> <stock>10</stock> <price>1000</price> <price>1200</price> <price>120000</price> <artist>nomura band</artist> <ISBN>4797327421</ISBN> <software> </items> <publish> <os>windows 7 pro</os> <company>nomura pub</company> <option>Office 2010</option> search conditions <url>http://nomura.pub</url> </software> ex. <address>….</address> <hardware> select count(*) from items </publish> <cpu>Intell core i 7</cpu> where stock > 10 </items> …. </items> • Each XML schema is different. • If add “FOOD category” CD BOOK PC FOOD • In RDB, Create FOOD table? • => It takes a lot of cost and not scale out. • RDB is not good extending the Schema. 11
  • 12. XML Sample Data CD BOOK PC <?xml version="1.0" encoding=“UTF-8" ?> <?xml version="1.0" encoding=“UTF-8" ?> <?xml version="1.0" encoding=“UTF-8" ?> <items> <items> <items> <category>music cd</category> <category>book</category> <category>pc</category> <title>jazz collection</ title > <title>guide of mongodb</ title > <name>let’s book air</ name> <stock>10</stock> <stock>10</stock> <stock>10</stock> <price>1000</price> <price>1200</price> <price>120000</price> <artist>nomura band</artist> <ISBN>4797327421</ISBN> <software> </items> <publish> <os>windows 7 pro</os> <company>nomura pub</company> <option>Office 2010</option> search conditions <url>http://nomura.pub</url> </software> ex. <address>….</address> <hardware> select count(*) from items </publish> <cpu>Intell core i 7</cpu> where stock > 10 </items> …. </items> • MongoDB is Schema-less. • MongoDB can save any XML Data in one collection. • Search on any element. ex. db.items.find( {‚stock‛: {$gt: 10} } ); // where stock > 10 db.items.find( {‚title‛: /^jazz/ } ); // where title like ‘jazz%’ • Scalable 12
  • 13. Architecture Search by Web browser. WebUI (Node.js) Insert multi type XML data into MongoDB by batch. XML type1 XML type2 XML type3 MongoDB 13
  • 14. Demo Search xml “IR” data 14
  • 15. Insert multi type XML The code to insert the multi type XML data to MongoDB is 10 lines ! 15
  • 16. Agenda 1.Meetup MongoDB in Marunouchi Tokyo 2.XML Search App on MongoDB 3.Hybrid MySQL and MongoDB 4.Summary 16
  • 17. Hybrid MySQL and MongoDB • Use case in NRI • Working SNS Service for financial business since Apr.2012 • MySQL (and Java) SNS Service MySQL 17
  • 18. Hybrid MySQL and MongoDB • Use case in NRI • Working SNS Service for financial business since Apr.2012 • MySQL (and Java) • Add CRM system with MongoDB SNS Service CRM MySQL MongoDB 18
  • 19. Extended fields for each user on MongoDB • Requirements • Defines extended fields BY user. • Extended fields type is text, list or check box. • Search with extended fields. Customers SNS Service Search salses_level = 3 Customer Fields -name CRM -email Customer Fields User A -address -name -sales_level -email -industry -address -… MySQL MongoDB User B -interests -assets Extended fields -… depents on the user 19
  • 20. Schema Design MongoDB CRM extended_definition extended_values collection collection user user collection user collection collection 20
  • 21. Schema Design MongoDB CRM extended_definition extended_values collection collection user user collection user collection collection 21
  • 22. Schema Design Defined for each user extended_definition collection { ‚_id‛:ObjectID(‚50ad9b3976c25eb2096dd1da‛), ‚userId‛: 12233, ‚extendedItems‛:[ {‚name‛ : ‚sales_level‛, ‚type‛: 1,‚selectValues‛ : [1,2,3,4,5]}, {‚name‛ : ‚industry‛, ‚type‛: 2,‚selectValues‛ : [‚food‛,‚IT‛,‚vendor‛,‚retail‛]} ] } type … =0 : text extended_values collection =1 : list { =2 : check box ‚_id‛:ObjectID(‚50ad9b3976c27eb2096dd100‛), ‚userId‛: 12233, ‚name‛:‛Atsushi Sato‛, ‚email‛:‛a@a-example.com‛, ‚extendedValues‛:[ {‚name‛ : ‚sales_level‛, ‚value‛: [ 3 ]}, {‚name‛ : ‚industry‛, ‚value‛: [‚1‛,‛3‛,‚5‛]} ] } { ‚_id‛:ObjectID(‚50ad9b3976c26eb2096dd101‛), ‚userId‛: 12233, ‚name‛:‛Bunta Suzuki‛, ‚email‛:‛b@b-example.com‛, ‚extendedValues‛:[ {‚name‛ : ‚sales_level‛, ‚value‛: [ 2 ]}, {‚name‛ : ‚industry‛, ‚value‛: [‚1‛]} ] 22 } …
  • 23. Agenda 1.Meetup MongoDB in Marunouchi Tokyo 2.XML Search App on MongoDB 3.Hybrid MySQL and MongoDB 4.Summary 23
  • 24. Summary • MongoDB can meet various kinds of customer requirements, especially for large system. • Schema-less • Search like SQL • Scalable • We can add MongoDB to the system using MySQL. • Hybrid MySQL and MongoDB • Select database depending on the data characteristic 24
  • 25. All product names mentioned are trademarks or registered trademarks of the respective companies. Thank You ossc@nri.co.jp http://openstandia.jp/ 25