Skip to content

Cognition-Partner-Workshops/uc-data-source-migration-jdbc-normalization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Source Migration: Legacy to Modern

A small Spring Boot loan management application that currently connects to a legacy data warehouse (simulated via H2 with legacy-style schemas). The workshop challenge is to migrate the data source to a modern schema while keeping the application functional.

Overview

This app manages loan data: borrowers, loan products, loan accounts, and payment history. It currently reads from legacy tables with denormalized structures, cryptic column names, and outdated patterns. The goal is to rewire it to use a normalized modern schema with clear naming conventions.

Architecture

┌─────────────────────────────┐
│   Loan Service (Spring Boot)│
│                             │
│  Controllers ─► Services    │
│                  │          │
│              Repositories   │
│                  │          │
│         Legacy DataSource   │  ← YOU ARE HERE
│         (H2 / legacy schema)│
│                             │
│         Modern DataSource   │  ← MIGRATE TO HERE
│         (H2 / modern schema)│
└─────────────────────────────┘

Current State (Legacy)

The app connects to legacy tables:

  • CDW_BORR_MSTR — Borrower master (denormalized, cryptic columns)
  • CDW_LN_PROD — Loan products
  • CDW_LN_ACCT — Loan accounts (wide table with embedded borrower data)
  • CDW_PMT_HIST — Payment history

See data/legacy-schema/ for full DDL and data/mappings/ for column-level mappings.

Target State (Modern)

Migrate to normalized tables:

  • borrowers — Clean borrower records
  • loan_products — Product catalog
  • loan_accounts — Normalized loan accounts with foreign keys
  • payments — Payment records

See data/modern-schema/ for target DDL.

Quick Start

./mvnw spring-boot:run

The app runs on http://localhost:8080 with endpoints:

  • GET /api/loans — List all loans
  • GET /api/loans/{id} — Get loan details
  • GET /api/borrowers — List borrowers
  • GET /api/borrowers/{id} — Get borrower with loans
  • GET /api/payments/loan/{loanId} — Payment history for a loan

Tech Stack

  • Java 17
  • Spring Boot 3.2
  • Spring Data JPA
  • H2 (in-memory, simulating legacy DW)
  • Maven

License

MIT

About

Workshop repo: Spring Boot loan service with legacy CDW data source — migrate to modern normalized schema

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages