This Spring Boot application demonstrates a hybrid database architecture designed to bridge the gap between Relational (SQL) and NoSQL systems. The primary goal of the project was to implement a seamless data migration pipeline that transfers structured fitness data from a PostgreSQL database into a MongoDB document store, exposing the final data via a RESTful API.
- Automated Data Migration: Uses a
StartupRunnerto automatically migrate data from PostgreSQL to MongoDB on application launch. - Hybrid Persistence: Manages Entity-to-Document mapping, transforming strict SQL tables into flexible MongoDB documents.
- RESTful API: Provides endpoints for Create, Read, Update, and Delete (CRUD) operations on the MongoDB dataset.
- On-Demand Sync: Includes a dedicated endpoint (
POST /api/exercises/load) to trigger manual data synchronization between databases.
- Language: Java (Spring Boot)
- Databases: PostgreSQL (Relational), MongoDB (NoSQL)
- ORM/ODM: Spring Data JPA, Spring Data MongoDB
- The app connects to a legacy PostgreSQL database containing raw exercise data.
- The
DataMigrationServicefetches the SQL entities and maps them toExerciseDocumentobjects. - Data is persisted into MongoDB for high-performance reading via the API.