SlideShare a Scribd company logo
1 of 32
XML Standard Library Selection
Feb. 2013
cgshome@gmail.com
Agenda
1. XML Library Selection Overview
 Selection Approach
 Selection Progress
2. XML Requirements Analysis
 XML Requirements Analysis
 XML Candidate Library Research
3. XML Library Evaluation
 XML Library Recommendation
 XML Library Tradeoff Analysis
4. XML Library Application Guide
 XML Library Use Cases
 XML Library Impact Analysis
 XML Library Application
#. Appendix
1
2
Selection Approach 1. XML Library Selection Overview
DetailedTask
XML Requirements Analysis XML Library Evaluation XML Library Application Guide
• XML Library Tradeoff Analysis
 Java Standard Compatibility
 stability
 performance
 usability
 Constraints
• XML Library Analysis
 Dependency
 Experiment Program
 Performance Test
• XML Library Recommendation
• XML Library Application Pilot
Development
 Define XML Handling
Functionality
 Design Architecture
 Implement & Test
• XML Library Impact Analysis
 As-Is XML Library Usage &
Libraries
 Module impact analysis on
Standard XML Libraries
• XML Requirements Analysis
 Use email inquiry for each
custom function team
 Gather XML requirements and
adopted libraries
• XML Candidate Library Research
 Java standard API
 XML libraries included in Java
Runtime Environment(JRE)
 Alternative XML libraries
Approaches
7 12 13 14 15 18 19 20 21 22 25 26 27 28 1
요구사항 질의서 작성 및 요청
요구사항 질의서 수집 및 분석
Java 표준 API 및 JRE조사
대안 XML라이브러리 조사
분석 관점 정의
라이브러리 분석
라이브러리 테스트
라이브러리 선정
보고서 작성
XMLLibrary 표준 선정 보고
파일럿 요건 정의
파일럿 설계/구현
파일럿 테스트
Task Artifacts
2013.02
W1 W2 W3
XMLLibrary
Evaluation
XMLLibrary
Application
Method
XML
Requirements
Analysis
XMLRequirements
Analysis
XMLCandiate Library
Research
XMLLibrary
개발 가이드
D48
개발 가이드
XMLLibrary Tradeoff
Analysis
평가 보고서
XMLLibrary
Selection
보고서
3
Selection Progress 1. XML Library Selection Overview
WBS & Progress
Today
4
XML Requirements Analysis(1/2) 2. XML Requirements Analysis
OOO Custom Application은 유사한 XML 처리 요구사항에 대해 서로 상이한 XML Library 및 버전을 적용하
고 있음
Application Requirements Libraries
A Team
• Xpath
• XML Parser
• Marshalling/unmarshalling
• dom4j-1.6.1.jar
• jaxen-1.1.4.jar
• jaxb-impl-2.2.6
B Team
• Xpath
• XML Parser
• SOAP
• JAXP v.1.4 (J2SE 1.6)
C Team
• Marshalling/unmarshalling
• XML Parser
• SOAP
• xalan 2.7.1
• xmlbeans 2.4.0, xbean_xpath 2.1.0
• xercesImpl 2.9.1
D Team
• Xpath
• XML Parser
• SOAP
• JAXP 1.4 (J2SE 1.6)
• SAAJ 1.3 (J2SE 1.6)
E Team
• Websquare
• marshalling, unmarshalling
• XML Parser
• SOAP
• dom4j-1.6.1.jar / xalan-2.7.1.jar / xbean-2.1.jar /
xbean_xpath-2.1.0.jar
• xmlschema-core-2.0.1.jar / xalan-2.7.1.jar
• spring-oxm.3.1.1 / xstream-1.3.1
F Team
• Websquare
• XML Parser
• dom4j-1.6.1.jar / xalan-2.7.1.jar / xbean-2.1.jar /
xbean_xpath-2.1.0.jar
• dom4j-1.6.1.jar
Custom Application XML Library 적용 현황
XML 기능 요구사항은 유사함
(Xpath, SOAP, Marshalling)
서로 상이한 XML Library 및 버전이 적용됨
(dom4j, jaxen, jaxb, j2se standard)
* 상세 요구사항은 “#별첨.Custom Application XML Requirements Inquiry Result” 참조
5
XML Requirements Analysis(2/2) 2. XML Requirements Analysis
Functional Requirements
ID Use Case Use Case Description
R001 XPath XPath 표현식 처리 기능을 제공해야 한다
R002 XML Parser XML Parsing을 위한 DOM/SAX/StAX 표준 기능을 제공해야 한다
R003 Marshalling / Unmarshalling XML과 Java Object 간 상호 변환 기능을 제공해야 한다
R004 SOAP Message Handling SOAP Message 처리 기능을 제공해야 한다
Constraints
ID Constraints Description
C001 Java 1.6.0 Custom Framework 기반 어플리케이션은 JVM 1.6.0 (1.6.0.27 버전)을 기반으로 한다
C002 Spring 3.1.1 Custom Framework 기반 어플리케이션은 Spring 3.1.1 라이브러리를 적용한다
C003
Framework 공통
라이브러리와 호환
WebSquare, Apache-CXF 등 Framework 공통 라이브러리가 의존하고 있는 XML
라이브러리와 상호 호환 되어야 한다
XML Requirements
JSR 067JSR 222JSR 206
6
XML Candidate Library Research(1/4) 2. XML Requirements Analysis
Java API for XML
Processing
(JAXP)
Streaming API
for XML (StAX)
XSL
Transformation
(XSLT)
XML Path
Language
(XPath)
XML Inclusions
(Xinclude)
Document
Object Model
(DOM)
Simple API for
XML (SAX)
ExtensibleMarkup
Language(XML)
Namespaces in
XML
XML Schema
Java Architecture
for XML Binding
(JAXB)
SOAP with Attach
ments API for
Java (SAAJ)
Java Standard XML API & JRE Bundle Libraries
JSRs(Java Specification Requests)은 XML을 위한 Java 표준 API를 정의하고 있으며, JRE는 표준 API에 대응
되는 Bundle 구현체를 제공함
Apache Xerces
(com.sun.org.apache.xerces)
Apache Xalan
(com.sun.org.ap
ache.xpath)
Glassfish JAXB RI
(com.sun.xml.inter
nal.bind.v2)
Glassfish SAAJ RI
(com.sun.xml.inter
nal.messaging)
Java Standard API
JRE Bundle Library
org.w3c.dom org.xml.sax javax.xml.streamjavax.xml.xpath
javax.xml.bind javax.xml.soap
7
XML Candidate Library Research(2/4)
Library Description
JAXP
(Java API for XML Processing)
• XML 처리를 위한 Java API로 XML 문서의 유효성 검증과 분석을 위한 인터페이스를 제공
• 분석 인터페이스로 DOM, SAX, StAX (JAXP 1.4 이후) 를 제공한다.
• J2SE 1.4 이상은 JAXP를 포함하며, J2SE 5.0에서는 JAXP1.3, Java SE 6에서는 JAXP 1.4를 포함한다.
DOM
(Document Object Model)
• 객체 지향 모델로써 구조화된 문서를 표현하는 형식으로 W3C 표준
• 문서 전체를 트리(Tree) 구조로 메모리로 읽어서 랜덤하게 접근이 가능하다
SAX
(Simple API for XML)
• 문서를 스트림으로 읽어 가면서 문서 항목 단위 이벤트가 발생하여 응용 프로그램에서 처리
• DOM에 비해 단순한 인터페이스를 갖고 있으며, 처리해야 할 파일이 많거나 큰 경우에 적합
• SAX는 파서에서 응용 프로그램으로 데이터를 보내는 방식(Push 방식)
StAX
(Streaming API for XML)
• DOM과 방식의 중간 방식. JSR 173 표준
• 문서의 한 지점을 가리키는 커서가 있어 응용 프로그램은 필요에 따라 정보를 추출할 수 있음(Pull 방식)
• Java SE 6.0이상에 포함됨
XPath
(XML Path Language)
• Java SE 5.0 DOM 방식 지원
JAXB
(Java Architecture for XML
Binding)
• Java class와 XML 간 매핑을 지원. Java SE 6.0 이상에 포함됨. JSR 222
• Java 개체를 XML 로 변환하는 Marshal 기능과 XML 을 Java 개체로 변환하는 Unmarshal 기능을 제공
• Class 에 어노테이션(@XmlRootElement and @XmlElement 등)을 이용하여 마크업 정의
SAAJ
(SOAP with Attachments API
for Java)
• SOAP 표준을 준수하는 메시지를 생성 및 처리를 지원. JSR 067
2. XML Requirements Analysis
8
XML Candidate Library Research(3/4) 2. XML Requirements Analysis
XML Parser Comparison
DOM, SAX, StAX 표준 중 성능에 유리한 StAX/SAX 사용을 기본적으로 권장하며, 복잡한 XML 조작이 필요하
거나 XML CRUD 처리가 필요한 경우에는 DOM 사용을 권고
Feature
DOM
(Document Object Model)
SAX
(Simple API for XML)
StAX
(Streaming API for XML)
API 특징 In memory tree Push events, streaming Pull events, streaming
개발 용이성 High Medium Medium
XPath 지원 Yes No No
CPU/Memory High Low Low
Read XML Yes Yes Yes
Write XML Yes No Yes
Create, Read, Update, Delete Yes No No
요약
• 성능 측면에서 불리
• 복잡한 XML 조작에 유리
• XML CRUD 처리 지원
• 성능 측면에서 우수
• 단순 XML 처리에 유리
• XML Read 처리 지원
• 성능 측면에서 유리
• 단순 XML 조작에 유리
• XML Read/Write 처리 지원
라이브러리 적용
Recommendation
• DOM, SAX, StAX 표준 중 성능 및 편이성이 유리한 StAX/SAX를기본 사용 권장
• 단 복잡한 XML 조작이 필요하거나 XML CRUD 처리가 필요한 경우에는 DOM 사용
9
XML Candidate Library Research(4/4) 2. XML Requirements Analysis
XML Candidate Libraries
XML Candidate Library에는 JDK Default Bundle, Latest Bundle Library, Alternative Library 적용의 3가지
후보군이 있음
Java
Standard
Xpath
(javax.xml.xpath)
DOM
(org.w3c.dom)
SAX
(org.xml.sax)
StAX
(javax.xml.stream)
JAXB
(javax.xml.bind)
SAAJ
(javax.xml.soap)
Default
JDK (1.6.0)
Bundle
 Xalan 2.6.0  XercesImpl 2.6.2  Jaxb-impl 2.1.10  SAAJ 1.3
Latest
JDK (1.6.0)
Bundle
 Xalan 2.7.1  XercesImpl 2.11.0  Jaxb-impl 2.2.7  SAAJ 1.3.4
Alternative
Library*
(Applied)
 Jaxen 1.1.4
 xmlbeans_xpath
2.6.0
 Dom4j 1.6.1
 xmlbeans 2.4.0
 Dom4j 1.6.1
 xmlbeans 2.4.0
