Lecture 2: Data-Level Integration & B2B Basics (EDI)

Learning Objective: Explore how systems integrate directly at the data layer, understand patterns like ETL and MDM, and examine how organizations conduct Business-to-Business (B2B) integration using Electronic Data Interchange (EDI).

1. What is Data-Level Integration?

Data-level integration involves sharing, consolidating, or migrating data directly between the databases or data stores of different applications. Instead of asking Application A to send a message to Application B via an API, a background process directly reads the database of Application A and writes it into the database of Application B.

Pros and Cons

Advantages:
Disadvantages (Risks):

2. Common Data Integration Patterns

Organizations typically use the following patterns to integrate at the data layer:

CRM DB ERP DB EXTRACT TRANSFORM LOAD Data Warehouse

Figure 1: Standard ETL (Extract, Transform, Load) Architecture

Example: Data Transformation via SQL (PL/SQL)

In legacy systems, much of the data integration and transformation was handled using advanced database scripts like PL/SQL. Below is an example of an "Upsert" (Update or Insert) operation synchronizing customer records:

MERGE INTO DataWarehouse.Customers dw
USING CRM.Customers crm
ON (dw.CustomerID = crm.CustomerID)
WHEN MATCHED THEN 
    UPDATE SET dw.Phone = crm.Phone, dw.LastUpdated = SYSDATE
WHEN NOT MATCHED THEN 
    INSERT (CustomerID, Name, Phone, LastUpdated)
    VALUES (crm.CustomerID, crm.Name, crm.Phone, SYSDATE);

3. Business-to-Business (B2B) Integration: Introduction to EDI

While database integration works well inside an organization, you cannot easily share direct database access with external partners (suppliers, distributors, clients) due to security and network constraints. This is where B2B Integration comes in.

Electronic Data Interchange (EDI) is the computer-to-computer exchange of standard business documents in an electronic format between business partners. Developed in the 1970s and 1980s, it replaced paper-based systems like faxing and mailing Purchase Orders and Invoices.

Code Comparison: EDI vs. Modern JSON

To understand why EDI requires specialized translation middleware, look at an example of an ANSI X12 850 (Purchase Order) document compared to a modern JSON equivalent.

ANSI X12 EDI (Purchase Order)

Highly compressed, positional, delimited by specific characters (like `*` and `~`).

ST*850*0001~
BEG*00*SA*PO12345**20260316~
REF*VN*VEND999~
N1*ST*UDAYANA UNIVERSITY~
N3*JL PB SUDIRMAN~
N4*DENPASAR*BALI*80232*ID~
PO1*1*10*EA*15.00**VN*SKU1122~
CTT*1~
SE*9*0001~
Modern JSON Equivalent

Self-describing, easy for humans and modern web apps to read, but uses more bandwidth.

{
  "documentType": "850",
  "purchaseOrder": "PO12345",
  "date": "2026-03-16",
  "vendorId": "VEND999",
  "shipTo": {
    "name": "Udayana University",
    "address": "Jl PB Sudirman",
    "city": "Denpasar",
    "province": "Bali"
  },
  "items": [
    {
      "sku": "SKU1122",
      "qty": 10,
      "price": 15.00
    }
  ]
}
Discussion Prompt for Students: If JSON is so much easier to read and process using modern programming languages (like Python or Node.js), why do massive global supply chains and logistics companies still rely heavily on legacy EDI standards today? Discuss the concepts of standard inertia, legacy investment, and industry compliance.