SlideShare una empresa de Scribd logo
1 de 14
XMLデータベースについて

     2013/3/21
  株式会社ユーザベース
     川口浩司
自己紹介
• 川口 浩司(かわぐち こうじ)
• ユーザベースには2011年10月に入社
  主にSPEEDA画面の開発(Java)を担当
• 前職は独立系のSIer
  – Webやインターネット系の中規模システムや、最近では携
    帯電話のソフト開発を経験
  – 自社製品のXMLデータベースの開発を担当
  – XMLコンソーシアムにて、各社のXMLデータベース調査や、
    他ベンダーとの普及活動も行う
• Facebook http://www.facebook.com/k.kawag
  – 「今日の青山ランチ」をたまに掲載                         1
XMLとは
• Extensible Markup Language(拡張可能なマー
  ク付け言語)
• 1998年2月10日、
  World Wide Web Consortium (W3C) より、
  XML 1.0 が勧告された。
• 最新版は以下
  – XML 1.0 Fifth Edition(2008/11/26)
  – XML 1.1 Second Edition (2006/8/16)

                                         2
XMLとは
• 構造化データを記述するためのデータ形式
 –   マークアップ言語
 –   親子関係、階層構造
 –   順序、繰り返し、省略
 –   要素、属性などを自由に定義可能
• システム間のデータ交換での使用を意図
 – テキスト形式、エンコーディング宣言
• APIやライブラリなどが整備されている
 – Parser、DOM、SAX、Validation機能、Data Binding


                                              3
拡張可能とは
• 構造の拡張
 – 要素や属性の追加
• スキーマの組み合わせ
 – 複数のスキーマを組み合わせて使用可能
 – 名前空間
• 規格の拡張
 – XML Schema、XSL、XPath、SOAPなどの周辺規格
 – XHTML、RSS、XBRL、WSDL、Open XMLなどの応用

                                   4
XMLをRDBに入れる方法
①XMLを文字列のまま、カラムに格納する
      id            time                                data
           1   2013/3/21 13:10   <input>
                                  <name>鈴木</name>
                                  <lunch>
                                    <item>おにぎり</item>
                                    <item>からあげ</item>
                                  </lunch>
                                 </input>
           2   2013/3/21 13:20   <input>
                                  <name>佐藤</name>
                                  <lunch>
                                    <item>おにぎり</item>
                                    <item>おにぎり</item>
                                    <item>おにぎり</item>
                                  </lunch>
                                 </input>
           3   2013/3/21 13:30   <input>
                                  <name>田中</name>
                                  <lunch>
                                    <item>たこやき</item>
                                  </lunch>
                                 </input>



 – 部分的な取得、更新が出来ない
 – 検索時、1件ずつXMLをparse、たどる必要がある
                                                               5
XMLをRDBに入れる方法
②要素や属性をテーブルやカラムにマッピング
  id            time        name    lunch1    lunch2   lunch3
       1   2013/3/21 13:10 鈴木      おにぎり      からあげ

       2   2013/3/21 13:20 佐藤      おにぎり      おにぎり      おにぎり

       3   2013/3/21 13:30 田中      たこやき




 – データ構造が固定される
 – マッピング用のプログラムが毎回必要
 – 要素や属性の値での検索や取得は可能
                                                                6
XMLをRDBに入れる方法
③要素名や属性名、親子・兄弟関係などの情報に分
解して格納する
      id            time           element_id    element_name    text   parent_id   sibiling_id
           1   2013/3/21   13:10             1   input
           1   2013/3/21   13:10             2   name           鈴木              1
           1   2013/3/21   13:10             3   lunch                          1             2
           1   2013/3/21   13:10             4   item           おにぎり            3
           1   2013/3/21   13:10             5   item           からあげ            3             4
           2   2013/3/21   13:20             6   input
           2   2013/3/21   13:20             7   name           佐藤              6
           2   2013/3/21   13:20             8   lunch                          6             7
           2   2013/3/21   13:20             9   item           おにぎり            8
           2   2013/3/21   13:20           10    item           おにぎり            8            9
           2   2013/3/21   13:20           11    item           おにぎり            8           10
           3   2013/3/21   13:30           12    input
           3   2013/3/21   13:30           13    name           田中             12
           3   2013/3/21   13:30           14    lunch                         12           13
           3   2013/3/21   13:30           15    item           たこやき           14


 –   特定の要素や属性を取得するために、要素ごとにレコー
     ドをたどっていく必要がある
                                                                                                  7
XMLデータベース
• XMLデータを直接扱う機能を持つデータベース
• ハイブリッドXMLデータベース
 – RDBにXMLデータ対応機能を付加
 – リレーショナルデータとXMLを同時に扱うことが可能
 – DBの構成や操作(API)などはRDBの拡張
• ネイティブXMLデータベース
 – XMLデータ専用
 – DBの構成や操作(API)などもXMLに特化



                               8
ハイブリッドXMLデータベース
• カラムのデータ型にXML型を追加
• SQLの中でXPathやXQueryを使用して、XMLの特定
  の要素等を指定した取得、検索、更新などが可能