Alternative
Library*
 xstream 1.4.4
 Woodstox 4.1.3
 xstream 1.4.4
 JiBX 1.2.4
 Castor 1.3.2
 Green : 표준 API 지원  Red: 표준 API 미지원Tradeoff 분석 범위* 상세 의존관계 분석은 “#별첨.XML Candidate Library Dependency” 참조
10
XML Library Recommendation 3. XML Library Evaluation
XML Library Evaluation Summary
XML Library 리서치 및 성능 테스트를 통해 검증한 결과, JDK Bundle Library로 선정된 오픈 소스가 JSR 표준
을 준수하고 성능이 우수한 것으로 평가됨. 단, Xpath는 Alternative Library에 비해 성능이 낮음
* Library Version은 패키지 라이브러리와의 호환성을 위해 조정 가능함
XML Requirements
XML Library Candidate
Recommendation*Default JDK Bundle
Library
Latest JDK Bundle
Library
Alternative Library
XPath Xalan 2.6.0 Xalan 2.7.1 Jaxen 1.1.4 Jaxen 1.1.4
XML Parser XercesImpl 2.6.2 XercesImpl 2.11.0 Dom4j 1.6.1 XercesImpl 2.11.0
Marshalling /
Unmarshalling
Jaxb-impl 2.1.10 Jaxb-impl 2.2.7 xmlbeans 2.4.0 Jaxb-impl 2.2.7
SOAP Message Handling Saaj-impl 1.3 Saaj-impl 1.3 Saaj-impl 1.3.4
11
XML Library Tradeoff Analysis: XPath(1/2) 3. XML Library Evaluation
분석 관점
JDK Bundle Library Alternative Library
1안.
Default Xalan
2안.
Latest Xalan
3안.
Jaxen**
Java 표준 준수
(Java Standard
Compatibility)
(+) javax.xml.xpath 인터페이스 지원 (+) javax.xml.xpath 인터페이스 지원 (-) javax.xml.xpath 인터페이스 미지원
안정성
(Library stability)
 최신 패치 반영
 적용 레퍼런스
 커뮤니티 활동
(-) Xalan-Java 2.6.0 버전 이후 버그
패치를 반영하지 않음
(+) JDK, Xerces 외 다수 오픈 소스 참조
(+) 지속적 패치 활동
(+) 최신 버전을 사용하므로 버그
패치가 모두 반영됨
(+) JDK, Xerces 외 다수 오픈 소스 참조
(+) 지속적 패치 활동
(+) 최신 버전을 사용하므로 버그
패치가 모두 반영됨
(+) dom4j 외 다수 오픈 소스 참조
(+) 지속적 패치 활동
성능
(Library performance)
(-) Jaxen 비교 성능 미흡
 Xpath 성능 튜닝 가이드* 검토
(-) Jaxen 비교 성능 미흡
 Xpath 성능 튜닝 가이드* 검토
(+) Xalan 비교 성능 우수
 Xalan 비교 60배 이상
사용 편의성
(+) xpath 1.0 지원
(+) API 타 라이브러리와 유사
(+) xpath 1.0 지원
(+) API 타 라이브러리와 유사
(+) xpath 1.0 지원
(+) API 타 라이브러리와 유사
제약사항 • Xercers Dependency • Xercers Dependency • Dom4j Dependency
Summary
• JAXP 표준 준수
• 패치 반영 미흡
• 성능 미흡(검토 필요)
• JAXP 표준 준수
• 최신 패치 반영
• 성능 미흡(검토 필요)
• JAXP 표준 미지원
• 다수의 오픈 소스 참조
• 성능 우수
Decision
• Jaxen 최종 권고 (상세 성능 비교는 다음 페이지 참조)
 Jaxen 700KB 이상의 XML 파일 처리 시 고른 성능 안정성 및 10배 이상의 성능 차이를 보임
 XPath 표준 API 대신 Jaxen API 도입
