SlideShare a Scribd company logo
Oct 28, 2017
Ville Misaki
System Strategy Department,
Rakuten Card Co., Ltd.
2
 Ville Misaki
 Senior Software Engineer
 Technology Strategy Group,
System Strategy Department,
Rakuten Card Co., Ltd
 Career
 15+ years; 3 years at Rakuten
 In Finland, the Netherlands, Japan
 Java (EE), Perl, C++, web systems, relational
databases, performance optimization & security
3
 Oracle OpenWorld 2017
 Case Study: Credit Card Core System
with Exalogic, Exadata, Oracle Cloud
Machine (CON4994) => Link
 JavaOne 2017
 Java EE 7 with Apache Spark for the
World’s Largest Credit Card Core
Systems (CON4998) => Link
4
Part 1 – Perfect Design
1. About Rakuten Card
2. Background
3. Platform Migration
4. Data Migration
5. Software Migration
Part 2 – Harsh Reliability
6. Performance
7. Apache Spark
8. Judgement Day
9. Into the Future
5
6
Unified brand, ecosystems around the world.
7
 Top-level credit card
company in Japan
 Core of Rakuten eco
systems.
 3rd position of total
transaction volume in 2016.
Growing rapidly.
8
9
Core Systems
Web Systems
External Systems
Intra Systems
10
Mainframe
 Old architecture – >20 years
 High cost
 Limited capacity and
performance
 Low maintainability
 Vendor locked-in
 Limited security
 For more details, check session
“From Mainframe to Java EE” at
16:00 today
11
Phase of the improvement – 3.0
1.0
Initial phase
2.0 In-house
development
3.0
Standardization
Outsource based,
just started.
Vendor locked-in.
In-house
development,
differentiate with
lower costs and
faster delivery.
Standardized
system
architecture, both
for hardware and
software.
Achieved
Current Standard
Architecture
12
13
Oracle Exalogic
+ Exadata + ZFS Servers
Mainframe
Old New
Core
Systems
14
 Financial de-facto standard
 Java EE compliant.
 Matured, from 1997.
 Financial de-facto standard
 ISO/IEC 9075 SQL compliant
 Matured, from 1983.
COBOL
Network
DB
App Server
Database
Old New
WebLogic Server
Oracle Database
15
16
ISAM
VSAM
NDB Oracle Database
Copy & Convert
17
 Data Conversion
 Network database to relational database
 ISAM/VSAM data to relational database
 Legacy Japanese character set to Unicode
 Fix data inconsistencies
 Scale
 Terabytes of live production data
 Less than 24 hours time
18
 Offline migration
 Freeze data during migration
 Full migration – not incremental
 Customers mostly unaffected
 Data & System migration
 At the same time
 Cannot be split into phases
Cached
19
ISAM
VSAM
NDB Oracle DatabaseISAM
VSAM
NDB
Mirror
Copy & Convert
Replication
20
21
Req.
Source
code
Appliction
Platform
Hardware
Reimplement
Convert
Emulate
22
Reimplement Emulate Convert
Pro
• Optimal performance
• Low maintenance cost
• Development unchanged
• Easy to test
• Easy to migrate
• Flexible cost vs. schedule
• Case-by-case fixes
• Easy to test
Con
• Expensive
• Takes a long time
• Risky
• Difficult to test
• Development unchanged
• Low performance
• Future questionable
• Legacy code remains
• Low performance points
need to be addressed
Requirements?
23
Reimplement Emulate Convert
Pro
• Optimal performance
• Low maintenance cost
• Development unchanged
• Easy to test
• Easy to migrate
• Flexible cost vs. schedule
• Case-by-case fixes
• Easy to test
Con
• Expensive
• Takes a long time
• Risky
• Difficult migration
• Development unchanged
• Low performance
• Future questionable
• Legacy code remains
• Low performance points
need to be addressed
2x Performance No regression Minimal downtime
24
Reimplement Emulate Convert
Pro
• Optimal performance
• Low maintenance cost
• Development unchanged
• Easy to test
• Easy to migrate
• Flexible cost vs. schedule
• Case-by-case fixes
• Easy to test
Con
• Expensive
• Takes a long time
• Risky
• Difficult migration
• Development unchanged
• Low performance
• Future questionable
• Legacy code remains
• Low performance points
need to be addressed
2x Performance No regression Minimal downtime
25
Japanese COBOL
Source code
Java Source code
Customized
source code
converter
 Convert from Japanese