• XMLの特定の要素にインデックスを指定
• DBMSの機能は基本的にそのまま使用可能
• 製品例
 –   Oracle「Oracle 9i R2」
 –   Microsoft「SQL Server」
 –   IBM「DB2 9」pureXML
 –   日立「HiRDB V8」XML Extension
                                   9
ネイティブXMLデータベース
• RDBのようなテーブルではなく、ファイルシステムに
  XMLファイルを格納していくイメージ
• XPathやXQueryを使用して、XMLの要素等を指定し
  た取得や更新を行ったり、検索を行う
• JDBCのような標準APIはなく、各製品が独自のAPIを
  提供
• 任意のXMLを格納可能で、インデックスを定義しなく
  ても、任意の条件で高速に検索
• データの格納形式や検索方法など、各製品ごとに
  工夫して差別している
                              10
ネイティブXMLデータベース
• 製品例
 – サイバーテック「Cyber Luxeon」(eXcelon)
 – Software AG「Tamino XML Server」
 – メディアフュージョン「EsTerra」(Ygdrasill)
 – セック「Karearea」
 – サイバーテック「NeoCoreXMS」
 – 富士通「Interstage Shunsaku Data Manager」
 – 東芝ソリューション「TX1」

                                           11
XMLデータベースの課題
• 遅い、難しい、大量データが扱えない(第一世代)
  ⇒速い、簡単、テラバイト級(第二世代)
• XML自体が難しい上に、XMLデータベースも独自仕様であり、
  敷居が高い
• 情報が十分公開されていない
• プログラミングやチューニングなどでノウハウが必要
• DBMSとしての保守機能や安定性、拡張性、実績不足
• RDBとネイティブXMLを両方導入するメリットが少ない
• XMLデータを扱う場合でも、RDBで事足りることがほとんど
• MySQLやPostgreSQLのような、フリーで高機能、実績もある
  XMLデータベースが存在しない
                                   12
XMLデータベースの今後
• XMLは完全に普及してはいるが、コンテンツやデータ交換用
  のフォーマットとしての利用がほとんどであり、大量の蓄積
  データを柔軟に検索する用途は多くない
• データベースとしては依然としてRDBが主流であり、XMLを扱
  うしてもRDBで事足りることがほとんど
• XMLデータベースが大量データに対応していると言っても、
  実際に何千万件、何億件というデータを入れようとすると、並
  列環境などの複雑な構成になり、価格が跳ね上がったりする
• 一見簡単なようだが、機能が不足していて、自分で作り込ん
  で実現する必要があったり、内部まで熟知していないと十分
  チューニングが出来なかったりする
• クラウド、NoSQLなどが台頭している中、棲み分けに期待
                               13

Más contenido relacionado

Último

LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルCRI Japan, Inc.
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video UnderstandingToru Tamaki
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptxsn679259
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...Toru Tamaki
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsWSO2
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイスCRI Japan, Inc.
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Gamesatsushi061452
 

Último (10)

LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 

Destacado

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
 
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
 

Destacado (20)

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...
 
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
 

