Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Migrated orders component to Spring Data JDBC and PostgreSQL #429

Merged
merged 8 commits into from
Jan 3, 2024

Conversation

niallthomson
Copy link
Collaborator

@niallthomson niallthomson commented Jan 3, 2024

Fixes #17

The open source licensing of both JPA/Hibernate and Java MySQL drivers adds maintenance overhead. This PR migrates the ORM framework from JPA/Hibernate to Spring Data JDBC.

This has also driven a move to Flyway for managing the related database schema. Flyway will automatically perform migrations when the application starts.

Finally, the primary database dependency has moved from MySQL/MariaDB to PostgreSQL. All docker-compose files have been updated to use the correct images, and the Terraform has been modified to use the appropriate AWS infrastructure.

For now the datasource configuration has been simplified to a single datasource. This means the configuration mechanism has changed from:

SPRING_DATASOURCE_WRITER_URL=jdbc:mariadb://orders-db:3306/orders
SPRING_DATASOURCE_WRITER_USERNAME=orders_user
SPRING_DATASOURCE_WRITER_PASSWORD=${MYSQL_PASSWORD}
SPRING_DATASOURCE_READER_URL=jdbc:mariadb://orders-db:3306/orders
SPRING_DATASOURCE_READER_USERNAME=orders_user
SPRING_DATASOURCE_READER_PASSWORD=${MYSQL_PASSWORD}

To this:

SPRING_DATASOURCE_URL=jdbc:postgresql://orders-db:5432/orders
SPRING_DATASOURCE_USERNAME=orders_user
SPRING_DATASOURCE_PASSWORD=${MYSQL_PASSWORD}

The mysql Spring profile is also no longer used.

@niallthomson niallthomson changed the title chore: Migrated orders component away from JPA to Spring Data JDBC chore: Migrated orders component to Spring Data JDBC and PostgresQL Jan 3, 2024
@niallthomson niallthomson changed the title chore: Migrated orders component to Spring Data JDBC and PostgresQL chore: Migrated orders component to Spring Data JDBC and PostgreSQL Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove orders Hibernate dependency
1 participant