COBOL to Java EE
 Keep original core
business logic
26
Java
From Web Systems,
For New Logic
COBOL
From Old System,
converted to Java
 Ease of migration, resource re-use
 Introduce power of Java EE
 Introduce converter from YPS to Java
“Dual Source Architecture”
Japanese
COBOL
 Japanese source code
 Almost abandoned
 No books, no community
Old New
27
New Logic
(Java EE)
Application Server
(Java EE)
Legacy Logic
(Mainframe)
Build
Deploy
Japanese
COBOL
Convert to
COBOL
Convert
to Java
COBOL
Java
Compile
WAR
Converter
 Two sources,
single binary
 Easy to operate
Java
Byte Code
Compile
Java
28
BIG-IP
Real-time Servers
(WebLogic)
Batch Servers
(Spark & Java)
Façade
Rich clients Façade
Façade
Intranet
External
Intra
Exadata
Mail
Form
BIG-IP
Façade
BIG-IP
External
customers
Scheduler
CoreBusinessLogicAPIs
Operation
terminal
Web
browser
Old New
29
Part 1 – Perfect Design
1. About Rakuten Card
2. Background
3. Platform Migration
4. Data Migration
5. Software Migration
Part 2 – Harsh Reliability
6. Performance
7. Apache Spark
8. Judgement Day
9. Into the Future
30
31
vs.
32
vs.
33
Start
Slow
Slow
 Batches are run as networks
 Hierarchical
 Critical path
 Time window
34
 Automatic code conversion
 COBOL program flow emulated in Java
 COBOL-like data structures in Java
 DB access logic
 Business logic built on network DB
 NDB and RDB are good at different tasks
35
 COBOL vs. Java
 Goto statement – imitation is complex
 Sub-program calls – heavy
 No local variables – tight coupling
 No libraries – copy&paste code
 Few shared data structures – copy&paste definition
 No shared enum/constant – magic numbers
36
 COBOL data structures
 Fixed length – hard-coded
 String-based
 Data block inside program
 Often thousands of fields
 Hierarchical fields
 Content is joined/split automatically
 Variable namespace under each parent
 Even five levels deep
37
38
 Logic optimized for NDB
 Read sequentially
 Data pre-sorted
 Data pre-formatted
 Emulate in RDB
 Uphill battle
NDB RDB
Search Slow Fast
Sequential Access Fast Slow
Sorting Slow Fast
Formatting Fast Slow
39
 New system must be faster
 Time until launch:
1 year
40
 Options?
 Redesign and re-implement from scratch
 Not feasible
 Optimize framework
 Limited effectiveness
 Parallelize batches
 Elastic brute-force
41
42
Time
Sequential
Parallel
43
Cluster Node
Cluster Node
Cluster Node
Cluster Node
Cluster Node
Bootstrap
Scheduler
Cluster Node
SharedMemory
44
1. Making business logic parallel
 Independent processing
2. I/O
 Data transferred over network
3. Data ordering
 Shuffles
45
 Problem: input data rows are not independent!
 Red flags
 Fields not initialized for each row
 Code forks early (header & data?)
 Legacy code analysis
 Refactor
 Fields to local variables
 Extract data structures
 Initialize data for each row
 Run & see
321
3
2
1 Reference?
46
1. Group related rows together
2. Process header rows separately
3. Modify business logic
47
Group related rows together
 Custom data reader
 Multiple rows behave like one row
 Process each group row in a loop, on
the same node
 Pro
 Business logic not modified
 Con
 Relationships may be too complex
 Groups may grow too big
ID Data
1 …
1 …
2 …
3 …
3 …
4 …
48
Process header rows separately
 Run business logic for header rows first
 Collect result in NavigableMap
 Run business logic for data rows
 Initialize data from previous header
 floorKey(dataRowIndex)
 Pro
 Minimal changes to business logic
 Con
 Relationships may be too complex