XMLデータベースについて

  • 1. XMLデータベースについて 2013/3/21 株式会社ユーザベース 川口浩司
  • 2. 自己紹介 • 川口 浩司(かわぐち こうじ) • ユーザベースには2011年10月に入社 主にSPEEDA画面の開発(Java)を担当 • 前職は独立系のSIer – Webやインターネット系の中規模システムや、最近では携 帯電話のソフト開発を経験 – 自社製品のXMLデータベースの開発を担当 – XMLコンソーシアムにて、各社のXMLデータベース調査や、 他ベンダーとの普及活動も行う • Facebook http://www.facebook.com/k.kawag – 「今日の青山ランチ」をたまに掲載 1
  • 3. XMLとは • Extensible Markup Language(拡張可能なマー ク付け言語) • 1998年2月10日、 World Wide Web Consortium (W3C) より、 XML 1.0 が勧告された。 • 最新版は以下 – XML 1.0 Fifth Edition(2008/11/26) – XML 1.1 Second Edition (2006/8/16) 2
  • 4. XMLとは • 構造化データを記述するためのデータ形式 – マークアップ言語 – 親子関係、階層構造 – 順序、繰り返し、省略 – 要素、属性などを自由に定義可能 • システム間のデータ交換での使用を意図 – テキスト形式、エンコーディング宣言 • APIやライブラリなどが整備されている – Parser、DOM、SAX、Validation機能、Data Binding 3
  • 5. 拡張可能とは • 構造の拡張 – 要素や属性の追加 • スキーマの組み合わせ – 複数のスキーマを組み合わせて使用可能 – 名前空間 • 規格の拡張 – XML Schema、XSL、XPath、SOAPなどの周辺規格 – XHTML、RSS、XBRL、WSDL、Open XMLなどの応用 4
  • 6. XMLをRDBに入れる方法 ①XMLを文字列のまま、カラムに格納する id time data 1 2013/3/21 13:10 <input> <name>鈴木</name> <lunch> <item>おにぎり</item> <item>からあげ</item> </lunch> </input> 2 2013/3/21 13:20 <input> <name>佐藤</name> <lunch> <item>おにぎり</item> <item>おにぎり</item> <item>おにぎり</item> </lunch> </input> 3 2013/3/21 13:30 <input> <name>田中</name> <lunch> <item>たこやき</item> </lunch> </input> – 部分的な取得、更新が出来ない – 検索時、1件ずつXMLをparse、たどる必要がある 5
  • 7. XMLをRDBに入れる方法 ②要素や属性をテーブルやカラムにマッピング id time name lunch1 lunch2 lunch3 1 2013/3/21 13:10 鈴木 おにぎり からあげ 2 2013/3/21 13:20 佐藤 おにぎり おにぎり おにぎり 3 2013/3/21 13:30 田中 たこやき – データ構造が固定される – マッピング用のプログラムが毎回必要 – 要素や属性の値での検索や取得は可能 6
  • 8. XMLをRDBに入れる方法 ③要素名や属性名、親子・兄弟関係などの情報に分 解して格納する id time element_id element_name text parent_id sibiling_id 1 2013/3/21 13:10 1 input 1 2013/3/21 13:10 2 name 鈴木 1 1 2013/3/21 13:10 3 lunch 1 2 1 2013/3/21 13:10 4 item おにぎり 3 1 2013/3/21 13:10 5 item からあげ 3 4 2 2013/3/21 13:20 6 input 2 2013/3/21 13:20 7 name 佐藤 6 2 2013/3/21 13:20 8 lunch 6 7 2 2013/3/21 13:20 9 item おにぎり 8 2 2013/3/21 13:20 10 item おにぎり 8 9 2 2013/3/21 13:20 11 item おにぎり 8 10 3 2013/3/21 13:30 12 input 3 2013/3/21 13:30 13 name 田中 12 3 2013/3/21 13:30 14 lunch 12 13 3 2013/3/21 13:30 15 item たこやき 14 – 特定の要素や属性を取得するために、要素ごとにレコー ドをたどっていく必要がある 7
  • 9. XMLデータベース • XMLデータを直接扱う機能を持つデータベース • ハイブリッドXMLデータベース – RDBにXMLデータ対応機能を付加 – リレーショナルデータとXMLを同時に扱うことが可能 – DBの構成や操作(API)などはRDBの拡張 • ネイティブXMLデータベース – XMLデータ専用 – DBの構成や操作(API)などもXMLに特化 8
  • 10. ハイブリッドXMLデータベース • カラムのデータ型にXML型を追加 • SQLの中でXPathやXQueryを使用して、XMLの特定 の要素等を指定した取得、検索、更新などが可能 • XMLの特定の要素にインデックスを指定 • DBMSの機能は基本的にそのまま使用可能 • 製品例 – Oracle「Oracle 9i R2」 – Microsoft「SQL Server」 – IBM「DB2 9」pureXML – 日立「HiRDB V8」XML Extension 9
  • 11. ネイティブXMLデータベース • RDBのようなテーブルではなく、ファイルシステムに XMLファイルを格納していくイメージ • XPathやXQueryを使用して、XMLの要素等を指定し た取得や更新を行ったり、検索を行う • JDBCのような標準APIはなく、各製品が独自のAPIを 提供 • 任意のXMLを格納可能で、インデックスを定義しなく ても、任意の条件で高速に検索 • データの格納形式や検索方法など、各製品ごとに 工夫して差別している 10
  • 12. ネイティブXMLデータベース • 製品例 – サイバーテック「Cyber Luxeon」(eXcelon) – Software AG「Tamino XML Server」 – メディアフュージョン「EsTerra」(Ygdrasill) – セック「Karearea」 – サイバーテック「NeoCoreXMS」 – 富士通「Interstage Shunsaku Data Manager」 – 東芝ソリューション「TX1」 11
  • 13. XMLデータベースの課題 • 遅い、難しい、大量データが扱えない(第一世代) ⇒速い、簡単、テラバイト級(第二世代) • XML自体が難しい上に、XMLデータベースも独自仕様であり、 敷居が高い • 情報が十分公開されていない • プログラミングやチューニングなどでノウハウが必要 • DBMSとしての保守機能や安定性、拡張性、実績不足 • RDBとネイティブXMLを両方導入するメリットが少ない • XMLデータを扱う場合でも、RDBで事足りることがほとんど • MySQLやPostgreSQLのような、フリーで高機能、実績もある XMLデータベースが存在しない 12
  • 14. XMLデータベースの今後 • XMLは完全に普及してはいるが、コンテンツやデータ交換用 のフォーマットとしての利用がほとんどであり、大量の蓄積 データを柔軟に検索する用途は多くない • データベースとしては依然としてRDBが主流であり、XMLを扱 うしてもRDBで事足りることがほとんど • XMLデータベースが大量データに対応していると言っても、 実際に何千万件、何億件というデータを入れようとすると、並 列環境などの複雑な構成になり、価格が跳ね上がったりする • 一見簡単なようだが、機能が不足していて、自分で作り込ん で実現する必要があったり、内部まで熟知していないと十分 チューニングが出来なかったりする • クラウド、NoSQLなどが台頭している中、棲み分けに期待 13