SlideShare a Scribd company logo
1 of 25
Download to read offline
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

More Related Content

Recently uploaded

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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.pptxEarley Information Science
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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 interpreternaman860154
 
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 RobisonAnna Loughnan Colquhoun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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...apidays
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Recently uploaded (20)

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

Featured

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
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
 

Featured (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
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...
 

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