ID Type Data
1 Head …
1 Data …
1 Data …
2 Head …
2 Data …
3 Head …
3 Data …
49
Modify business logic
 Row relationship could be removed, if it’s
 Unintentional (a bug)
 For unnecessary optimization
 Data that could be retrieved otherwise
 Pro
 High chance for good performance
 Con
 High chance for new bugs
50
 Input and output data must be shared
 Network storage
 How long does it take to copy 200 GB?
Transfer
Process
Transfer
Process
Transfer
Heavy
Process
Heavy
ProcessTransfer
Transfer Process
51
 Sequential batches rely on ordering
 Tricky to keep in Spark
 Safe operations: map, filter, zip
 Unsafe operations: join, group, sort
Process
Process
Process
Process
Process
Process
Shuffle
Process
Process
Process
Shuffle
52
 Good for
 Heavy processing
 Independent input data records
 One input, multiple outputs
 Unordered data
 Not so great for
 Little processing
 Dependencies between data records
 Merging multiple data sources
53
54
55
321
321Data
Saturday Sunday Monday
56
vs.
57
58
Next Phase
1.0
Initial phase
2.0 In-house
development
3.0
Standardization
4.0
Data Optimized
Outsource based,
just started.
Vendor locked-in.
In-house
development,
differentiate with
lower costs and
faster delivery.
Standardized
system
architecture, both
for hardware and
software.
Overwhelming
differentiation,
with enabling
architecture for
customer centric
service.
Achieved Next
Current Standard
Architecture
COBOL to Apache Spark

More Related Content

PPTX
ETL Process
PDF
Understanding big data and data analytics big data
PDF
Graph-Powered Machine Learning
PDF
How Graph Algorithms Answer your Business Questions in Banking and Beyond
PDF
Big Data, Big Deal: For Future Big Data Scientists
PPTX
Big data by Mithlesh sadh
PDF
Design Guidelines for Data Mesh and Decentralized Data Organizations
PDF
NOSQLEU - Graph Databases and Neo4j
ETL Process
Understanding big data and data analytics big data
Graph-Powered Machine Learning
How Graph Algorithms Answer your Business Questions in Banking and Beyond
Big Data, Big Deal: For Future Big Data Scientists
Big data by Mithlesh sadh
Design Guidelines for Data Mesh and Decentralized Data Organizations
NOSQLEU - Graph Databases and Neo4j

What's hot (20)

PDF
Neo4j Graph Data Science Training - June 9 & 10 - Slides #6 Graph Algorithms
PPT
Data Warehousing and Data Mining
PDF
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
PPT
PDF
Statistics and Data Mining
PPTX
Our big data
PDF
Intro to Classification: Logistic Regression & SVM
PPTX
Effective Integration of SAP MDM & BODS
PPTX
Neo4j GraphSummit London March 2023 Emil Eifrem Keynote.pptx
PPTX
Data Wrangling
PPTX
Exploratory data analysis with Python
PDF
Decision tree
PPT
1.6.data preprocessing
PDF
Data Visualization in Data Science
PPTX
Synthetic Data for Big Data Privacy
PDF
LDM Slides: Conceptual Data Models - How to Get the Attention of Business Use...
PDF
Empowering Business Users: OBIEE 12c Visual Analyzer and Data Mashup
PDF
A direct method for estimating linear non-Gaussian acyclic models
PPTX
How Insurance Companies Use MongoDB
PDF
Modern Data Challenges require Modern Graph Technology
Neo4j Graph Data Science Training - June 9 & 10 - Slides #6 Graph Algorithms
Data Warehousing and Data Mining
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Statistics and Data Mining
Our big data
Intro to Classification: Logistic Regression & SVM
Effective Integration of SAP MDM & BODS
Neo4j GraphSummit London March 2023 Emil Eifrem Keynote.pptx
Data Wrangling
Exploratory data analysis with Python
Decision tree
1.6.data preprocessing
Data Visualization in Data Science
Synthetic Data for Big Data Privacy
LDM Slides: Conceptual Data Models - How to Get the Attention of Business Use...
Empowering Business Users: OBIEE 12c Visual Analyzer and Data Mashup
A direct method for estimating linear non-Gaussian acyclic models
How Insurance Companies Use MongoDB
Modern Data Challenges require Modern Graph Technology
Ad

Viewers also liked (20)

PDF
トラブルシューティングのあれこれ Yoshihiko kamata
PDF
はてなのインフラの歴史、そしてMackerelへ至る道とこれから
PDF
AI based language learning tools
PDF
WannaEat: A computer vision-based, multi-platform restaurant lookup app
PDF
Predictions and Hard Problems With AI
PDF
Don't manage too hard!
PDF
Rakuten app productivity initiative for developers marcus saw
PDF
AI AND FUNDAMENTAL GAME TECHNOLOGIESIN FINAL FANTASY XV
PDF
時間がないといって、オペレーション改善を怠るな~オペレーション改善奮闘記~ Emi muroya
PDF
What i learned from translation of the sre ryuji tamagawa
PDF
Rakutenとsreと私 yanagimoto koichi
PDF
Value Delivery through RakutenBig Data Intelligence Ecosystem and Technology
PDF
Challenge for statup's cto from big company nagaaki hoshi
PDF
Life of an enginner in rakuten osaka diarmaid lindsay
PDF
Rakuten Technology Conference 2017 A Distributed SQL Database For Data Analy...
PDF
Human-Centric Machine Learning
PDF
One Hundred Languages
PDF
Java ee7 with apache spark for the world's largest credit card core systems, ...
PDF
cloudera Apache Kudu Updatable Analytical Storage for Modern Data Platform
PDF
RTC 2017 - The Power of Parallelism
トラブルシューティングのあれこれ Yoshihiko kamata
はてなのインフラの歴史、そしてMackerelへ至る道とこれから
AI based language learning tools
WannaEat: A computer vision-based, multi-platform restaurant lookup app
Predictions and Hard Problems With AI
Don't manage too hard!
Rakuten app productivity initiative for developers marcus saw
AI AND FUNDAMENTAL GAME TECHNOLOGIESIN FINAL FANTASY XV
時間がないといって、オペレーション改善を怠るな~オペレーション改善奮闘記~ Emi muroya
What i learned from translation of the sre ryuji tamagawa
Rakutenとsreと私 yanagimoto koichi
Value Delivery through RakutenBig Data Intelligence Ecosystem and Technology
Challenge for statup's cto from big company nagaaki hoshi
Life of an enginner in rakuten osaka diarmaid lindsay
Rakuten Technology Conference 2017 A Distributed SQL Database For Data Analy...
Human-Centric Machine Learning
One Hundred Languages
Java ee7 with apache spark for the world's largest credit card core systems, ...
cloudera Apache Kudu Updatable Analytical Storage for Modern Data Platform
RTC 2017 - The Power of Parallelism
Ad

Similar to COBOL to Apache Spark (20)

