ibm software group © 2007 ibm corporation confidentiality/date line: 13pt arial regular, white...
TRANSCRIPT
IBM Software Group
© 2007 IBM Corporation
面向 SOA 的 IBM 信息管理策略
刘晶炜 IBM 软件部中国区信息管理技术经理
IBM Software Group | Information Management
IBM Information Management | 2006 © 2007 IBM Corporation2
XML – SOA 中最基本的信息组织方式
IBM Software Group | Information Management
IBM Information Management | 2006 © 2007 IBM Corporation3
如何能够提供如何能够提供面向业务面向业务
的灵活性 的灵活性 ??
信息能够成为一种服务吗 ?
面对业务演变的困惑
IBM Software Group | DB2 Information Management Software
4
数据模型 XML 和 关系模型 :
Over $20B Annual Customer Technology Investment in RDB Alone…
关系模型 严格的数据及关系定义 高性能的索引机制 缺乏数据模型上的灵活性 适合固定的结构化数据
XML 层次型的结构 具备自描述能力,易于理解 数据模式的灵活性 适合结构化、半结构化和非结构化数据
XML database investments growing twice as fast as total database
investment…
面对信息复杂性、灵活性的挑战
IBM Software Group | DB2 Information Management Software
5 Matthias Nicola, IBM SVL
XML 层次模型与关系模型<DEPARTMENT deptid="15" deptname="Sales"> <EMPLOYEE> <EMPNO>10</EMPNO> <FIRSTNAME>CHRISTINE</FIRSTNAME> <LASTNAME>SMITH</LASTNAME> <PHONE>408-463-4963</PHONE> <SALARY>52750.00</SALARY> </EMPLOYEE> <EMPLOYEE> <EMPNO>27</EMPNO> <FIRSTNAME>MICHAEL</FIRSTNAME> <LASTNAME>THOMPSON</LASTNAME> <PHONE>406-463-1234</PHONE> <SALARY>41250.00</SALARY> </EMPLOYEE></DEPARTMENT> Department
DEPTID DEPTNAME15 Sales
EmployeeDEPTID EMPNO FIRSTNAME LASTNAME PHONE SALARY
15 27 MICHAEL THOMPSON 406-463-1234 4125015 10 CHRISTINE SMITH 408-463-4963 52750
IBM Software Group | DB2 Information Management Software
6 Matthias Nicola, IBM SVL
如果数据模式 (schema) 改变…“ 员工允许有多个电话号码…”
<DEPARTMENT deptid="15" deptname="Sales"> <EMPLOYEE> <EMPNO>10</EMPNO> <FIRSTNAME>CHRISTINE</FIRSTNAME> <LASTNAME>SMITH</LASTNAME> <PHONE>408-463-4963</PHONE> <PHONE>415-010-1234</PHONE> <SALARY>52750.00</SALARY> </EMPLOYEE> <EMPLOYEE> <EMPNO>27</EMPNO> <FIRSTNAME>MICHAEL</FIRSTNAME> <LASTNAME>THOMPSON</LASTNAME> <PHONE>406-463-1234</PHONE> <SALARY>41250.00</SALARY> </EMPLOYEE></DEPARTMENT>
PhoneEMPNO PHONE
27 406-463-123410 415-010-1234
10 408-463-4963
Requires:• 重新范式化数据模型 !• 修改 XML 到表的对应关系• 修改应用
Costly!
DepartmentDEPTID DEPTNAME
15 Sales
EmployeeDEPTID EMPNO FIRSTNAME LASTNAME PHONE SALARY
15 27 MICHAEL THOMPSON 406-463-1234 4125015 10 CHRISTINE SMITH 408-463-4963 52750
IBM Software Group
7
XML 开发者 “我看到功能强大的 XML
数据库,但同时支持SQL."
SQL 开发者“我看到功能强大的 XML
数据库,但同时支持XML."
熟悉的编程模式
优化的存储模型
成熟的服务
熟悉的工具
优化的性能和扩展性
DB2 9 第一次把关系模型和 XML 层次模型紧密地融合
IBM Software Group
8
XMLDOC
Extract selected
elements/attr.
Indexes
XML DOC
XML DOC
XML DOC
CLOB ColumnIndexes for non-repeatingelements only
XMLDOC
Extract selected
elements/attr.
Indexes
XML DOC
XML DOC
XML DOC
CLOB ColumnIndexes for non-repeatingelements only
非结构化 XML 存储 :XML type as CLOB
XMLDOC
XML Column
XMLIndex
DB2 层次型存储 :XML type as XML
XMLDOC
Fixed Mapping
Shredder
(object-relational tables)
XMLDOC
Fixed Mapping
Shredder
(object-relational tables)
结构化 XML storage:XML type as object-relat.
can be mixed with LOB storage
i.e. XML as text
XML 存储模式比较
Any sub-document level accessrequires XML parsing. Mapping prevents XML schema changes.
XML shredding and reconstruction incurs overhead.
High flexibility and high performance.
IBM Software Group | DB2 Information Management Software
9
XML 的存储方式
ID … DEPTDOC
PR27 …
PR28 …
ACC …
Region Path
/dept/dept/employee/dept/employee/@id…
INX Object
DAT Object
XDA Object
IBM Software Group | DB2 Information Management Software
10
专用于 XML 列的存储和索引机制
/Person/Age 17/Person/Age 6322
AgeIndexIndex on an XML Column
<?xml version="1.0"?><Person gender="Male"> <Name> <Last>Cool</Last> <First>Joe</First> </Name> <Age unit="years">17</Age> <Age unit="days">6322</Age></Person>
XML Document
Relational Table T1DocID XMLDoc
1XML Document Tree
create table t1 (docID int, XMLDoc xml);create index AgeIndex on t1(XMLDoc) generate key using xmlpattern '/Person/Age' as sql varchar(10);create index AgeUnitIndex on t1(XMLDoc) generate key using xmlpattern '/Person/Age/@unit' as sql varchar(16);
XQUERY for $i in db2-fn:xmlcolumn('T1.XMLDOC')/Person[Age='17'] return $i/Name
Person
@gender
"Male"Name
Last
text()
"Cool"
First
text()
"Joe"
Age
@unit
"years"
text()
"17"
Age
@unit
"days"
text()
"6322"
/Person/Age/@unit "days"/Person/Age/@unit "years"
AgeUnitIndexIndex on an XML Column
由用户创建以提升查询效率 同时支持对 XML 的全文索引
IBM Software Group
11
传统关系型数据库处理复杂数据结构的挑战Shredding… Mapping is Complex
Patientid 胸部
A6789 …
…. …
Custid CBCC20 CBCC21 CBCC22 CBCC23 CBCC24
A6789 无 博动正常 正常 阴性 正中
… … … … … …
Patientid 腹部
A6789 A54 12
987564331 985 1
…. …. ….
IBM Software Group
12
电子病历复杂数据 -- pureXML 存储
IBM Software Group | Information Management
IBM Information Management | 2006 © 2006 IBM Corporation13
复杂结构内容的精确检索
XQuery
XML 电子图书 , 期刊 , 论文
精确定位检索
XML 公式描述
IBM Software Group
14
关系模型转向 XML 模型 Schema Diversity
A1 A2 A3 A4 A5 … A120
134 NULL 11/23/05 NULL NULL … NULL
NULL 276 NULL NULL Yes … NULL
12 NULL NULL 99.99 NULL … NULL
NULL NULL NULL 123.23 NULL … No
…
每类表格对应相应的物理表
col1 col2 col3 col4 col5 … col640
134 NULL 11/23/05 NULL NULL … NULL
NULL 276 NULL NULL Yes … NULL
12 NULL NULL 99.99 NULL … NULL
NULL NULL NULL 123.23 NULL … No
…
Sparse Data
Sparse Evolution
IBM Software Group | Information Management
IBM Information Management | 2006 © 2006 IBM Corporation15
数据库内以对象方式处理数据
完整对象
组合新对象
XQueryXQuery
IBM Software Group | Information Management
IBM Information Management | 2006 © 2006 IBM Corporation16
海量复杂数据查询
ID XML
N120500
N120501
… …
N500000
JoinJoin JoinJoin
JoinJoin
JoinJoin
大表关联
JoinJoin
直接寻址
IBM Software Group | Information Management
IBM Information Management | 2006 © 2006 IBM Corporation17
<Agreement> <ExternalParties> <AgreementParty> <Name>ABB Holdings, Incorporated</Name> <StateofIncorporation>DE</StateofIncorporation> </AgreementParty> </ExternalParties> <InitialFinancialCommitments> <InitialFinancialCommitment> <Year>2005</Year> <CommittedValue>129000.00</CommittedValue> <VariableValue>10000.00</VariableValue> </InitialFinancialCommitment> <InitialFinancialCommitment> <Year>2006</Year> <CommittedValue>610000.00</CommittedValue> <VariableValue>24000.00</VariableValue> </InitialFinancialCommitment> </InitialFinancialCommitments> <SignedLogs> <SignedLog> <LogType>SOW</Year> <LogSplitsByYears> <LogSplit> <SplitYear>2005</SplitYear> <SplitCommitedValue>342000.00</SplitCommitedValue> <SplitVariableValue>23511.00</SplitVariableValue> </LogSplit> ...
XML 与传统的 OLAP 分析Data User1. Design Data Warehouse
2. Design ETL “shredding”
3. Load data warehouse
4. Design analytical models
5. Load Cubes
6. User Access
IBM Software Group | Information Management
IBM Information Management | 2006 © 2006 IBM Corporation18
DB2 9
采用 DB2 pureXML 进行 XML 分析 - XOLAP
XML
<Agreement> <ExternalParties> <AgreementParty> <Name>ABB Holdings, Incorporated</Name> <StateofIncorporation>DE</StateofIncorporation> </AgreementParty> </ExternalParties> <InitialFinancialCommitments> <InitialFinancialCommitment> <Year>2005</Year> <CommittedValue>129000.00</CommittedValue> <VariableValue>10000.00</VariableValue> </InitialFinancialCommitment> <InitialFinancialCommitment> <Year>2006</Year> <CommittedValue>610000.00</CommittedValue> <VariableValue>24000.00</VariableValue> </InitialFinancialCommitment> </InitialFinancialCommitments> <SignedLogs> <SignedLog> <LogType>SOW</Year> <LogSplitsByYears> <LogSplit> <SplitYear>2005</SplitYear> <SplitCommitedValue>342000.00</SplitCommitedValue> <SplitVariableValue>23511.00</SplitVariableValue> </LogSplit> ...
SQL Logs1. Connect, design, deploy
2. User Access
Data User
IBM Software Group | DB2 Information Management Software
19
XML 数据架构与应用使用数据的方式更好匹配过去数据层只能是关系型的表
pureXML 提供了更好的选择
Object Oriented XML
Shred to Relational
Relational
Join Relational
XMLXSLTPresentation
Object Oriented
XQuery
Presentation
XML
Application Server
DatabaseServer
XML
XML
Application Server
DatabaseServer
Information Management
© 2006 IBM Corporation20
数据库发展的转折点XML 正在改变数据的管理方式
XML RDB字段
文件
性能 / 扩展性 , 可靠性 , 安全性…
关系型数据库
查询灵活性
层次型 数据库
与应用无关
内容资料库
数字化内容
XML 文档 , 交换
复杂的 Schema 演变序列 & 层次
XQuery and/or SQL XML and/or Relational Data
混合的能力灵活的架构
应用
XML 数据库
IBM Software Group
21
系统架构灵活性的挑战信息必须成为一种战略资产
Application Code
User Interface
Traditional Application
Business RulesData
Data
S 1 S 3S 2 S 4
Enterprise Service Bus
Process Driven Approach
IBM Software Group
22
从各种具体的应用中分离出主要信息
成为一个集中的、独立于应用的资源
简化整合任务和新应用开发 确保各个交易系统和分析系统间
的主要信息的一致性 用“事前处理”的方法代替“事
后处理” ( 比如数据仓库 ) ,来解决数据质量和一致性问题 分析系统 /
数据仓库
已有应用
主数据主数据
已有应用
主数据主数据
已有应用
主数据主数据
主数据管理系统
新应用
主数据管理 -- 基于 SOA 架构的信息重用 主数据 : 是描述核心业务实体的事实 : 客户 , 供应商 , 合作伙伴 , 产品 , 物料 , 物料清单 , 账目 , 地点 , 等等
IBM Software Group
23
MDM 将通用的信息及其处理流程从独立的应用中分离 , 形成可共享的信息服务集合 ,
MDM 主数据管理 -- SOA 中信息重用
App 1 App 2
App 3
Master Data and Services
SOA 基础架构
(e.g. Enterprise Service Bus)
IBM Software Group
24
Information on Demand
Data Governance
InsightIn-line, Real-timeDashboardsTools & Applications
and more…abc…DB2
IBM ContentManager
Oraclexyz…
Data & Content
MasterData
InsightfulRelationships
Information as a Service(Information Virtualization)
Master Data Integration Master Process Integration
Entity SOA DataWarehousingComposite AppsAnalytics
Master Data Management
Enterprise Data andProcess Models
Enterprise Data andProcess Models
Information as Service
IBM Software Group | Information Management
IBM Information Management | 2006 © 2006 IBM Corporation25
IBM Software Group | Information Management
IBM Information Management | 2006 © 2006 IBM Corporation26
John DoePeter Pan
<namelist> <name>John Doe</name> <name>Peter Pan</name></namelist>
XQuery FLWOR
<name>John Doe</name><name>Peter Pan</name>
xqueryfor $d in xmlcolumn('deptdoc')/deptwhere $d/@bldg = 101return <namelist>
{$d/employee/name} </namelist>
This result is not an XML document!
xqueryfor $d in xmlcolumn('deptdoc')/deptwhere $d/@bldg = 101return $d/employee/name/text()
xqueryfor $d in xmlcolumn('deptdoc')/deptwhere $d/@bldg = 101return $d/employee/name
<dept bldg="101"> <employee id="901"> <name>John Doe</name>
<phone>408 555 1212</phone><office>344</office>
</employee><employee id="902">
<name>Peter Pan</name><phone>408 555 9918</phone><office>216</office>
</employee></dept>
create table dept (deptID char(8), deptdoc xml);
IBM Software Group | Information Management
IBM Information Management | 2006 © 2006 IBM Corporation27
XMLQUERY: embed XQuery in SQL
create table dept(deptID char(8) primary key, doc xml);create table unit(unitID char(8), headcount integer, bldg integer);
select deptID,xmlquery('for $d in $doc/dept where $d/@bldg = 101 return $d/name' passing doc as "doc")
from deptwhere deptID <> "PR27";
select d.deptID , u.headcount, xmlquery('$doc/dept/name' passing d.doc as "doc")from dept d, unit uwhere d.deptID=u.unitIDand u.headcount > 200and xmlexists('$doc/dept/employee[@name = "Joe"]' passing d.doc as "doc")