This project demonstrates healthcare data migration from a legacy SQL Server database to AWS RDS (PostgreSQL) and DynamoDB using AWS DMS, along with a Spring Boot REST API for managing hospital operations.
It provides:
- Data Migration templates (
aws-dms/) for SQL Server β AWS RDS & DynamoDB. - RESTful APIs for Patient Registration, Appointments, and Billing.
- Audit Logging in DynamoDB for migration and API activity.
- Database setup with schema + seed data.
- Spring Boot 3 + Java 17 backend
- JPA + Hibernate with PostgreSQL/MySQL support
- AWS SDK v2 (DynamoDB Enhanced Client)
- Data Migration via AWS DMS (full load + CDC)
- Swagger/OpenAPI documentation
- Pre-seeded DB data (
schema.sql,data.sql)
healthcare-data-migration-api/
βββ src/main/java/com/healthcare/
β βββ Application.java # Main Spring Boot entrypoint
β βββ domain/ # Entities: Patient, Appointment, Billing
β βββ dto/ # DTO classes for requests/responses
β βββ repository/ # Spring Data JPA repositories
β βββ service/ # Business services + DynamoDB Audit service
β βββ controller/ # REST controllers
β βββ config/ # AWS DynamoDB config
β βββ dynamodb/ # DynamoDB models (AuditLog)
β βββ exception/ # Exception handling
β βββ mapper/ # DTO β Entity mappers
β
βββ src/main/resources/
β βββ application.yml # Spring Boot configuration
β βββ schema.sql # (Optional) Schema definitions
β βββ data.sql # Seed data
β
βββ aws-dms/
β βββ dms-endpoints.json # Example source/target endpoint config
β βββ dms-task-settings.json # Example migration task (Full load + CDC)
β βββ aws-cli-example.md # CLI usage examples
β
βββ pom.xml # Maven dependencies
βββ README.md # Project documentation
- Java 17, Spring Boot 3
- Spring Data JPA
- PostgreSQL / MySQL (RDS target DB)
- AWS DynamoDB (Audit logs)
- AWS DMS (Data Migration Service)
- Swagger UI (OpenAPI)
git clone https://github.com/hq969/healthcare-data-migration-api.git
cd healthcare-data-migration-apidocker run --name healthcare-db -e POSTGRES_USER=healthcare -e POSTGRES_PASSWORD=healthcare -e POSTGRES_DB=healthcare -p 5432:5432 -d postgres:15For MySQL instead:
docker run --name healthcare-mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=healthcare -e MYSQL_USER=healthcare -e MYSQL_PASSWORD=healthcare -p 3306:3306 -d mysql:8Edit src/main/resources/application.yml to set DB credentials and AWS region/table.
Switch DB profiles:
# Default (Postgres)
SPRING_PROFILES_ACTIVE=dev
# MySQL
SPRING_PROFILES_ACTIVE=mysql./mvnw clean package
./mvnw spring-boot:runSwagger UI available at: π http://localhost:8080/swagger-ui/index.html
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/patients |
Get all patients |
| POST | /api/patients |
Create new patient |
| GET | /api/appointments |
Get all appointments |
| POST | /api/appointments |
Schedule appointment |
| GET | /api/billings |
Get billing records |
| POST | /api/billings |
Create new billing entry |
-
Create replication instance in AWS DMS.
-
Configure endpoints:
aws-dms/dms-endpoints.json- Update hostnames, ports, usernames, and passwords.
-
Create replication task using:
aws-dms/dms-task-settings.json
-
Run with CLI:
aws dms create-endpoint --cli-input-json file://aws-dms/dms-endpoints.json
aws dms create-replication-task --cli-input-json file://aws-dms/dms-task-settings.json
aws dms start-replication-task --replication-task-arn <TASK_ARN> --start-replication-task-type start-replicationDetailed commands are in aws-dms/aws-cli-example.md.
- Connect to RDS PostgreSQL and check
patients,appointments,billingstables. - Check DynamoDB audit logs for migration activity.
- Test REST APIs with Swagger UI.
After startup, DB is preloaded with:
- Patient:
Asha Verma(MRN1001) - Appointment: Cardiology with
Dr. Smith - Billing:
βΉ1200.50pending
- Add authentication & JWT security
- Extend modules: pharmacy, lab results
- Set up CI/CD pipeline for AWS deployment
Harsh Sonkar AWS Engineer | Data Engineer | Full-Stack Developer