PPTX
Java EE 7 with Apache Spark for the World’s Largest Credit Card Core Systems ...
PPTX
Case Study: Credit Card Core System with Exalogic, Exadata, Oracle Cloud Mach...
PPTX
Evolutionary database design
PDF
How to Migrate Applications Off a Mainframe
PDF
Vilmos Vaspal (Freesoft)
PDF
2012 06-15-jazoon12-sub138-eranea-large-apps-migration
PPT
Bse 3105 lecture 5-evolution of legacy systems
PDF
M3 Modernization Case Study
DOCX
Ashok Architect resume
PPTX
PPTX
Java EE 6 Adoption in One of the World's Largest Online Financial Systems (fo...
DOC
Vivek_Ojha (1)
PPT
Db trends final
DOC
Ranjith resume
PDF
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems [Ja...
PDF
Case Study of Financial Web System Development and Operations with Oracle Web...
DOCX
RAGHUNATH_GORLA_RESUME
PDF
SE.Software design Data Intensive system lecture 5c.pdf
PDF
Technical Recruitment Overview & Tips
DOC
Madhava_Sr_JAVA_J2EE
Java EE 7 with Apache Spark for the World’s Largest Credit Card Core Systems ...
Case Study: Credit Card Core System with Exalogic, Exadata, Oracle Cloud Mach...
Evolutionary database design
How to Migrate Applications Off a Mainframe
Vilmos Vaspal (Freesoft)
2012 06-15-jazoon12-sub138-eranea-large-apps-migration
Bse 3105 lecture 5-evolution of legacy systems
M3 Modernization Case Study
Ashok Architect resume
Java EE 6 Adoption in One of the World's Largest Online Financial Systems (fo...
Vivek_Ojha (1)
Db trends final
Ranjith resume
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems [Ja...
Case Study of Financial Web System Development and Operations with Oracle Web...
RAGHUNATH_GORLA_RESUME
SE.Software design Data Intensive system lecture 5c.pdf
Technical Recruitment Overview & Tips
Madhava_Sr_JAVA_J2EE

More from Rakuten Group, Inc. (20)

PDF
EPSS (Exploit Prediction Scoring System)モニタリングツールの開発
PPTX
コードレビュー改善のためにJenkinsとIntelliJ IDEAのプラグインを自作してみた話
PDF
楽天における安全な秘匿情報管理への道のり
PDF
What Makes Software Green?
PDF
Simple and Effective Knowledge-Driven Query Expansion for QA-Based Product At...
PDF
DataSkillCultureを浸透させる楽天の取り組み
PDF
大規模なリアルタイム監視の導入と展開
PDF
楽天における大規模データベースの運用
PDF
楽天サービスを支えるネットワークインフラストラクチャー
PDF
楽天の規模とクラウドプラットフォーム統括部の役割
PDF
Rakuten Services and Infrastructure Team.pdf
PDF
The Data Platform Administration Handling the 100 PB.pdf
PDF
Supporting Internal Customers as Technical Account Managers.pdf
PDF
Making Cloud Native CI_CD Services.pdf
PDF
How We Defined Our Own Cloud.pdf
PDF
Travel & Leisure Platform Department's tech info
PDF
Travel & Leisure Platform Department's tech info
PDF
OWASPTop10_Introduction
PDF
Introduction of GORA API Group technology
PDF
100PBを越えるデータプラットフォームの実情
EPSS (Exploit Prediction Scoring System)モニタリングツールの開発
コードレビュー改善のためにJenkinsとIntelliJ IDEAのプラグインを自作してみた話
楽天における安全な秘匿情報管理への道のり
What Makes Software Green?
Simple and Effective Knowledge-Driven Query Expansion for QA-Based Product At...
DataSkillCultureを浸透させる楽天の取り組み
大規模なリアルタイム監視の導入と展開
楽天における大規模データベースの運用
楽天サービスを支えるネットワークインフラストラクチャー
楽天の規模とクラウドプラットフォーム統括部の役割
Rakuten Services and Infrastructure Team.pdf
The Data Platform Administration Handling the 100 PB.pdf
Supporting Internal Customers as Technical Account Managers.pdf
Making Cloud Native CI_CD Services.pdf
How We Defined Our Own Cloud.pdf
Travel & Leisure Platform Department's tech info
Travel & Leisure Platform Department's tech info
OWASPTop10_Introduction
Introduction of GORA API Group technology
100PBを越えるデータプラットフォームの実情

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Cloud computing and distributed systems.
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Approach and Philosophy of On baking technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Spectral efficient network and resource selection model in 5G networks
Advanced methodologies resolving dimensionality complications for autism neur...
Cloud computing and distributed systems.
Chapter 3 Spatial Domain Image Processing.pdf
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Modernizing your data center with Dell and AMD
Per capita expenditure prediction using model stacking based on satellite ima...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Review of recent advances in non-invasive hemoglobin estimation
Approach and Philosophy of On baking technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Understanding_Digital_Forensics_Presentation.pptx
Electronic commerce courselecture one. Pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25 Week I
“AI and Expert System Decision Support & Business Intelligence Systems”
GamePlan Trading System Review: Professional Trader's Honest Take
CIFDAQ's Market Insight: SEC Turns Pro Crypto

COBOL to Apache Spark

  • 1. Oct 28, 2017 Ville Misaki System Strategy Department, Rakuten Card Co., Ltd.
  • 2. 2  Ville Misaki  Senior Software Engineer  Technology Strategy Group, System Strategy Department, Rakuten Card Co., Ltd  Career  15+ years; 3 years at Rakuten  In Finland, the Netherlands, Japan  Java (EE), Perl, C++, web systems, relational databases, performance optimization & security
  • 3. 3  Oracle OpenWorld 2017  Case Study: Credit Card Core System with Exalogic, Exadata, Oracle Cloud Machine (CON4994) => Link  JavaOne 2017  Java EE 7 with Apache Spark for the World’s Largest Credit Card Core Systems (CON4998) => Link
  • 4. 4 Part 1 – Perfect Design 1. About Rakuten Card 2. Background 3. Platform Migration 4. Data Migration 5. Software Migration Part 2 – Harsh Reliability 6. Performance 7. Apache Spark 8. Judgement Day 9. Into the Future
  • 5. 5
  • 6. 6 Unified brand, ecosystems around the world.
  • 7. 7  Top-level credit card company in Japan  Core of Rakuten eco systems.  3rd position of total transaction volume in 2016. Growing rapidly.
  • 8. 8
  • 9. 9 Core Systems Web Systems External Systems Intra Systems
  • 10. 10 Mainframe  Old architecture – >20 years  High cost  Limited capacity and performance  Low maintainability  Vendor locked-in  Limited security  For more details, check session “From Mainframe to Java EE” at 16:00 today
  • 11. 11 Phase of the improvement – 3.0 1.0 Initial phase 2.0 In-house development 3.0 Standardization Outsource based, just started. Vendor locked-in. In-house development, differentiate with lower costs and faster delivery. Standardized system architecture, both for hardware and software. Achieved Current Standard Architecture
  • 12. 12
  • 13. 13 Oracle Exalogic + Exadata + ZFS Servers Mainframe Old New Core Systems
  • 14. 14  Financial de-facto standard  Java EE compliant.  Matured, from 1997.  Financial de-facto standard  ISO/IEC 9075 SQL compliant  Matured, from 1983. COBOL Network DB App Server Database Old New WebLogic Server Oracle Database
  • 15. 15
  • 17. 17  Data Conversion  Network database to relational database  ISAM/VSAM data to relational database  Legacy Japanese character set to Unicode  Fix data inconsistencies  Scale  Terabytes of live production data  Less than 24 hours time
  • 18. 18  Offline migration  Freeze data during migration  Full migration – not incremental  Customers mostly unaffected  Data & System migration  At the same time  Cannot be split into phases Cached
  • 20. 20
  • 22. 22 Reimplement Emulate Convert Pro • Optimal performance • Low maintenance cost • Development unchanged • Easy to test • Easy to migrate • Flexible cost vs. schedule • Case-by-case fixes • Easy to test Con • Expensive • Takes a long time • Risky • Difficult to test • Development unchanged • Low performance • Future questionable • Legacy code remains • Low performance points need to be addressed Requirements?
  • 23. 23 Reimplement Emulate Convert Pro • Optimal performance • Low maintenance cost • Development unchanged • Easy to test • Easy to migrate • Flexible cost vs. schedule • Case-by-case fixes • Easy to test Con • Expensive • Takes a long time • Risky • Difficult migration • Development unchanged • Low performance • Future questionable • Legacy code remains • Low performance points need to be addressed 2x Performance No regression Minimal downtime
  • 24. 24 Reimplement Emulate Convert Pro • Optimal performance • Low maintenance cost • Development unchanged • Easy to test • Easy to migrate • Flexible cost vs. schedule • Case-by-case fixes • Easy to test Con • Expensive • Takes a long time • Risky • Difficult migration • Development unchanged • Low performance • Future questionable • Legacy code remains • Low performance points need to be addressed 2x Performance No regression Minimal downtime
  • 25. 25 Japanese COBOL Source code Java Source code Customized source code converter  Convert from Japanese COBOL to Java EE  Keep original core business logic
  • 26. 26 Java From Web Systems, For New Logic COBOL From Old System, converted to Java  Ease of migration, resource re-use  Introduce power of Java EE  Introduce converter from YPS to Java “Dual Source Architecture” Japanese COBOL  Japanese source code  Almost abandoned  No books, no community Old New
  • 27. 27 New Logic (Java EE) Application Server (Java EE) Legacy Logic (Mainframe) Build Deploy Japanese COBOL Convert to COBOL Convert to Java COBOL Java Compile WAR Converter  Two sources, single binary  Easy to operate Java Byte Code Compile Java
  • 28. 28 BIG-IP Real-time Servers (WebLogic) Batch Servers (Spark & Java) Façade Rich clients Façade Façade Intranet External Intra Exadata Mail Form BIG-IP Façade BIG-IP External customers Scheduler CoreBusinessLogicAPIs Operation terminal Web browser Old New
  • 29. 29 Part 1 – Perfect Design 1. About Rakuten Card 2. Background 3. Platform Migration 4. Data Migration 5. Software Migration Part 2 – Harsh Reliability 6. Performance 7. Apache Spark 8. Judgement Day 9. Into the Future
  • 30. 30
  • 33. 33 Start Slow Slow  Batches are run as networks  Hierarchical  Critical path  Time window
  • 34. 34  Automatic code conversion  COBOL program flow emulated in Java  COBOL-like data structures in Java  DB access logic  Business logic built on network DB  NDB and RDB are good at different tasks
  • 35. 35  COBOL vs. Java  Goto statement – imitation is complex  Sub-program calls – heavy  No local variables – tight coupling  No libraries – copy&paste code  Few shared data structures – copy&paste definition  No shared enum/constant – magic numbers
  • 36. 36  COBOL data structures  Fixed length – hard-coded  String-based  Data block inside program  Often thousands of fields  Hierarchical fields  Content is joined/split automatically  Variable namespace under each parent  Even five levels deep
  • 37. 37
  • 38. 38  Logic optimized for NDB  Read sequentially  Data pre-sorted  Data pre-formatted  Emulate in RDB  Uphill battle NDB RDB Search Slow Fast Sequential Access Fast Slow Sorting Slow Fast Formatting Fast Slow
  • 39. 39  New system must be faster  Time until launch: 1 year
  • 40. 40  Options?  Redesign and re-implement from scratch  Not feasible  Optimize framework  Limited effectiveness  Parallelize batches  Elastic brute-force
  • 41. 41
  • 43. 43 Cluster Node Cluster Node Cluster Node Cluster Node Cluster Node Bootstrap Scheduler Cluster Node SharedMemory
  • 44. 44 1. Making business logic parallel  Independent processing 2. I/O  Data transferred over network 3. Data ordering  Shuffles
  • 45. 45  Problem: input data rows are not independent!  Red flags  Fields not initialized for each row  Code forks early (header & data?)  Legacy code analysis  Refactor  Fields to local variables  Extract data structures  Initialize data for each row  Run & see 321 3 2 1 Reference?
  • 46. 46 1. Group related rows together 2. Process header rows separately 3. Modify business logic
  • 47. 47 Group related rows together  Custom data reader  Multiple rows behave like one row  Process each group row in a loop, on the same node  Pro  Business logic not modified  Con  Relationships may be too complex  Groups may grow too big ID Data 1 … 1 … 2 … 3 … 3 … 4 …
  • 48. 48 Process header rows separately  Run business logic for header rows first  Collect result in NavigableMap  Run business logic for data rows  Initialize data from previous header  floorKey(dataRowIndex)  Pro  Minimal changes to business logic  Con  Relationships may be too complex ID Type Data 1 Head … 1 Data … 1 Data … 2 Head … 2 Data … 3 Head … 3 Data …
  • 49. 49 Modify business logic  Row relationship could be removed, if it’s  Unintentional (a bug)  For unnecessary optimization  Data that could be retrieved otherwise  Pro  High chance for good performance  Con  High chance for new bugs
  • 50. 50  Input and output data must be shared  Network storage  How long does it take to copy 200 GB? Transfer Process Transfer Process Transfer Heavy Process Heavy ProcessTransfer Transfer Process
  • 51. 51  Sequential batches rely on ordering  Tricky to keep in Spark  Safe operations: map, filter, zip  Unsafe operations: join, group, sort Process Process Process Process Process Process Shuffle Process Process Process Shuffle
  • 52. 52  Good for  Heavy processing  Independent input data records  One input, multiple outputs  Unordered data  Not so great for  Little processing  Dependencies between data records  Merging multiple data sources
  • 53. 53
  • 54. 54
  • 57. 57
  • 58. 58 Next Phase 1.0 Initial phase 2.0 In-house development 3.0 Standardization 4.0 Data Optimized Outsource based, just started. Vendor locked-in. In-house development, differentiate with lower costs and faster delivery. Standardized system architecture, both for hardware and software. Overwhelming differentiation, with enabling architecture for customer centric service. Achieved Next Current Standard Architecture