DESIGN AND IMPLEMENT OF REST API FOR DATA INTEGRATION
Prepared by: Mohd Kamir Yusof
DATA INTEGRATION
Data integration to combine data residing at different sources, and to provide the user with a unified view of these data
DATA INTEGRATION MODEL
Data Integration System
Unified View
Figure 1. Data Integration Model
EXISTING MODEL
Relational Database Model [4],
Resource Description Framework [5],
Object Exchange Model [6],
Extensible Markup Language (XML)[7- 8],
Native XML [9],
XML- Enables [10],
Hybrid XML [11]
JavaScript Object Notation (JSON)
PROBLEM?
REST API
DATA REPRESENTATION
Use JSON (JavaScript Object Notation) data
{
"name":"John", "age":30, "car":null
}
METHODOLOGY
REST API has been developed to allow other system/application send/receive data to another system/application
System A
System B
REST API
Data source
Data source
METHODOLOGY…
Steps
Extract Data
Send Data
Received and Dump Data
EXTRACT DATA
Data from database will be extract and convert into JSON format.
Definition 1:
Assume B represent dataset of JSON format, B = {D1, D2, D3, Dn} where D1 until Dn is element of B.
Definition 2:
Assume C represent dataset of D, C = {a1, a2, a3, an} where a1 until an is element of C.
SEND DATA
Input: Data in JSON format, B
Process:
Step 1: Assign a new end point of URL, EP Step 2: Map R = B → EP
Step 3: Response message from EP
Output: Response message (MSG) and set of JSON data (R)
Figure 2. Send data using REST API algorithm
RECEIVED & DUMP DATA
Input: R and MSG
Process:
Step 1: Fetch the data in JSON format, R
Step 2: Explode the data in array format
Step 3: Assign data to item set, I = {data1, data2, datan}
Step 4: Dump I into database
Step 5: Repeat Step 1 until Step 5
Step 6: Assign MSG equal to S if success (S) Else assign MSG equal to fail (F)
Step 7: Response message to SAP system
Output: MSG
Figure 3. Send data using REST API algorithm
IMPLEMENTATION
Communication between SAP and FEMS via REST API
SAP
FEMS
REST API
Data source
Data source
EXTRACT DATA…
Extract Data:-
Data from SAP will be extracted and convert into JSON format
B = {Purchase Order, Sales Order, …}
Purchase Order = {EBLEN, LIFNR, BEDAT, ….}
Sales Order = {VBELN, KUNNR, BSTD_E, …}
JSON FORMAT
SEND DATA
RECEIVED & DUMP DATA
RESULT
Response time
Data (MB) | Purchase Order | |
Response Time (Seconds) | CPU Usage (%) | |
200 | 0.200 | 10 |
300 | 0.231 | 12 |
400 | 0.345 | 13 |
500 | 0.401 | 15 |
RESULT
Response time
Data (MB) | Sales Order | |
Response Time (Milliseconds) | CPU Usage (%) | |
200 | 0.250 | 9 |
300 | 0.351 | 11 |
400 | 0.445 | 14 |
500 | 0.512 | 16 |
CONCLUSION