* Xpath 성능 튜닝 가이드 : 10~20% 성능 개선 효과는 있으나, Jaxen과 비교 시 10배 이상의 성능 갭을 줄이지는 못함
** Jaxen 적용 사례는 “#Appendix. Artifacts used Jaxen library” 참조
12
XML Library Tradeoff Analysis: XPath(2/2) 3. XML Library Evaluation
Xalan Performance
File size 8170KB 1600KB 779KB 74KB 8KB 1KB
# of Records 10000 2000 1000 100 10 1
Xpath
/*/*/Attr1x1 4 1 1 0.5 0.36 0.25
/*/*/Attr1x5000 409 126 43 1.2 0.41 0.27
/*/*/Attr1x9999 897 97 28 2.7 0.66 0.26
XpathNodes
/*/*/Attr1x1 866 62 27 2.1 0.44 0.27
/*/*/Attr1x5000 860 136 41 2.1 0.52 0.31
/*/*/Attr1x9999 851 151 119 3 0.42 0.24
/*/Item 851 85.6 25 2 0.42 0.24
Jaxen Performance
File size 8170KB 1600KB 779KB 74KB 8KB 1KB
# of Records 10000 2000 1000 100 10 1
Xpath
/*/*/Attr1x1 74 5 1 1 0 0
/*/*/Attr1x5000 16 4 1 1 0 0
/*/*/Attr1x9999 15 4 1 0 0 0
XpathNodes
/*/*/Attr1x1 15 4 0.7 0.6 0.01 0.01
/*/*/Attr1x5000 16 4 1 1 0.02 0.01
/*/*/Attr1x9999 15 4 1 0.6 0.02 1
/*/Item 1367 62 16.3 14.3 0.02 0.01
Jaxen은 개별 Node 검색에 있어 안정된 성능을 제공하며, 779KB 이상 구간에서 Xalan에 비해 15~119 배 이
상의 성능 차이를 보임. 단, Xalan은 First node 검색 및 전체 Node 추출 시 부분적으로 Jaxen 보다 높은 성능을 보임
단위: ms
단위: ms
13
XML Library Tradeoff Analysis: XML Parser(1/3) 3. XML Library Evaluation
분석 관점
JDK Bundle Library Alternative Library
1안.
Default Xerces
2안.
Latest Xerces
3안.
Dom4j 1.6.1
Java 표준 준수
(Java Standard
Compatibility)
(+) JAXP 인터페이스 지원 (+) JAXP 인터페이스 지원 (-) JAXP 인터페이스 미지원
안정성
(Library stability)
 최신 패치 반영
 적용 레퍼런스
 커뮤니티 활동
(-) xercesImpl 2.6.2 버전 이후 버그
패치를 반영하지 않음
(+) JDK, Jdom, Hudson 외 다수 오픈
소스 참조
(+) 지속적 패치 활동
(+) 최신 버전을 사용하므로 버그
패치가 모두 반영됨
(+) JDK, Jdom, Hudson 외 다수 오픈
소스 참조
(+) 지속적 패치 활동
(+) 최신 버전을 사용하므로 버그
패치가 모두 반영됨
(+) Hibernate, jboss, POI 외 다수 오픈
소스 참조
(+) 지속적 패치 활동
성능
(Library perf. & Memory)
(+) Dom4j 비교 DOM/SAX/ StAX 성능
우위
(+) 효율적 메모리 사용 우위
(+) Dom4j 비교 DOM/SAX/ StAX 성능
우위
(+) 효율적 메모리 사용 우위
(-) Xerces 비교 DOM/SAX/ StAX 성능
낮음
(-) 효율적 메모리 사용 열위
사용 편의성
(-) DOM/SAX/StAX Parser 별 고유
API를 이용한 어플리케이션 개발
(-) DOM/SAX/StAX Parser 별 고유
API를 이용한 어플리케이션 개발
(+) DOM/SAX/StAX Parser에 독립된
dom4j.Document API를 이용한 개발
제약사항 • xml-api.jar(JAXP) 표준 의존 • xml-api.jar(JAXP) 표준 의존 • Jaxen Dependency
Summary
• JAXP 표준 준수
• 패치 반영 미흡
• 성능 우수
• 사용 편의성이 낮음
• JAXP 표준 준수
• 최신 패치 반영
• 성능 우수
• 사용 편의성이 낮음
• JAXP 표준 미지원.
• 다수의 오픈 소스 참조
• 성능 낮음
• 사용 편의성이 좋음
Decision
• 2안 Latest Xerces 안을 권고
 JAXP 표준 API를 준수함
 Dom4j 비교 시 근소한 성능 우위를 제공 (상세 성능 비교는 다음 페이지 참조)
 사용 편의성은 낮으나, XML 접근 라이브러리는 공통 코드로 개발되므로 개발 생산성에 영향 요소가 낮음
14
XML Library Tradeoff Analysis: XML Parser(2/3) 3. XML Library Evaluation
Xerces Performance: Using DOM
File size 8170KB 1600KB 779KB 74KB 8KB 1KB
# of Records 10000 2000 1000 100 10 1
Creation 318 26 14 1 0.1 0
Write 436 72 34 4 0 0
Parsing 1444 164 65 15 1.26 0.81
Transform 2571 320 125 6.1 1 1
Dom4j Performance: Using SAX*
Xerces는 779KB 이상 구간에서 Dom4j에 비해 1~2배 수준의 성능 우위를 보임
단위: ms
단위: ms
File size 8170KB 1600KB 779KB 74KB 8KB 1KB
# of Records 10000 2000 1000 100 10 1
Creation 565 24 102 10 0.06 0.01
Write 732 113 819 56 1 1
Parsing 1650 480 96.7 6.6 1.46 0.93
Transform 3020 332 142 134 1 0
* Dom4j는 SAX를 기반으로 DOM CRUD 기능을 제공함.
W3C Dom을 읽을 수 있는 Dom 구현체는 제공하지 않으며, W3C Dom과 Dom4j Dom 개체간 변환을 위한 DomReader/DomWriter를 제공함
(DomReader/Writer를 이용한 성능 비교는 다음 페이지를 참조)
15
XML Library Tradeoff Analysis: XML Parser(3/3) 3. XML Library Evaluation
Xerces는 779KB 이상 구간에서 DOM, SAX, StAX 각각 1.5~1.7배, 1.1 ~ 3.9배, 2.8~5.5배 성능 우위를 보이
며, 1.4 ~ 1.5배, 5.1~7.0배, 1.5 ~ 3.1 배의 메모리 효율성 우위를 보임
Xerces (Parsing Only) Performance
File size 8084KB 1600KB 789KB 78KB 8KB
# of Records 100000 20000 10000 1000 100
Time
DOM 956 81 38 5 2
SAX 398 36 34 3 2
StAX 365 51 16 2 1
Memory
DOM 93 19 9 1 0.1
SAX 13 2 1 0.1 0.1
StAX 14 4 2 0.3 0.1
단위: ms, MBytes
Dom4j (Parsing Only) Performance
단위: ms, MBytes
File size 8084KB 1600KB 789KB 78KB 8KB
# of Records 100000 20000 10000 1000 100
Time
DOM 1669 121 58 7 2
SAX 935 141 36 5 2
StAX 1092 144 88 5 1
Memory
DOM 127 28 13 1 1
SAX 66 14 7 0.4 0.4
StAX 44 9 3 1 0.4
16
XML Library Tradeoff Analysis: JAXB(1/2) 3. XML Library Evaluation
분석 관점
JDK Bundle Library Alternative Library
1안.
Default JAXB
2안.
Latest JAXB
3안
xmlbeans 2.4.0
Java 표준 준수
(Java Standard
Compatibility)
(+) JAXB 표준 호환성 지원 (+) JAXB 표준 호환성 지원 (-) JAXB 표준 호환성 미지원
안정성
(Library stability)
 최신 패치 반영
 적용 레퍼런스
 커뮤니티 활동
(-) JAXB 2.1.10 버전 이후 버그 패치를
반영하지 않음
(+) JDK, Metro 외 다수 오픈 소스 참조
(+) 지속적 패치 활동
(+) 최신 버전을 사용하므로 버그
패치가 모두 반영됨
(+) JDK, Metro 외 다수 오픈 소스 참조
(+) 지속적 패치 활동
(+) 최신 버전을 사용하므로 버그
패치가 모두 반영됨
(-) CXF 외 일부 오픈 소스 적용
(+) 지속적 패치 활동
성능
(Library performance)
(+) xmlbeans 비교 결과 marshalling /
unmarshalling 모두에서 성능 우위
(+) 효율적 메모리 사용 우위
(+) xmlbeans 비교 결과 marshalling /
unmarshalling 모두에서 성능 우위
(+) 효율적 메모리 사용 우위
(-) jaxb-impl 비교 marshalling /
unmarshalling 모두에서 성능 저조
(-) 효율적 메모리 사용 열위
사용 편의성
(+) 어노테이션 기반의 설정 지원
(+) XML to Java 변환 소스의 복잡도
낮음(POJO 개체 생성, 어노테이션
기반으로 직접 변경 가능)
(+) 어노테이션 기반의 설정 지원
(+) XML to Java 변환 소스의 복잡도
낮음(POJO 개체 생성, 어노테이션
기반으로 직접 변경 가능)
(-) 어노테이션 기반 설정 미지원
(-) XML to Java 변환 소스의 복잡도
높음(인터페이스/구현체 구분,
XMLBeans 의존성 라이브러리 포함)
제약사항 • jaxb-impl.jar(JAXB) 표준 의존 • jaxb-impl.jar(JAXB) 표준 의존 • xben_xpath Dependency
Summary
• JAXP 표준 준수
• 패치 반영 미흡
• 성능 우수
• 사용 편의성이 높음
• JAXP 표준 준수
• 최신 패치 반영
• 성능 우수
• 사용 편의성이 높음
• JAXP 표준 미지원
• 소수의 오픈 소스 참조
• 성능 우수
Decision
• 2안 Latest JAXB 안을 권고
 JAXB 표준 API를 준수함
 XMLBeans 비교 시 성능 우위 및 사용 편의성을 제공 (상세 성능 비교는 다음 페이지 참조)
17
XML Library Tradeoff Analysis: JAXB(2/2) 3. XML Library Evaluation
JAXB-impl Performance:
File size 8084KB 1600KB 789KB 78KB 8KB
# of Records 100000 20000 10000 1000 100
Time
Marshalling 431 67 43 7 3
Unmarshalling 356 77 45 7 4
Memory
Marshalling 12 5 2 0.4 0.4
Unmarshalling 9 2 1 0.4 0.4
Xmlbeans Performance:
Jaxb는 779KB 이상 구간에서 0.7 ~ 3.1 배의 성능 우위 및 2.0 ~ 5.5배 메모리 효율성 우위를 보임
단위: ms, MBytes
File size 8084KB 1600KB 789KB 78KB 8KB
# of Records 100000 20000 10000 1000 100
Time
Marshalling 1195 210 88 10 2
Unmarshalling 251 45 30 3 1
Memory
Marshalling 49 10 11 1.4 0.4
Unmarshalling 21 6 3 0.4 0
단위: ms, MBytes
18
XML Library Use Cases 4. XML Library Application Guide
Functional Requirements
ID Use Case Use Case Description
R001 Node fetch from large XML file XML Document 의 특정 노드를 Xpath 표현식을 이용하여 패치한다
R002 Node addition to XML file XML Document 에 Node를 추가/변경한다
R003* Security masking XML의 지정 엘리먼트의 Value 값을 Masking한다
R004* Security encryption/decryption XML의 지정 엘리먼트의 Value 값을 Encryption/Decryption한다
XML Requirements
* 파일럿 개발 범위에는 포함되지 않음
19
XML Library Impact Analysis Summary 4. XML Library Application Guide
B, D, F Team은 JAXP Xpath, Dom4j 라이브러리를 Class 내부에서만 사용하므로 변경에 대한 영향도가 낮으
나, A Team은 Class 외부에서 Dom4j 모듈을 사용하므로 변경에 따른 영향도가 높음
Impact Analysis Summary
Application Change Item Change Impact Change Description
A Team • Dom4j 라이브러리를 JAXP API 로 변경 High
• All variable & method dependent
Sources
B Team • JAXP XPath 라이브러리를 Jaxen 으로 변경 Low • Method internal change only
C Team • XML Library를 적용한 Application 모듈이 없음 None
D Team • JAXP XPath 라이브러리를 Jaxen 으로 변경 Low • Method internal change only
E Team • XML Library를 적용한 Application 모듈이 없음 None
F Team • Dom4j 라이브러리를 JAXP API 로 변경 Low • Method internal change only
20
XML Library Impact Analysis(1/4) 4. XML Library Application Guide
A Team의 Dom4j 의존성을 JAXP 표준 API로 변경이 필요함. XML Handling Library는 모듈화 되어 있으나,
Dom4j Document 변수의 public 사용 및 method 결과값에 Dom4j 개체가 포함되어 있어 모듈의 변경 영향
도는 높음
Library Requirements As-Is Libraries To-Be Libraries Impact
• Xpath • jaxen-1.1.4.jar • Jaxen 1.1.4 • 소스 변경 영향 없음
• XML Parser • dom4j-1.6.1.jar • xercesImpl 2.11.0
• Dom4j 라이브러리를 JAXP API 로
변경
• Marshalling/unmarshalling
• jaxb-impl-2.2.6
• spring-oxm
• Jaxb-impl 2.2.7
• spring-oxm
• 소스 변경 영향 없음
Impact Analysis : Middlezone
Source Method XML Functionality Change Item Change Impact
• BaseBuilder.java
• getPvsOrdLineListByFIC(..)
• Dom4j Document에서 Xpath.에
해당하는 Node 검색
• public 변수로 정의한
Dom4j Document 를 JAXP
Documents로 변경
• High: All variable dependent
Sources
• getSingleNodeContent(..)
• Xpath에 해당하는 단일 Node
검색
• getMultiNodeContent(..)
• Xpath에 해당하는 복수 Node
검색
• EbmConverter.java • fromMessage(..)
• JMX message를 Unmarshall ing
• JMX message를 Dom4j
Document로 변환 (Map에
저장하여 변환)
• Dom4j Document 를 JAXP
Documents로 변경
• High: All method dependent
sources
21
XML Library Impact Analysis(2/4) 4. XML Library Application Guide
B Team의 JAXP XPath 의존성을 Jaxen API로 변경이 필요함. Method 내부에서 JAXP 및 XML Parser API가
사용되고 있어 모듈 변경 영향도는 낮음
Library Requirements As-Is Libraries To-Be Libraries Impact
• Xpath • JAXP v.1.4 (J2SE 1.6) • Jaxen 1.1.4
• JAXP XPath 라이브러리를 Jaxen
으로 변경
• XML Parser • JAXP v.1.4 (J2SE 1.6) • xercesImpl 2.11.0 • 소스 변경 영향 없음
• Marshalling/unmarshalling • JAXB v.2.2 (J2SE 1.6) • Jaxb-impl 2.2.7 • 소스 변경 영향 없음
• SOAP • SAAJ v.1.3 (J2SE 1.6) • Saaj-impl 1.3.4 • 소스 변경 영향 없음
Impact Analysis : PRM
Source Method XML Functionality Change Item Change Impact
• XPathInteceptor.java • getXpathValue(..)
• 입력받은 XML String에서
XPath에 해당하는 Node를 검색
• JAXP XPath 를 Jaxen XPath
로 변경
• Low: Method internal change
only
• Apache CXF - -
• Jaxb-impl 및 saaj-impl
의존성으로 변경사항 없음
• 소스 변경 영향 없음
22
XML Library Impact Analysis(3/4) 4. XML Library Application Guide
D Team의 JAXP XPath 의존성을 Jaxen API로 변경이 필요함. Method 내부에서 JAXP 및 XML Parser API가
사용되고 있어 모듈 변경 영향도는 낮음
Library Requirements As-Is Libraries To-Be Libraries Impact
• Xpath • JAXP v.1.4 (J2SE 1.6) • Jaxen 1.1.4
• JAXP XPath 라이브러리를 Jaxen
으로 변경
• XML Parser • JAXP v.1.4 (J2SE 1.6) • xercesImpl 2.11.0 • 소스 변경 영향 없음
• Marshalling/unmarshalling • JAXB v.2.2 (J2SE 1.6) • Jaxb-impl 2.2.7 • 소스 변경 영향 없음
• SOAP • SAAJ v.1.3 (J2SE 1.6) • Saaj-impl 1.3.4 • 소스 변경 영향 없음
Impact Analysis : SOMM-ext (1/2)
Source Method XML Functionality Change Item Change Impact
• ProcessXML.java
• getNodeValue(..)
• 입력받은 XML String에서
XPath에 해당하는 Node를 검색
• JAXP XPath 를 Jaxen XPath
로 변경
• Low: Method internal change
only
• updateNode(..)
• 입력받은 XML String에서
XPath에 해당하는 Node를 검색
후 해당 Value를 업데이트함
(DOMSource를 리턴함)
• JAXP XPath 를 Jaxen XPath
로 변경
• Low: Method internal change
only
• getDOMSource(..)
• 입력받은 XML String을
DOMSource로 변환함
• 변경 사항 없음 • 변경사항 없음
• getMessageXML(..)
• 입력받은 XML String에서
XPath에 해당하는 Node를 검색
• JAXP XPath 를 Jaxen XPath
로 변경
• Low: Method internal change
only
23
XML Library Impact Analysis(3/4) 4. XML Library Application Guide
Impact Analysis : D Team (2/2)
Source Method XML Functionality Change Item Change Impact
• OsmXMLAPI.java • addWSSecurityHeader(..)
• 입력받은 SOAPMessage에
SOAPHeader 정보를
추가/저정함
• 변경 사항 없음 • 변경사항 없음
• FalloutActionServiceI
mpl.java
• closeOrder(..)
• SOAP Message 요청 및 SOAP
Message 응답 처리
• 변경 사항 없음 • 변경사항 없음• retryTaskIfFSContinue(..)
• updateFalloutDetail(..)
24
XML Library Impact Analysis(4/4) 4. XML Library Application Guide
F Team의 Dom4j 의존성을 JAXP API로 변경이 필요함. Method 내부에서 Dom4j API가 사용되고 있어 모듈
변경 영향도는 낮음
Library Requirements As-Is Libraries To-Be Libraries Impact
• XML Parser • dom4j-1.6.1.jar • xercesImpl 2.11.0
• Dom4j 라이브러리를 JAXP API 로
변경
Impact Analysis : F Team
Source Method XML Functionality Change Item Change Impact
• MenuCreateXMLData
ServiceImpl.java
• selectListMenuCreateXMLData(
..)
• 입력받은 사용자에 해당하는
메뉴 목록을 XML Snipplet로
생성하여 String으로 리턴함
• Dom4j API를 JAXP API로
변경
• Low: Method internal change
only
• CallBSSWebservice.jav
a
• processResubmit(..)
• 입력받은 payload String을 XML
로 변환하여 URLConnection에
요청함
• Dom4j API를 JAXP API로
변경
• Low: Method internal change
only
• EGIRetryServiceImpl.j
ava
• getISStream(..) • 입력받은 element String을
XML로 변환 후 EAI_CDATE 노드
값을 변환하여 URLConnection에
요청함
• Dom4j API를 JAXP API로
변경
• Low: Method internal change
only
• getOSStream(..)
Application (Websquare Independent)
JVM 1.6
Custom Framework
Xalan 2.6.0 Bundle
(JAXP XPath)
XercesImpl 2.6.2
Bundle
(JAXP)
jaxb-impl 2.1.10
Bundle
(JAXB)
saaj-impl 1.3 Bundle
(SAAJ)
Jaxen 1.1.4
XercesImpl 2.11.0
(JAXP)
jaxb-impl 2.2.7
(JAXB)
saaj-impl 1.3.4
(SAAJ)
Websquare
Xalan 2.7.0
(JAXP XPath)
XercesImpl 2.7.1
(JAXP)
xmlbeans-2.4.0
Xbean_xpath 2.5.0
XPath Client XML Parser Client JAXB Client SOAP Client
25
XML Library Application 4. XML Library Application Guide
Standard XML Library를 현 Custom Framework에 적용할 경우, Websquare의 JAXP 모듈의 버전 Conflict
해결이 필요하며, 그 외 모듈간의 Conflict 문제는 없음
XML Library Application
Module
JDK Module Override
Module Conflict
Module dependency
26
• Custom Application XML Requirements Inquiry Result
• XML Candidate Library Dependency
• Artifacts used Jaxen library
• Performance Test Source Code
# Appendix
Custom Application XML Requirements Inquiry Result(1/2)
27
Question A Team B Team C Team
적용 Library
• jdom4j-1.6.1.jar
• jaxen-1.1.4.jar
• jaxb-impl-2.2.6
• JAXP v.1.4 (J2SE 1.6) /
• jaxb-impl-2.1.13
• xalan 2.7.1
• xmlbeans 2.4.0, xbean_xpath 2.1.0
• xercesImpl 2.9.1
주요 기능
• Marshalling/unmarshalling
• XPath
• webService의 Interceptor 에서 특정
데이터 추출 /
WSDL, WebService 데이터 바인딩
• 해당 사항 없음
선정 기준 • 성능 및 개발 편의성
• Java 기본 구성 /
• Spring-cxf 의 기본 구성
• 해당 사항 없음
XML 파일 Size • 테스트 대상 파일 110KB ~ 170KB • 평균 6KB, 최대 60KB • 해당 사항 없음
동시 처리 건 수
• Peak time 1500 TPS
(2대, Instance 4대)
• Parser 기준 요구 TPS: 100 TPS
• 개발환경 14 TPS • 해당 사항 없음
추가 요구사항
• XML Parser 변경 시 개발 일정 영향
(2월 말 완료 예정)
• 다양한 데이터를 처리하기 위해
Element 및 parsing 룰을 DB에서
관리하도록 구성해야 됨
• 해당 사항 없음
소스 파일
CXF 프레임워
크에서 처리,
소스 없음
# Appendix
Custom Application XML Requirements Inquiry Result(2/2)
28
Question D Team E Team F Team
적용 Library • JAXP v.1.4 (J2SE 1.6)
(1) Websquare
• dom4j-1.6.1.jar
• xalan-2.7.1.jar
• xbean-2.1.jar
• xbean_xpath-2.1.0.jar
• xml-apis-2.0.2.jar
• xmlbeans-2.4.0.jar
• xmlbeans-qname-2.4.0.jar
• xmlbeans-xmlpublic-2.4.0.jar
Websquare
• xalan.jar
• xbean.jar
• xbean_xpath.jar
• xercesImpl.jar
• xml-apis.jar
• xmlbeans-2.3.0.jar
• xmlbeans-qname.jar
• xmlpublic.jar
주요 기능
• XQuery 를 이용하여 XML
Node, XML Data getting or
Update
• SOAP Message Handling
• websquare, marshalling, webservice
Websquare
• Excel Handling
GEMMS
• XML Parser
선정 기준 • 범용적인 라이브러리
• (1) WebSquare: 의존 라이브러리
• (2) XStreamMarshallerXPath: 포팅되어있으나,미사용
• (3) Service Expose: Apache-cxf 의존 라이브러리
• Websquare default. No specific reason
XML 파일 Size • Max 1MB 내외 • 현재 JSON Parser를 사용하기 때문에 해당 없음
• Websquare: Excel average=200KB;
maximum 1MB
• GEMMS: average=5 maximum=50
동시 처리 건 수 • 1 건 (Queue Data 사용) • 현재 JSON Parser를 사용하기 때문에 해당 없음 • estimated average=5 maximum=50
추가 요구사항 • 없음 • 없음
• 9월 오픈 대비, 개발 Freeze 가 3월에
예정 중. 변경 시 시간 및 버퍼 필요
소스 파일 N/A
GEMMS Direct
• dom4j-1.6.1.jar
(2) XStreamMarshaller
• spring-oxm.3.1.1
• xstream-1.3.1
(3) Service Exposer
• xmlschema-core-2.0.1.jar
• xalan-2.7.1.jar
# Appendix
29
XML Candidate Library Dependency
XML Candidate Library Dependency
XML Candidate Library 간의 Dependency 관계는 다음과 같이 정의됨
xalan 2.7.1 xercesImpl 2.10.0
dom4j 1.6.1
xmlbeans_xpath 2.6.0
xml-apis-1.4.01
StAXXPath DOM SAX
xstream 1.4.4
jaxen 1.1.4
xmlbeans 2.4.0
jaxb-impl 2.2.7-b56 saaj-impl 1.3.20
jaxb-api 2.2.7
JAXB
saaj-api 1.3.4
SAAJ
compile
provided
Jar Package
stax-api 1.0.1
StAX
JSR APIwoodstox-core-asl 4.1.4 stax2-api 3.1.1
Jar Package
(Implement Standard API)
cxf-rt-bindings-soap 2.7.3
# Appendix
30
Artifacts used Jaxen library # Appendix
Artifacts Description
jdom2 Java-based solution for accessing, manipulating, and outputting XML data from Java code
Eclipse hudson-core Hudson Continuous Integration Server
PMD Source code analyzer
XOM tree-based API for processing XML with Java that strives for correctness, simplicity, and performance
Dom4j
easy to use, open source library for working with XML, XPath and XSLT on the Java platform using the Java
Collections Framework and with full support for DOM, SAX and JAX
scales-jaxen flexible approach to XML handling and a simplified way of interacting with XML
Mojo chronos Maven plugin for performance testing in continuous integration(CI) environment
Icesoap Quick, easy, asynchronous access to SOAP web services from Android devices
Fcrepo-server Fedora Commons Repository Service
JOnAS Java EE 5 certified Open Source OSGi Enterprise Server
Zimbra Email Messaging and Collaboration for the Post-PC Era
Petals open-source Enterprise Service Bus (ESB) provided by the OW2 Middleware Consortium
31
Performance Test Source Code #.Appendix
XPath/Parser Performance Test Environment
 Windows7 Enterprise
 Intel® Core™ i5 CPU M560 @2.67GHz
 4GB RAM
Xerces Parser (Parsing Only) Performance Input data generator
Dom4j Parser (Parsing Only) Performance
 jaxb-impl-2.2.7-b56
Generated XML Source
Jaxb Parser (Parsing Only) Performance XMLBeans Xml 2 Java Conversion Common

More Related Content

Similar to Xml standard library selection v1.0 2013

ibatis_khhan
ibatis_khhanibatis_khhan
ibatis_khhanohgamja3
 
[오픈소스컨설팅]Tomcat6&7 How To
[오픈소스컨설팅]Tomcat6&7 How To[오픈소스컨설팅]Tomcat6&7 How To
[오픈소스컨설팅]Tomcat6&7 How ToJi-Woong Choi
 
마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관
마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관
마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관제관 이
 
Apache kafka performance(latency)_benchmark_v0.3
Apache kafka performance(latency)_benchmark_v0.3Apache kafka performance(latency)_benchmark_v0.3
Apache kafka performance(latency)_benchmark_v0.3SANG WON PARK
 
REST with Spring
REST with SpringREST with Spring
REST with Spring강우 김
 
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017Amazon Web Services Korea
 
[2012 자바카페 OPEN 세미나] Introduction to google guava
[2012 자바카페 OPEN 세미나] Introduction to google guava[2012 자바카페 OPEN 세미나] Introduction to google guava
[2012 자바카페 OPEN 세미나] Introduction to google guava흥래 김
 
[215]네이버콘텐츠통계서비스소개 김기영
[215]네이버콘텐츠통계서비스소개 김기영[215]네이버콘텐츠통계서비스소개 김기영
[215]네이버콘텐츠통계서비스소개 김기영NAVER D2
 
AWSKRUG DS - 데이터 엔지니어가 실무에서 맞닥뜨리는 문제들
AWSKRUG DS - 데이터 엔지니어가 실무에서 맞닥뜨리는 문제들AWSKRUG DS - 데이터 엔지니어가 실무에서 맞닥뜨리는 문제들
AWSKRUG DS - 데이터 엔지니어가 실무에서 맞닥뜨리는 문제들Woong Seok Kang
 
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재PgDay.Seoul
 
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017Amazon Web Services Korea
 
AWS 9월 웨비나 | Amazon Aurora Deep Dive
AWS 9월 웨비나 | Amazon Aurora Deep DiveAWS 9월 웨비나 | Amazon Aurora Deep Dive
AWS 9월 웨비나 | Amazon Aurora Deep DiveAmazon Web Services Korea
 
Jstl_GETCHA_HANJUNG
Jstl_GETCHA_HANJUNGJstl_GETCHA_HANJUNG
Jstl_GETCHA_HANJUNGJung Han
 
[2B5]nBase-ARC Redis Cluster
[2B5]nBase-ARC Redis Cluster[2B5]nBase-ARC Redis Cluster
[2B5]nBase-ARC Redis ClusterNAVER D2
 
Introduction to Apache Tajo
Introduction to Apache TajoIntroduction to Apache Tajo
Introduction to Apache TajoGruter
 
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018Amazon Web Services Korea
 
Elastic Search Performance Optimization - Deview 2014
Elastic Search Performance Optimization - Deview 2014Elastic Search Performance Optimization - Deview 2014
Elastic Search Performance Optimization - Deview 2014Gruter
 

Similar to Xml standard library selection v1.0 2013 (20)

Ibatis
IbatisIbatis
Ibatis
 
ibatis_khhan
ibatis_khhanibatis_khhan
ibatis_khhan
 
[오픈소스컨설팅]Tomcat6&7 How To
[오픈소스컨설팅]Tomcat6&7 How To[오픈소스컨설팅]Tomcat6&7 How To
[오픈소스컨설팅]Tomcat6&7 How To
 
마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관
마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관
마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관
 
Apache kafka performance(latency)_benchmark_v0.3
Apache kafka performance(latency)_benchmark_v0.3Apache kafka performance(latency)_benchmark_v0.3
Apache kafka performance(latency)_benchmark_v0.3
 
REST with Spring
REST with SpringREST with Spring
REST with Spring
 
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
 
[2012 자바카페 OPEN 세미나] Introduction to google guava
[2012 자바카페 OPEN 세미나] Introduction to google guava[2012 자바카페 OPEN 세미나] Introduction to google guava
[2012 자바카페 OPEN 세미나] Introduction to google guava
 
[215]네이버콘텐츠통계서비스소개 김기영
[215]네이버콘텐츠통계서비스소개 김기영[215]네이버콘텐츠통계서비스소개 김기영
[215]네이버콘텐츠통계서비스소개 김기영
 
AWSKRUG DS - 데이터 엔지니어가 실무에서 맞닥뜨리는 문제들
AWSKRUG DS - 데이터 엔지니어가 실무에서 맞닥뜨리는 문제들AWSKRUG DS - 데이터 엔지니어가 실무에서 맞닥뜨리는 문제들
AWSKRUG DS - 데이터 엔지니어가 실무에서 맞닥뜨리는 문제들
 
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
 
4-1. javascript
4-1. javascript4-1. javascript
4-1. javascript
 
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
 
AWS 9월 웨비나 | Amazon Aurora Deep Dive
AWS 9월 웨비나 | Amazon Aurora Deep DiveAWS 9월 웨비나 | Amazon Aurora Deep Dive
AWS 9월 웨비나 | Amazon Aurora Deep Dive
 
Jstl_GETCHA_HANJUNG
Jstl_GETCHA_HANJUNGJstl_GETCHA_HANJUNG
Jstl_GETCHA_HANJUNG
 
[2B5]nBase-ARC Redis Cluster
[2B5]nBase-ARC Redis Cluster[2B5]nBase-ARC Redis Cluster
[2B5]nBase-ARC Redis Cluster
 
Introduction to Apache Tajo
Introduction to Apache TajoIntroduction to Apache Tajo
Introduction to Apache Tajo
 
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
 
Elastic stack
Elastic stackElastic stack
Elastic stack
 
Elastic Search Performance Optimization - Deview 2014
Elastic Search Performance Optimization - Deview 2014Elastic Search Performance Optimization - Deview 2014
Elastic Search Performance Optimization - Deview 2014
 

Xml standard library selection v1.0 2013

  • 1. XML Standard Library Selection Feb. 2013 cgshome@gmail.com
  • 2. Agenda 1. XML Library Selection Overview  Selection Approach  Selection Progress 2. XML Requirements Analysis  XML Requirements Analysis  XML Candidate Library Research 3. XML Library Evaluation  XML Library Recommendation  XML Library Tradeoff Analysis 4. XML Library Application Guide  XML Library Use Cases  XML Library Impact Analysis  XML Library Application #. Appendix 1
  • 3. 2 Selection Approach 1. XML Library Selection Overview DetailedTask XML Requirements Analysis XML Library Evaluation XML Library Application Guide • XML Library Tradeoff Analysis  Java Standard Compatibility  stability  performance  usability  Constraints • XML Library Analysis  Dependency  Experiment Program  Performance Test • XML Library Recommendation • XML Library Application Pilot Development  Define XML Handling Functionality  Design Architecture  Implement & Test • XML Library Impact Analysis  As-Is XML Library Usage & Libraries  Module impact analysis on Standard XML Libraries • XML Requirements Analysis  Use email inquiry for each custom function team  Gather XML requirements and adopted libraries • XML Candidate Library Research  Java standard API  XML libraries included in Java Runtime Environment(JRE)  Alternative XML libraries Approaches
  • 4. 7 12 13 14 15 18 19 20 21 22 25 26 27 28 1 요구사항 질의서 작성 및 요청 요구사항 질의서 수집 및 분석 Java 표준 API 및 JRE조사 대안 XML라이브러리 조사 분석 관점 정의 라이브러리 분석 라이브러리 테스트 라이브러리 선정 보고서 작성 XMLLibrary 표준 선정 보고 파일럿 요건 정의 파일럿 설계/구현 파일럿 테스트 Task Artifacts 2013.02 W1 W2 W3 XMLLibrary Evaluation XMLLibrary Application Method XML Requirements Analysis XMLRequirements Analysis XMLCandiate Library Research XMLLibrary 개발 가이드 D48 개발 가이드 XMLLibrary Tradeoff Analysis 평가 보고서 XMLLibrary Selection 보고서 3 Selection Progress 1. XML Library Selection Overview WBS & Progress Today
  • 5. 4 XML Requirements Analysis(1/2) 2. XML Requirements Analysis OOO Custom Application은 유사한 XML 처리 요구사항에 대해 서로 상이한 XML Library 및 버전을 적용하 고 있음 Application Requirements Libraries A Team • Xpath • XML Parser • Marshalling/unmarshalling • dom4j-1.6.1.jar • jaxen-1.1.4.jar • jaxb-impl-2.2.6 B Team • Xpath • XML Parser • SOAP • JAXP v.1.4 (J2SE 1.6) C Team • Marshalling/unmarshalling • XML Parser • SOAP • xalan 2.7.1 • xmlbeans 2.4.0, xbean_xpath 2.1.0 • xercesImpl 2.9.1 D Team • Xpath • XML Parser • SOAP • JAXP 1.4 (J2SE 1.6) • SAAJ 1.3 (J2SE 1.6) E Team • Websquare • marshalling, unmarshalling • XML Parser • SOAP • dom4j-1.6.1.jar / xalan-2.7.1.jar / xbean-2.1.jar / xbean_xpath-2.1.0.jar • xmlschema-core-2.0.1.jar / xalan-2.7.1.jar • spring-oxm.3.1.1 / xstream-1.3.1 F Team • Websquare • XML Parser • dom4j-1.6.1.jar / xalan-2.7.1.jar / xbean-2.1.jar / xbean_xpath-2.1.0.jar • dom4j-1.6.1.jar Custom Application XML Library 적용 현황 XML 기능 요구사항은 유사함 (Xpath, SOAP, Marshalling) 서로 상이한 XML Library 및 버전이 적용됨 (dom4j, jaxen, jaxb, j2se standard) * 상세 요구사항은 “#별첨.Custom Application XML Requirements Inquiry Result” 참조
  • 6. 5 XML Requirements Analysis(2/2) 2. XML Requirements Analysis Functional Requirements ID Use Case Use Case Description R001 XPath XPath 표현식 처리 기능을 제공해야 한다 R002 XML Parser XML Parsing을 위한 DOM/SAX/StAX 표준 기능을 제공해야 한다 R003 Marshalling / Unmarshalling XML과 Java Object 간 상호 변환 기능을 제공해야 한다 R004 SOAP Message Handling SOAP Message 처리 기능을 제공해야 한다 Constraints ID Constraints Description C001 Java 1.6.0 Custom Framework 기반 어플리케이션은 JVM 1.6.0 (1.6.0.27 버전)을 기반으로 한다 C002 Spring 3.1.1 Custom Framework 기반 어플리케이션은 Spring 3.1.1 라이브러리를 적용한다 C003 Framework 공통 라이브러리와 호환 WebSquare, Apache-CXF 등 Framework 공통 라이브러리가 의존하고 있는 XML 라이브러리와 상호 호환 되어야 한다 XML Requirements
  • 7. JSR 067JSR 222JSR 206 6 XML Candidate Library Research(1/4) 2. XML Requirements Analysis Java API for XML Processing (JAXP) Streaming API for XML (StAX) XSL Transformation (XSLT) XML Path Language (XPath) XML Inclusions (Xinclude) Document Object Model (DOM) Simple API for XML (SAX) ExtensibleMarkup Language(XML) Namespaces in XML XML Schema Java Architecture for XML Binding (JAXB) SOAP with Attach ments API for Java (SAAJ) Java Standard XML API & JRE Bundle Libraries JSRs(Java Specification Requests)은 XML을 위한 Java 표준 API를 정의하고 있으며, JRE는 표준 API에 대응 되는 Bundle 구현체를 제공함 Apache Xerces (com.sun.org.apache.xerces) Apache Xalan (com.sun.org.ap ache.xpath) Glassfish JAXB RI (com.sun.xml.inter nal.bind.v2) Glassfish SAAJ RI (com.sun.xml.inter nal.messaging) Java Standard API JRE Bundle Library org.w3c.dom org.xml.sax javax.xml.streamjavax.xml.xpath javax.xml.bind javax.xml.soap
  • 8. 7 XML Candidate Library Research(2/4) Library Description JAXP (Java API for XML Processing) • XML 처리를 위한 Java API로 XML 문서의 유효성 검증과 분석을 위한 인터페이스를 제공 • 분석 인터페이스로 DOM, SAX, StAX (JAXP 1.4 이후) 를 제공한다. • J2SE 1.4 이상은 JAXP를 포함하며, J2SE 5.0에서는 JAXP1.3, Java SE 6에서는 JAXP 1.4를 포함한다. DOM (Document Object Model) • 객체 지향 모델로써 구조화된 문서를 표현하는 형식으로 W3C 표준 • 문서 전체를 트리(Tree) 구조로 메모리로 읽어서 랜덤하게 접근이 가능하다 SAX (Simple API for XML) • 문서를 스트림으로 읽어 가면서 문서 항목 단위 이벤트가 발생하여 응용 프로그램에서 처리 • DOM에 비해 단순한 인터페이스를 갖고 있으며, 처리해야 할 파일이 많거나 큰 경우에 적합 • SAX는 파서에서 응용 프로그램으로 데이터를 보내는 방식(Push 방식) StAX (Streaming API for XML) • DOM과 방식의 중간 방식. JSR 173 표준 • 문서의 한 지점을 가리키는 커서가 있어 응용 프로그램은 필요에 따라 정보를 추출할 수 있음(Pull 방식) • Java SE 6.0이상에 포함됨 XPath (XML Path Language) • Java SE 5.0 DOM 방식 지원 JAXB (Java Architecture for XML Binding) • Java class와 XML 간 매핑을 지원. Java SE 6.0 이상에 포함됨. JSR 222 • Java 개체를 XML 로 변환하는 Marshal 기능과 XML 을 Java 개체로 변환하는 Unmarshal 기능을 제공 • Class 에 어노테이션(@XmlRootElement and @XmlElement 등)을 이용하여 마크업 정의 SAAJ (SOAP with Attachments API for Java) • SOAP 표준을 준수하는 메시지를 생성 및 처리를 지원. JSR 067 2. XML Requirements Analysis
  • 9. 8 XML Candidate Library Research(3/4) 2. XML Requirements Analysis XML Parser Comparison DOM, SAX, StAX 표준 중 성능에 유리한 StAX/SAX 사용을 기본적으로 권장하며, 복잡한 XML 조작이 필요하 거나 XML CRUD 처리가 필요한 경우에는 DOM 사용을 권고 Feature DOM (Document Object Model) SAX (Simple API for XML) StAX (Streaming API for XML) API 특징 In memory tree Push events, streaming Pull events, streaming 개발 용이성 High Medium Medium XPath 지원 Yes No No CPU/Memory High Low Low Read XML Yes Yes Yes Write XML Yes No Yes Create, Read, Update, Delete Yes No No 요약 • 성능 측면에서 불리 • 복잡한 XML 조작에 유리 • XML CRUD 처리 지원 • 성능 측면에서 우수 • 단순 XML 처리에 유리 • XML Read 처리 지원 • 성능 측면에서 유리 • 단순 XML 조작에 유리 • XML Read/Write 처리 지원 라이브러리 적용 Recommendation • DOM, SAX, StAX 표준 중 성능 및 편이성이 유리한 StAX/SAX를기본 사용 권장 • 단 복잡한 XML 조작이 필요하거나 XML CRUD 처리가 필요한 경우에는 DOM 사용
  • 10. 9 XML Candidate Library Research(4/4) 2. XML Requirements Analysis XML Candidate Libraries XML Candidate Library에는 JDK Default Bundle, Latest Bundle Library, Alternative Library 적용의 3가지 후보군이 있음 Java Standard Xpath (javax.xml.xpath) DOM (org.w3c.dom) SAX (org.xml.sax) StAX (javax.xml.stream) JAXB (javax.xml.bind) SAAJ (javax.xml.soap) Default JDK (1.6.0) Bundle  Xalan 2.6.0  XercesImpl 2.6.2  Jaxb-impl 2.1.10  SAAJ 1.3 Latest JDK (1.6.0) Bundle  Xalan 2.7.1  XercesImpl 2.11.0  Jaxb-impl 2.2.7  SAAJ 1.3.4 Alternative Library* (Applied)  Jaxen 1.1.4  xmlbeans_xpath 2.6.0  Dom4j 1.6.1  xmlbeans 2.4.0  Dom4j 1.6.1  xmlbeans 2.4.0 Alternative Library*  xstream 1.4.4  Woodstox 4.1.3  xstream 1.4.4  JiBX 1.2.4  Castor 1.3.2  Green : 표준 API 지원  Red: 표준 API 미지원Tradeoff 분석 범위* 상세 의존관계 분석은 “#별첨.XML Candidate Library Dependency” 참조
  • 11. 10 XML Library Recommendation 3. XML Library Evaluation XML Library Evaluation Summary XML Library 리서치 및 성능 테스트를 통해 검증한 결과, JDK Bundle Library로 선정된 오픈 소스가 JSR 표준 을 준수하고 성능이 우수한 것으로 평가됨. 단, Xpath는 Alternative Library에 비해 성능이 낮음 * Library Version은 패키지 라이브러리와의 호환성을 위해 조정 가능함 XML Requirements XML Library Candidate Recommendation*Default JDK Bundle Library Latest JDK Bundle Library Alternative Library XPath Xalan 2.6.0 Xalan 2.7.1 Jaxen 1.1.4 Jaxen 1.1.4 XML Parser XercesImpl 2.6.2 XercesImpl 2.11.0 Dom4j 1.6.1 XercesImpl 2.11.0 Marshalling / Unmarshalling Jaxb-impl 2.1.10 Jaxb-impl 2.2.7 xmlbeans 2.4.0 Jaxb-impl 2.2.7 SOAP Message Handling Saaj-impl 1.3 Saaj-impl 1.3 Saaj-impl 1.3.4
  • 12. 11 XML Library Tradeoff Analysis: XPath(1/2) 3. XML Library Evaluation 분석 관점 JDK Bundle Library Alternative Library 1안. Default Xalan 2안. Latest Xalan 3안. Jaxen** Java 표준 준수 (Java Standard Compatibility) (+) javax.xml.xpath 인터페이스 지원 (+) javax.xml.xpath 인터페이스 지원 (-) javax.xml.xpath 인터페이스 미지원 안정성 (Library stability)  최신 패치 반영  적용 레퍼런스  커뮤니티 활동 (-) Xalan-Java 2.6.0 버전 이후 버그 패치를 반영하지 않음 (+) JDK, Xerces 외 다수 오픈 소스 참조 (+) 지속적 패치 활동 (+) 최신 버전을 사용하므로 버그 패치가 모두 반영됨 (+) JDK, Xerces 외 다수 오픈 소스 참조 (+) 지속적 패치 활동 (+) 최신 버전을 사용하므로 버그 패치가 모두 반영됨 (+) dom4j 외 다수 오픈 소스 참조 (+) 지속적 패치 활동 성능 (Library performance) (-) Jaxen 비교 성능 미흡  Xpath 성능 튜닝 가이드* 검토 (-) Jaxen 비교 성능 미흡  Xpath 성능 튜닝 가이드* 검토 (+) Xalan 비교 성능 우수  Xalan 비교 60배 이상 사용 편의성 (+) xpath 1.0 지원 (+) API 타 라이브러리와 유사 (+) xpath 1.0 지원 (+) API 타 라이브러리와 유사 (+) xpath 1.0 지원 (+) API 타 라이브러리와 유사 제약사항 • Xercers Dependency • Xercers Dependency • Dom4j Dependency Summary • JAXP 표준 준수 • 패치 반영 미흡 • 성능 미흡(검토 필요) • JAXP 표준 준수 • 최신 패치 반영 • 성능 미흡(검토 필요) • JAXP 표준 미지원 • 다수의 오픈 소스 참조 • 성능 우수 Decision • Jaxen 최종 권고 (상세 성능 비교는 다음 페이지 참조)  Jaxen 700KB 이상의 XML 파일 처리 시 고른 성능 안정성 및 10배 이상의 성능 차이를 보임  XPath 표준 API 대신 Jaxen API 도입 * Xpath 성능 튜닝 가이드 : 10~20% 성능 개선 효과는 있으나, Jaxen과 비교 시 10배 이상의 성능 갭을 줄이지는 못함 ** Jaxen 적용 사례는 “#Appendix. Artifacts used Jaxen library” 참조
  • 13. 12 XML Library Tradeoff Analysis: XPath(2/2) 3. XML Library Evaluation Xalan Performance File size 8170KB 1600KB 779KB 74KB 8KB 1KB # of Records 10000 2000 1000 100 10 1 Xpath /*/*/Attr1x1 4 1 1 0.5 0.36 0.25 /*/*/Attr1x5000 409 126 43 1.2 0.41 0.27 /*/*/Attr1x9999 897 97 28 2.7 0.66 0.26 XpathNodes /*/*/Attr1x1 866 62 27 2.1 0.44 0.27 /*/*/Attr1x5000 860 136 41 2.1 0.52 0.31 /*/*/Attr1x9999 851 151 119 3 0.42 0.24 /*/Item 851 85.6 25 2 0.42 0.24 Jaxen Performance File size 8170KB 1600KB 779KB 74KB 8KB 1KB # of Records 10000 2000 1000 100 10 1 Xpath /*/*/Attr1x1 74 5 1 1 0 0 /*/*/Attr1x5000 16 4 1 1 0 0 /*/*/Attr1x9999 15 4 1 0 0 0 XpathNodes /*/*/Attr1x1 15 4 0.7 0.6 0.01 0.01 /*/*/Attr1x5000 16 4 1 1 0.02 0.01 /*/*/Attr1x9999 15 4 1 0.6 0.02 1 /*/Item 1367 62 16.3 14.3 0.02 0.01 Jaxen은 개별 Node 검색에 있어 안정된 성능을 제공하며, 779KB 이상 구간에서 Xalan에 비해 15~119 배 이 상의 성능 차이를 보임. 단, Xalan은 First node 검색 및 전체 Node 추출 시 부분적으로 Jaxen 보다 높은 성능을 보임 단위: ms 단위: ms
  • 14. 13 XML Library Tradeoff Analysis: XML Parser(1/3) 3. XML Library Evaluation 분석 관점 JDK Bundle Library Alternative Library 1안. Default Xerces 2안. Latest Xerces 3안. Dom4j 1.6.1 Java 표준 준수 (Java Standard Compatibility) (+) JAXP 인터페이스 지원 (+) JAXP 인터페이스 지원 (-) JAXP 인터페이스 미지원 안정성 (Library stability)  최신 패치 반영  적용 레퍼런스  커뮤니티 활동 (-) xercesImpl 2.6.2 버전 이후 버그 패치를 반영하지 않음 (+) JDK, Jdom, Hudson 외 다수 오픈 소스 참조 (+) 지속적 패치 활동 (+) 최신 버전을 사용하므로 버그 패치가 모두 반영됨 (+) JDK, Jdom, Hudson 외 다수 오픈 소스 참조 (+) 지속적 패치 활동 (+) 최신 버전을 사용하므로 버그 패치가 모두 반영됨 (+) Hibernate, jboss, POI 외 다수 오픈 소스 참조 (+) 지속적 패치 활동 성능 (Library perf. & Memory) (+) Dom4j 비교 DOM/SAX/ StAX 성능 우위 (+) 효율적 메모리 사용 우위 (+) Dom4j 비교 DOM/SAX/ StAX 성능 우위 (+) 효율적 메모리 사용 우위 (-) Xerces 비교 DOM/SAX/ StAX 성능 낮음 (-) 효율적 메모리 사용 열위 사용 편의성 (-) DOM/SAX/StAX Parser 별 고유 API를 이용한 어플리케이션 개발 (-) DOM/SAX/StAX Parser 별 고유 API를 이용한 어플리케이션 개발 (+) DOM/SAX/StAX Parser에 독립된 dom4j.Document API를 이용한 개발 제약사항 • xml-api.jar(JAXP) 표준 의존 • xml-api.jar(JAXP) 표준 의존 • Jaxen Dependency Summary • JAXP 표준 준수 • 패치 반영 미흡 • 성능 우수 • 사용 편의성이 낮음 • JAXP 표준 준수 • 최신 패치 반영 • 성능 우수 • 사용 편의성이 낮음 • JAXP 표준 미지원. • 다수의 오픈 소스 참조 • 성능 낮음 • 사용 편의성이 좋음 Decision • 2안 Latest Xerces 안을 권고  JAXP 표준 API를 준수함  Dom4j 비교 시 근소한 성능 우위를 제공 (상세 성능 비교는 다음 페이지 참조)  사용 편의성은 낮으나, XML 접근 라이브러리는 공통 코드로 개발되므로 개발 생산성에 영향 요소가 낮음
  • 15. 14 XML Library Tradeoff Analysis: XML Parser(2/3) 3. XML Library Evaluation Xerces Performance: Using DOM File size 8170KB 1600KB 779KB 74KB 8KB 1KB # of Records 10000 2000 1000 100 10 1 Creation 318 26 14 1 0.1 0 Write 436 72 34 4 0 0 Parsing 1444 164 65 15 1.26 0.81 Transform 2571 320 125 6.1 1 1 Dom4j Performance: Using SAX* Xerces는 779KB 이상 구간에서 Dom4j에 비해 1~2배 수준의 성능 우위를 보임 단위: ms 단위: ms File size 8170KB 1600KB 779KB 74KB 8KB 1KB # of Records 10000 2000 1000 100 10 1 Creation 565 24 102 10 0.06 0.01 Write 732 113 819 56 1 1 Parsing 1650 480 96.7 6.6 1.46 0.93 Transform 3020 332 142 134 1 0 * Dom4j는 SAX를 기반으로 DOM CRUD 기능을 제공함. W3C Dom을 읽을 수 있는 Dom 구현체는 제공하지 않으며, W3C Dom과 Dom4j Dom 개체간 변환을 위한 DomReader/DomWriter를 제공함 (DomReader/Writer를 이용한 성능 비교는 다음 페이지를 참조)
  • 16. 15 XML Library Tradeoff Analysis: XML Parser(3/3) 3. XML Library Evaluation Xerces는 779KB 이상 구간에서 DOM, SAX, StAX 각각 1.5~1.7배, 1.1 ~ 3.9배, 2.8~5.5배 성능 우위를 보이 며, 1.4 ~ 1.5배, 5.1~7.0배, 1.5 ~ 3.1 배의 메모리 효율성 우위를 보임 Xerces (Parsing Only) Performance File size 8084KB 1600KB 789KB 78KB 8KB # of Records 100000 20000 10000 1000 100 Time DOM 956 81 38 5 2 SAX 398 36 34 3 2 StAX 365 51 16 2 1 Memory DOM 93 19 9 1 0.1 SAX 13 2 1 0.1 0.1 StAX 14 4 2 0.3 0.1 단위: ms, MBytes Dom4j (Parsing Only) Performance 단위: ms, MBytes File size 8084KB 1600KB 789KB 78KB 8KB # of Records 100000 20000 10000 1000 100 Time DOM 1669 121 58 7 2 SAX 935 141 36 5 2 StAX 1092 144 88 5 1 Memory DOM 127 28 13 1 1 SAX 66 14 7 0.4 0.4 StAX 44 9 3 1 0.4
  • 17. 16 XML Library Tradeoff Analysis: JAXB(1/2) 3. XML Library Evaluation 분석 관점 JDK Bundle Library Alternative Library 1안. Default JAXB 2안. Latest JAXB 3안 xmlbeans 2.4.0 Java 표준 준수 (Java Standard Compatibility) (+) JAXB 표준 호환성 지원 (+) JAXB 표준 호환성 지원 (-) JAXB 표준 호환성 미지원 안정성 (Library stability)  최신 패치 반영  적용 레퍼런스  커뮤니티 활동 (-) JAXB 2.1.10 버전 이후 버그 패치를 반영하지 않음 (+) JDK, Metro 외 다수 오픈 소스 참조 (+) 지속적 패치 활동 (+) 최신 버전을 사용하므로 버그 패치가 모두 반영됨 (+) JDK, Metro 외 다수 오픈 소스 참조 (+) 지속적 패치 활동 (+) 최신 버전을 사용하므로 버그 패치가 모두 반영됨 (-) CXF 외 일부 오픈 소스 적용 (+) 지속적 패치 활동 성능 (Library performance) (+) xmlbeans 비교 결과 marshalling / unmarshalling 모두에서 성능 우위 (+) 효율적 메모리 사용 우위 (+) xmlbeans 비교 결과 marshalling / unmarshalling 모두에서 성능 우위 (+) 효율적 메모리 사용 우위 (-) jaxb-impl 비교 marshalling / unmarshalling 모두에서 성능 저조 (-) 효율적 메모리 사용 열위 사용 편의성 (+) 어노테이션 기반의 설정 지원 (+) XML to Java 변환 소스의 복잡도 낮음(POJO 개체 생성, 어노테이션 기반으로 직접 변경 가능) (+) 어노테이션 기반의 설정 지원 (+) XML to Java 변환 소스의 복잡도 낮음(POJO 개체 생성, 어노테이션 기반으로 직접 변경 가능) (-) 어노테이션 기반 설정 미지원 (-) XML to Java 변환 소스의 복잡도 높음(인터페이스/구현체 구분, XMLBeans 의존성 라이브러리 포함) 제약사항 • jaxb-impl.jar(JAXB) 표준 의존 • jaxb-impl.jar(JAXB) 표준 의존 • xben_xpath Dependency Summary • JAXP 표준 준수 • 패치 반영 미흡 • 성능 우수 • 사용 편의성이 높음 • JAXP 표준 준수 • 최신 패치 반영 • 성능 우수 • 사용 편의성이 높음 • JAXP 표준 미지원 • 소수의 오픈 소스 참조 • 성능 우수 Decision • 2안 Latest JAXB 안을 권고  JAXB 표준 API를 준수함  XMLBeans 비교 시 성능 우위 및 사용 편의성을 제공 (상세 성능 비교는 다음 페이지 참조)
  • 18. 17 XML Library Tradeoff Analysis: JAXB(2/2) 3. XML Library Evaluation JAXB-impl Performance: File size 8084KB 1600KB 789KB 78KB 8KB # of Records 100000 20000 10000 1000 100 Time Marshalling 431 67 43 7 3 Unmarshalling 356 77 45 7 4 Memory Marshalling 12 5 2 0.4 0.4 Unmarshalling 9 2 1 0.4 0.4 Xmlbeans Performance: Jaxb는 779KB 이상 구간에서 0.7 ~ 3.1 배의 성능 우위 및 2.0 ~ 5.5배 메모리 효율성 우위를 보임 단위: ms, MBytes File size 8084KB 1600KB 789KB 78KB 8KB # of Records 100000 20000 10000 1000 100 Time Marshalling 1195 210 88 10 2 Unmarshalling 251 45 30 3 1 Memory Marshalling 49 10 11 1.4 0.4 Unmarshalling 21 6 3 0.4 0 단위: ms, MBytes
  • 19. 18 XML Library Use Cases 4. XML Library Application Guide Functional Requirements ID Use Case Use Case Description R001 Node fetch from large XML file XML Document 의 특정 노드를 Xpath 표현식을 이용하여 패치한다 R002 Node addition to XML file XML Document 에 Node를 추가/변경한다 R003* Security masking XML의 지정 엘리먼트의 Value 값을 Masking한다 R004* Security encryption/decryption XML의 지정 엘리먼트의 Value 값을 Encryption/Decryption한다 XML Requirements * 파일럿 개발 범위에는 포함되지 않음
  • 20. 19 XML Library Impact Analysis Summary 4. XML Library Application Guide B, D, F Team은 JAXP Xpath, Dom4j 라이브러리를 Class 내부에서만 사용하므로 변경에 대한 영향도가 낮으 나, A Team은 Class 외부에서 Dom4j 모듈을 사용하므로 변경에 따른 영향도가 높음 Impact Analysis Summary Application Change Item Change Impact Change Description A Team • Dom4j 라이브러리를 JAXP API 로 변경 High • All variable & method dependent Sources B Team • JAXP XPath 라이브러리를 Jaxen 으로 변경 Low • Method internal change only C Team • XML Library를 적용한 Application 모듈이 없음 None D Team • JAXP XPath 라이브러리를 Jaxen 으로 변경 Low • Method internal change only E Team • XML Library를 적용한 Application 모듈이 없음 None F Team • Dom4j 라이브러리를 JAXP API 로 변경 Low • Method internal change only
  • 21. 20 XML Library Impact Analysis(1/4) 4. XML Library Application Guide A Team의 Dom4j 의존성을 JAXP 표준 API로 변경이 필요함. XML Handling Library는 모듈화 되어 있으나, Dom4j Document 변수의 public 사용 및 method 결과값에 Dom4j 개체가 포함되어 있어 모듈의 변경 영향 도는 높음 Library Requirements As-Is Libraries To-Be Libraries Impact • Xpath • jaxen-1.1.4.jar • Jaxen 1.1.4 • 소스 변경 영향 없음 • XML Parser • dom4j-1.6.1.jar • xercesImpl 2.11.0 • Dom4j 라이브러리를 JAXP API 로 변경 • Marshalling/unmarshalling • jaxb-impl-2.2.6 • spring-oxm • Jaxb-impl 2.2.7 • spring-oxm • 소스 변경 영향 없음 Impact Analysis : Middlezone Source Method XML Functionality Change Item Change Impact • BaseBuilder.java • getPvsOrdLineListByFIC(..) • Dom4j Document에서 Xpath.에 해당하는 Node 검색 • public 변수로 정의한 Dom4j Document 를 JAXP Documents로 변경 • High: All variable dependent Sources • getSingleNodeContent(..) • Xpath에 해당하는 단일 Node 검색 • getMultiNodeContent(..) • Xpath에 해당하는 복수 Node 검색 • EbmConverter.java • fromMessage(..) • JMX message를 Unmarshall ing • JMX message를 Dom4j Document로 변환 (Map에 저장하여 변환) • Dom4j Document 를 JAXP Documents로 변경 • High: All method dependent sources
  • 22. 21 XML Library Impact Analysis(2/4) 4. XML Library Application Guide B Team의 JAXP XPath 의존성을 Jaxen API로 변경이 필요함. Method 내부에서 JAXP 및 XML Parser API가 사용되고 있어 모듈 변경 영향도는 낮음 Library Requirements As-Is Libraries To-Be Libraries Impact • Xpath • JAXP v.1.4 (J2SE 1.6) • Jaxen 1.1.4 • JAXP XPath 라이브러리를 Jaxen 으로 변경 • XML Parser • JAXP v.1.4 (J2SE 1.6) • xercesImpl 2.11.0 • 소스 변경 영향 없음 • Marshalling/unmarshalling • JAXB v.2.2 (J2SE 1.6) • Jaxb-impl 2.2.7 • 소스 변경 영향 없음 • SOAP • SAAJ v.1.3 (J2SE 1.6) • Saaj-impl 1.3.4 • 소스 변경 영향 없음 Impact Analysis : PRM Source Method XML Functionality Change Item Change Impact • XPathInteceptor.java • getXpathValue(..) • 입력받은 XML String에서 XPath에 해당하는 Node를 검색 • JAXP XPath 를 Jaxen XPath 로 변경 • Low: Method internal change only • Apache CXF - - • Jaxb-impl 및 saaj-impl 의존성으로 변경사항 없음 • 소스 변경 영향 없음
  • 23. 22 XML Library Impact Analysis(3/4) 4. XML Library Application Guide D Team의 JAXP XPath 의존성을 Jaxen API로 변경이 필요함. Method 내부에서 JAXP 및 XML Parser API가 사용되고 있어 모듈 변경 영향도는 낮음 Library Requirements As-Is Libraries To-Be Libraries Impact • Xpath • JAXP v.1.4 (J2SE 1.6) • Jaxen 1.1.4 • JAXP XPath 라이브러리를 Jaxen 으로 변경 • XML Parser • JAXP v.1.4 (J2SE 1.6) • xercesImpl 2.11.0 • 소스 변경 영향 없음 • Marshalling/unmarshalling • JAXB v.2.2 (J2SE 1.6) • Jaxb-impl 2.2.7 • 소스 변경 영향 없음 • SOAP • SAAJ v.1.3 (J2SE 1.6) • Saaj-impl 1.3.4 • 소스 변경 영향 없음 Impact Analysis : SOMM-ext (1/2) Source Method XML Functionality Change Item Change Impact • ProcessXML.java • getNodeValue(..) • 입력받은 XML String에서 XPath에 해당하는 Node를 검색 • JAXP XPath 를 Jaxen XPath 로 변경 • Low: Method internal change only • updateNode(..) • 입력받은 XML String에서 XPath에 해당하는 Node를 검색 후 해당 Value를 업데이트함 (DOMSource를 리턴함) • JAXP XPath 를 Jaxen XPath 로 변경 • Low: Method internal change only • getDOMSource(..) • 입력받은 XML String을 DOMSource로 변환함 • 변경 사항 없음 • 변경사항 없음 • getMessageXML(..) • 입력받은 XML String에서 XPath에 해당하는 Node를 검색 • JAXP XPath 를 Jaxen XPath 로 변경 • Low: Method internal change only
  • 24. 23 XML Library Impact Analysis(3/4) 4. XML Library Application Guide Impact Analysis : D Team (2/2) Source Method XML Functionality Change Item Change Impact • OsmXMLAPI.java • addWSSecurityHeader(..) • 입력받은 SOAPMessage에 SOAPHeader 정보를 추가/저정함 • 변경 사항 없음 • 변경사항 없음 • FalloutActionServiceI mpl.java • closeOrder(..) • SOAP Message 요청 및 SOAP Message 응답 처리 • 변경 사항 없음 • 변경사항 없음• retryTaskIfFSContinue(..) • updateFalloutDetail(..)
  • 25. 24 XML Library Impact Analysis(4/4) 4. XML Library Application Guide F Team의 Dom4j 의존성을 JAXP API로 변경이 필요함. Method 내부에서 Dom4j API가 사용되고 있어 모듈 변경 영향도는 낮음 Library Requirements As-Is Libraries To-Be Libraries Impact • XML Parser • dom4j-1.6.1.jar • xercesImpl 2.11.0 • Dom4j 라이브러리를 JAXP API 로 변경 Impact Analysis : F Team Source Method XML Functionality Change Item Change Impact • MenuCreateXMLData ServiceImpl.java • selectListMenuCreateXMLData( ..) • 입력받은 사용자에 해당하는 메뉴 목록을 XML Snipplet로 생성하여 String으로 리턴함 • Dom4j API를 JAXP API로 변경 • Low: Method internal change only • CallBSSWebservice.jav a • processResubmit(..) • 입력받은 payload String을 XML 로 변환하여 URLConnection에 요청함 • Dom4j API를 JAXP API로 변경 • Low: Method internal change only • EGIRetryServiceImpl.j ava • getISStream(..) • 입력받은 element String을 XML로 변환 후 EAI_CDATE 노드 값을 변환하여 URLConnection에 요청함 • Dom4j API를 JAXP API로 변경 • Low: Method internal change only • getOSStream(..)
  • 26. Application (Websquare Independent) JVM 1.6 Custom Framework Xalan 2.6.0 Bundle (JAXP XPath) XercesImpl 2.6.2 Bundle (JAXP) jaxb-impl 2.1.10 Bundle (JAXB) saaj-impl 1.3 Bundle (SAAJ) Jaxen 1.1.4 XercesImpl 2.11.0 (JAXP) jaxb-impl 2.2.7 (JAXB) saaj-impl 1.3.4 (SAAJ) Websquare Xalan 2.7.0 (JAXP XPath) XercesImpl 2.7.1 (JAXP) xmlbeans-2.4.0 Xbean_xpath 2.5.0 XPath Client XML Parser Client JAXB Client SOAP Client 25 XML Library Application 4. XML Library Application Guide Standard XML Library를 현 Custom Framework에 적용할 경우, Websquare의 JAXP 모듈의 버전 Conflict 해결이 필요하며, 그 외 모듈간의 Conflict 문제는 없음 XML Library Application Module JDK Module Override Module Conflict Module dependency
  • 27. 26 • Custom Application XML Requirements Inquiry Result • XML Candidate Library Dependency • Artifacts used Jaxen library • Performance Test Source Code # Appendix
  • 28. Custom Application XML Requirements Inquiry Result(1/2) 27 Question A Team B Team C Team 적용 Library • jdom4j-1.6.1.jar • jaxen-1.1.4.jar • jaxb-impl-2.2.6 • JAXP v.1.4 (J2SE 1.6) / • jaxb-impl-2.1.13 • xalan 2.7.1 • xmlbeans 2.4.0, xbean_xpath 2.1.0 • xercesImpl 2.9.1 주요 기능 • Marshalling/unmarshalling • XPath • webService의 Interceptor 에서 특정 데이터 추출 / WSDL, WebService 데이터 바인딩 • 해당 사항 없음 선정 기준 • 성능 및 개발 편의성 • Java 기본 구성 / • Spring-cxf 의 기본 구성 • 해당 사항 없음 XML 파일 Size • 테스트 대상 파일 110KB ~ 170KB • 평균 6KB, 최대 60KB • 해당 사항 없음 동시 처리 건 수 • Peak time 1500 TPS (2대, Instance 4대) • Parser 기준 요구 TPS: 100 TPS • 개발환경 14 TPS • 해당 사항 없음 추가 요구사항 • XML Parser 변경 시 개발 일정 영향 (2월 말 완료 예정) • 다양한 데이터를 처리하기 위해 Element 및 parsing 룰을 DB에서 관리하도록 구성해야 됨 • 해당 사항 없음 소스 파일 CXF 프레임워 크에서 처리, 소스 없음 # Appendix
  • 29. Custom Application XML Requirements Inquiry Result(2/2) 28 Question D Team E Team F Team 적용 Library • JAXP v.1.4 (J2SE 1.6) (1) Websquare • dom4j-1.6.1.jar • xalan-2.7.1.jar • xbean-2.1.jar • xbean_xpath-2.1.0.jar • xml-apis-2.0.2.jar • xmlbeans-2.4.0.jar • xmlbeans-qname-2.4.0.jar • xmlbeans-xmlpublic-2.4.0.jar Websquare • xalan.jar • xbean.jar • xbean_xpath.jar • xercesImpl.jar • xml-apis.jar • xmlbeans-2.3.0.jar • xmlbeans-qname.jar • xmlpublic.jar 주요 기능 • XQuery 를 이용하여 XML Node, XML Data getting or Update • SOAP Message Handling • websquare, marshalling, webservice Websquare • Excel Handling GEMMS • XML Parser 선정 기준 • 범용적인 라이브러리 • (1) WebSquare: 의존 라이브러리 • (2) XStreamMarshallerXPath: 포팅되어있으나,미사용 • (3) Service Expose: Apache-cxf 의존 라이브러리 • Websquare default. No specific reason XML 파일 Size • Max 1MB 내외 • 현재 JSON Parser를 사용하기 때문에 해당 없음 • Websquare: Excel average=200KB; maximum 1MB • GEMMS: average=5 maximum=50 동시 처리 건 수 • 1 건 (Queue Data 사용) • 현재 JSON Parser를 사용하기 때문에 해당 없음 • estimated average=5 maximum=50 추가 요구사항 • 없음 • 없음 • 9월 오픈 대비, 개발 Freeze 가 3월에 예정 중. 변경 시 시간 및 버퍼 필요 소스 파일 N/A GEMMS Direct • dom4j-1.6.1.jar (2) XStreamMarshaller • spring-oxm.3.1.1 • xstream-1.3.1 (3) Service Exposer • xmlschema-core-2.0.1.jar • xalan-2.7.1.jar # Appendix
  • 30. 29 XML Candidate Library Dependency XML Candidate Library Dependency XML Candidate Library 간의 Dependency 관계는 다음과 같이 정의됨 xalan 2.7.1 xercesImpl 2.10.0 dom4j 1.6.1 xmlbeans_xpath 2.6.0 xml-apis-1.4.01 StAXXPath DOM SAX xstream 1.4.4 jaxen 1.1.4 xmlbeans 2.4.0 jaxb-impl 2.2.7-b56 saaj-impl 1.3.20 jaxb-api 2.2.7 JAXB saaj-api 1.3.4 SAAJ compile provided Jar Package stax-api 1.0.1 StAX JSR APIwoodstox-core-asl 4.1.4 stax2-api 3.1.1 Jar Package (Implement Standard API) cxf-rt-bindings-soap 2.7.3 # Appendix
  • 31. 30 Artifacts used Jaxen library # Appendix Artifacts Description jdom2 Java-based solution for accessing, manipulating, and outputting XML data from Java code Eclipse hudson-core Hudson Continuous Integration Server PMD Source code analyzer XOM tree-based API for processing XML with Java that strives for correctness, simplicity, and performance Dom4j easy to use, open source library for working with XML, XPath and XSLT on the Java platform using the Java Collections Framework and with full support for DOM, SAX and JAX scales-jaxen flexible approach to XML handling and a simplified way of interacting with XML Mojo chronos Maven plugin for performance testing in continuous integration(CI) environment Icesoap Quick, easy, asynchronous access to SOAP web services from Android devices Fcrepo-server Fedora Commons Repository Service JOnAS Java EE 5 certified Open Source OSGi Enterprise Server Zimbra Email Messaging and Collaboration for the Post-PC Era Petals open-source Enterprise Service Bus (ESB) provided by the OW2 Middleware Consortium
  • 32. 31 Performance Test Source Code #.Appendix XPath/Parser Performance Test Environment  Windows7 Enterprise  Intel® Core™ i5 CPU M560 @2.67GHz  4GB RAM Xerces Parser (Parsing Only) Performance Input data generator Dom4j Parser (Parsing Only) Performance  jaxb-impl-2.2.7-b56 Generated XML Source Jaxb Parser (Parsing Only) Performance XMLBeans Xml 2 Java Conversion Common

Editor's Notes

  1. Apache-CXF (IBM SOAP4J 의존성)
  2. Apache CXF depends on Xalan-Java Search Keyword: dom4j "org.xml.sax" import test